imutils
提供一系列进行基本图像处理的便捷功能。
Translation
使用imutils.translate
进行图像的平移:
# translate the image x=25 pixels to the right and y=75 pixels up
translated = imutils.translate(workspace, 25, -75)
Rotation
使用imutils.rotate
进行图像的旋转:
# loop over the angles to rotate the image
for angle in range(0, 360, 90):
# rotate the image and display it
rotated = imutils.rotate(bridge, angle=angle)
cv2.imshow("Angle=%d" %