I have been following this example which shows how to generate a region of interest mask: zed-sdk/main.cpp at master · stereolabs/zed-sdk · GitHub
The mask appears properly in the output (essentially just combining the mask pixels with the cvImage), but this line does nothing: zed.setRegionOfInterest(slROI);
I assumed the camera input would limit the tracking to only whats visible in the mask. But after adding in either object or body tracking, it’s still detecting objects outside the mask?
Including a screenshot which demonstrates the issue- the yellow boxes in the top left image show tracked people, but they are outside the masked area (blue outline):
Minimal code sample:
cv::Mat ROI;
ROI = cv::Mat(720, 1280, CV_8UC1);
ROI.setTo(0);
cv::Rect selection_rect;
selection_rect.x = 900;
selection_rect.y = 0;
selection_rect.width = 600;
selection_rect.height = 600;
cv::rectangle(ROI, selection_rect, cv::Scalar(250), -1);
auto resolution = camera.getCameraInformation().camera_configuration.resolution;
sl::Mat slROI(resolution, MAT_TYPE::U8_C1, ROI.data, ROI.step);
camera.setRegionOfInterest(slROI);