fast Cartesian to Polar to Cartesian in Python
I'd like to kindly ask for help and advice. 
I want to transform in Python 2d arrays/images to polar, process then, and subsequently transform them back to cartesian. The following is the result from ImajeJ [Polar Tranformer][1] plugin (used on the concentric circles of the sample code)

check image [http://i.stack.imgur.com/5Tav4.jpg][2] (sorry, no reputation points to post images)

The number and dims of the images is quite large so I was checking whether openCV has a fast and simple way to do this.

I read about cv. `CartToPolar` and `PolarToCart` but I failed to use it. I understand better the `LogPolar` where the input and output are arrays, and where you can set the center, interpolation,and inversion (i.e `CV_WARP_INVERSE_MAP`). Is there a way to use CartToPolar/PolarToCart in an similar fashion?

        import numpy as np
        import cv

        #sample 2D array that featues concentric circles
        circlesArr = np.ndarray((512,512),dtype=np.float32)
        for i in range(10,600,10): cv.Circle(circlesArr,(256,256),i-10,np.random.randint(60,500),thickness=4)

        #logpolar
        lp = np.ndarray((512,512),dtype=np.float32)
        cv.LogPolar(circlesArr,lp,(256,256),100,cv.CV_WARP_FILL_OUTLIERS)

        #logpolar Inverse
        lpinv = np.ndarray((512,512),dtype=np.float32)
        cv.LogPolar(lp,lpinv,(256,256),100, cv.CV_WARP_INVERSE_MAP + cv.CV_WARP_FILL_OUTLIERS)

        #display images
        from scipy.misc import toimage
        toimage(lp, mode="L").show()
        toimage(lpinv, mode="L").show()

This is for a tomography (CT) workflow where rings artifacts can be filtered out easier if they appear as lines.

Thank you in advance!


  [1]: http://rsbweb.nih.gov/ij/plugins/polar-transformer.html
  [2]: http://i.stack.imgur.com/5Tav4.jpg
fast Cartesian to Polar to Cartesian in Python
===

I'd like to kindly ask for help and advice. 
I want to transform in Python 2d arrays/images to polar, process then, and subsequently transform them back to cartesian. The following is the result from ImajeJ [Polar Tranformer][1] plugin (used on the concentric circles of the sample code)

check image [http://i.stack.imgur.com/5Tav4.jpg][2] (sorry, no reputation points to post images)

The number and dims of the images is quite large so I was checking whether openCV has a fast and simple way to do this.

I read about cv. `CartToPolar` and `PolarToCart` but I failed to use it. I understand better the `LogPolar` where the input and output are arrays, and where you can set the center, interpolation,and inversion (i.e `CV_WARP_INVERSE_MAP`). Is there a way to use CartToPolar/PolarToCart in an similar fashion?

        import numpy as np
        import cv

        #sample 2D array that featues concentric circles
        circlesArr = np.ndarray((512,512),dtype=np.float32)
        for i in range(10,600,10): cv.Circle(circlesArr,(256,256),i-10,np.random.randint(60,500),thickness=4)

        #logpolar
        lp = np.ndarray((512,512),dtype=np.float32)
        cv.LogPolar(circlesArr,lp,(256,256),100,cv.CV_WARP_FILL_OUTLIERS)

        #logpolar Inverse
        lpinv = np.ndarray((512,512),dtype=np.float32)
        cv.LogPolar(lp,lpinv,(256,256),100, cv.CV_WARP_INVERSE_MAP + cv.CV_WARP_FILL_OUTLIERS)

        #display images
        from scipy.misc import toimage
        toimage(lp, mode="L").show()
        toimage(lpinv, mode="L").show()

This is for a tomography (CT) workflow where rings artifacts can be filtered out easier if they appear as lines.

Thank you in advance!


  [1]: http://rsbweb.nih.gov/ij/plugins/polar-transformer.html
  [2]: http://i.stack.imgur.com/5Tav4.jpg