The Class of
Segmentation8UC1
. This class run function
run(const cv::Mat& image)
return a cv::Mat with the type is cv_8UC1. Sample code : auto det =
vitis::ai::Segmentation8UC1::create
(vitis::ai::SEGMENTATION_FPN);
auto img = cv::imread("sample_segmentation.jpg");
int width = det->getInputWidth();
int height = det->getInputHeight();
cv::Mat image;
cv::resize(img, image, cv::Size(width, height), 0, 0,
cv::INTER_LINEAR);
auto result = det->run(image);
for (auto y = 0; y < result.segmentation.rows; y++) {
for (auto x = 0; x < result.segmentation.cols; x++) {
result.segmentation.at<uchar>(y,x) *= 10;
}
}
cv::imwrite("segres.jpg",result.segmentation);
Quick Function Reference
The following table lists all the functions defined in the vitis::ai::Segmentation8UC1
class:
Type | Member | Arguments |
---|---|---|
std::unique_ptr<
Segmentation8UC1
> |
create |
|
int | getInputWidth |
|
int | getInputHeight |
|
size_t | get_input_batch |
|
SegmentationResult
|
run |
|
std::vector<
SegmentationResult
> |
run |
|