【发布时间】:2012-02-20 22:29:41
【问题描述】:
我很难找到使用 OpenCV 在 Python 中将图像围绕特定点旋转特定(通常非常小)角度的示例。
这是我目前所拥有的,但它产生了一个非常奇怪的结果图像,但它有点旋转:
def rotateImage( image, angle ):
if image != None:
dst_image = cv.CloneImage( image )
rotate_around = (0,0)
transl = cv.CreateMat(2, 3, cv.CV_32FC1 )
matrix = cv.GetRotationMatrix2D( rotate_around, angle, 1.0, transl )
cv.GetQuadrangleSubPix( image, dst_image, transl )
cv.GetRectSubPix( dst_image, image, rotate_around )
return dst_image
【问题讨论】: