I would like to use ROI to copy the found polygon in the image to a new image. I would like this polygon to exactly match the new image. So far I have used ROI, but I noticed that the angle is not taken into account, which gives me a bad result as soon as I rotate the object that I found. I need this object alone for further analysis ...
That's what I'm doing:
while() { CvSeq* approximatedContour = cvApproxPoly(currentContour, sizeof(CvContour), 0, CV_POLY_APPROX_DP, 8); etiquetteBox = cvMinAreaRect2(approximatedContour); CvSize2D32f sizeEtiquette = etiquetteBox.size; if() { CvPoint2D32f boxPoints[4]; cvBoxPoints(etiquetteBox, boxPoints); cvSetImageROI(thresImg,cvRect((int)boxPoints[1].x, (int)boxPoints[1].y, (int)sizeEtiquette.width,(int)sizeEtiquette.height)); cvResize(thresImg,thresImgResized); }
Does anyone know how to integrate an angle into a ROI? Is it possible to do otherwise?
Thanks!
CTZStef
source share