ROI functions in c and c++
I have the following c code implementation and i want to port to c++ i want to use equivalent to cvSetImageROI ,cvResetImageROI
cvSetImageROI(pMainImg,cvROIRect);
cvMatchTemplate(pMainImg, pTempImg, res, CV_TM_CCOEFF_NORMED );
cvResetImageROI(pMainImg);
but i did not find the equivalent function in c++ implementation
is that the only way to create new matrix and path the ROI to the original Matrix such as
cv::Mat roiImg;
roiImg = img2(roi);
is there any other way to do my job directly inside the original matrix ?
What's exactly your problem with the new ROI definition? As easy as doing
i want access the original matrix directly , MatchTemplate is sample of using ROI , i may smooth , rotate , or doing any action affact only ROI , finally i want to keep the changes done in the ROI in the original matrix
Setting a ROI does not create a new header/matrix, only a pointer to the original matrix. Therefore, every change in the ROI will be reflected in the original matrix as well. This tutorial makes this and other observations that might be interest for you
Thanks @LorenaGdL i will test and feed you back , also i found function in the Mat class to set and change the ROI the function called "adjustROI"
Thanks @LorenaGdL , The method working correctly , the changes in ROI is updated in the original image