in opencv there is no difference between an image and a ROI of an image. a cv::Mat object can be either:
cv::Mat img = cv::imread(fileName);
cv::Mat imgROI(img,cv::Rect(1,2,30,40));
My question is how can I extract the original ROI coordinates in the original image, i.e. some function that preforms the following:
cv::Rect originalROIcoords = roiLocationInOriginalImg(imgROI);
cv::Rect originalROIcoords2 = roiLocationInOriginalImg(img );
originalROIcoords should be (1,2,30,40), while originalROIcoords2 should be (0,0,w,h), where w and h are the original image width and height respectively.
Thanks.
Ohad
To know the coordinates of a submatrix in the original matrix, you can use the function
Mat::locateROI