我很难找到使用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
angle
的单位为度。 https://docs.opencv.org/2.4/modules/imgproc/doc/geometric_transformations.html?highlight=getrotationmatrix#getrotationmatrix2d - Eduardo Pignatelli