1 | initial version |
For setting ROI in Video you can have some thing like below.
VideoCapture cap(0);
cv::Mat frame;
while(1)
cap >> frame; //Get the frame from cam
// SetImageRoi
cv::Rect roi(x, y, width, height);
cv::Mat image_roi = frame(roi); // note: this assignment does not copy data, frame and image_roi now share data
// Do some processing on ROI region
process(image_roi); // any changes to image_roi will also be in frame
// Reset ROI
// -- nothing required
}