#代码,使用了opencv自带的函数linearPolar import cv2 import numpy as np source = cv2.imread('images/image.jpg', 1) img = source.astype(np.float32) value = np.sqrt(((img.shape[0]/2.0)**2.0)+((img.shape[1]/2.0)**2.0)) polar_image = cv2.linearPolar(img,(img.shape[0]/2, img.shape[1]/2), value, cv2.WARP_FILL_OUTLIERS) polar_image = polar_image.astype(np.uint8) polar_image_90 = np.rot90(polar_image) cv2.imshow("Polar_Image_90", polar_image_90) cv2.waitKey(0) cv2.destroyAllWindows()
效果: