Commit e1b66ffd authored by Naoto Mizuno's avatar Naoto Mizuno

Fix center of rotation

parent 0366c1b0
...@@ -90,7 +90,8 @@ below example which rotates the image by 90 degree with respect to center withou ...@@ -90,7 +90,8 @@ below example which rotates the image by 90 degree with respect to center withou
img = cv.imread('messi5.jpg',0) img = cv.imread('messi5.jpg',0)
rows,cols = img.shape rows,cols = img.shape
M = cv.getRotationMatrix2D((cols/2,rows/2),90,1) # cols-1 and rows-1 are the coordinate limits.
M = cv.getRotationMatrix2D(((cols-1)/2.0,(rows-1)/2.0),90,1)
dst = cv.warpAffine(img,M,(cols,rows)) dst = cv.warpAffine(img,M,(cols,rows))
@endcode @endcode
See the result: See the result:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment