Hi all
I'm using warpAffine to rotate an image. Basically I have a rectangular mask that I made from a RotatedRect and I want to rotate the mask so it's side's are parallel to the the sides of the screen. The thing is its behaving unpredictably. Sometimes it works like a charm other times it doesn't to anything. What could be causing this?
Some code:
Point pt = new Point(rotatedRect.center.x, rotatedRect.center.y);//center of the bounding box
Mat r = Imgproc.getRotationMatrix2D(pt, angle, 1.0);//angle is negative. this is only good when pt[0] is the bottom left vertex of the rect, otherwise not good. need to have a check
Imgproc.warpAffine(textOnlymat, textOnlymat, r, new Size(textMat.cols(), textMat.rows()));