import cv2
import numpy as np
 
source = cv2.imread("/home/sinadabiri/Dropbox/Images/cell3.tif",-1)
img64_float = source.astype(np.float64)
 
Mvalue = np.sqrt(((img64_float.shape[0]/2.0)**2.0)+((img64_float.shape[1]/2.0)**2.0))
 
 
ploar_image = cv2.linearPolar(img64_float,(img64_float.shape[0]/2, img64_float.shape[1]/2),Mvalue,cv2.WARP_FILL_OUTLIERS)
 
cartisian_image = cv2.linearPolar(ploar_image, (img64_float.shape[0]/2, img64_float.shape[1]/2),Mvalue, cv2.WARP_INVERSE_MAP)
 
cartisian_image = cartisian_image/200
ploar_image = ploar_image/255
cv2.imshow("log-polar1", ploar_image)
cv2.imshow("log-polar2", cartisian_image)
 
cv2.waitKey(0)
cv2.destroyAllWindows()