vitis::ai::RGBDsegmentation

Base class for RGBDsegmentation.

Input is a pair images which are RGB image (cv::Mat) and HHA map generated with depth map (cv::Mat).

Output is a heatmap where each pixels is predicted with a semantic category, like chair, bed, usual object in indoor.

Sample code:

Mat img_bgr = cv::imread("sample_rgbdsegmentation_bgr.jpg");
Mat img_hha = cv::imread("sample_rgbdsegmentation_hha.jpg");

auto segmentation = vitis::ai::RGBDsegmentation::create("SA-Gate_pt", true);

auto result = segmentation->run(img_bgr, img_hha);

imwrite("result.jpg", result.segmentation);

Display of the model results: width=\textwidth

Figure 1: out image

Image sample_RGBDsegmentation_result.jpg

Quick Function Reference

The following table lists all the functions defined in the vitis::ai::RGBDsegmentation class:

Table 1. Quick Function Reference
TypeNameArguments
std::unique_ptr< RGBDsegmentation >create
  • const std::string & model_name
  • bool need_preprocess
SegmentationResultrun
  • const cv::Mat & image_bgr
  • const cv::Mat & image_hha

create

Factory function to get an instance of derived classes of class RGBDsegmentation.

Prototype

std::unique_ptr< RGBDsegmentation > create(const std::string &model_name, bool need_preprocess=true);

Parameters

The following table lists the create function arguments.

Table 2. create Arguments
Type Name Description
const std::string & model_name Model name
bool need_preprocess Normalize with mean/scale or not, default value is true.

Returns

An instance of RGBDsegmentation class.

run

Function to get running result of the RGBDsegmentation neuron network.

Prototype


            SegmentationResult run(const cv::Mat &image_bgr, const cv::Mat &image_hha)=0;

Parameters

The following table lists the run function arguments.

Table 3. run Arguments
Type Name Description
const cv::Mat & image_bgr Input data of input image (cv::Mat).
const cv::Mat & image_hha Input data of input image_hha (cv::Mat).

Returns

SegmentationResult.