Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

Mat rotation center

$
0
0
Hi, I'm rotating the 10x1 image by specifying center at 5,0: [255, 255, 255, 255, 255, 255, 255, 255, 255, 255] int size = 10; Mat test = Mat::zeros(Size(size, 1), CV_8U); line(test, Point(0, 0), Point(size, 0), Scalar(255)); Mat rot = getRotationMatrix2D(Point(test.cols/2, test.rows/2), 90, 1); Mat dest; warpAffine(test, dest, rot, Size(size, size)); imshow("Source", test); imshow("Result", dest); I assume that result will be the vertical line at center of 10x10 Mat, but it is shifted and cropped to the top: [ 0, 0, 0, 0, 0, 255, 0, 0, 0, 0; 0, 0, 0, 0, 0, 255, 0, 0, 0, 0; 0, 0, 0, 0, 0, 255, 0, 0, 0, 0; 0, 0, 0, 0, 0, 255, 0, 0, 0, 0; 0, 0, 0, 0, 0, 255, 0, 0, 0, 0; 0, 0, 0, 0, 0, 255, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] I'm trying to understand why it happens?

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>