How to get image indices in polar coordinates

4 Ansichten (letzte 30 Tage)
Michael Shapira
Michael Shapira am 26 Nov. 2011
Actually the title is the question. Thank you

Antworten (2)

Image Analyst
Image Analyst am 26 Nov. 2011
Where is your origin? At the upper left like it normally is for images? Have you seen cart2pol()?
  4 Kommentare
Michael Shapira
Michael Shapira am 27 Nov. 2011
Ok. Let me explian. This is stady task. Need to rotate an image in the frequency domain. It should be relatevely easy, since all you need to do is multiply indices by exp(i*angle). But this will work only is picture represented in polar coordinates. So the botlle neck for me currently is an ability to read the image transform it to polar coordinates and walkthrough it indices
Image Analyst
Image Analyst am 27 Nov. 2011
Isn't the angle arctangent(y/x)? You might need to call fftshift andset your origin at the center to get the right angle, like atan(((y-yCenter) / (x-xCenter)). By the way in the past week or so there already was a posting on how to rotate an image via the Fourier domain, perhaps it was a classmate of yours. Do a search for it. It had working code and everything.

Melden Sie sich an, um zu kommentieren.


Walter Roberson
Walter Roberson am 26 Nov. 2011
Are you trying to take a rectangular image and "warp" it to a circle, like a "fish-eye lens" ?
Are you trying to create a circular image and are hampered because arrays are rectangular, and you are not sure how to map the rectangular array to the circular image?
If your goal is to create a circular image and you want to know how to map the pixels, then there are two basic methods of doing that. You can start with the rectangular coordinates and "push" each of them in to the circle, or you can start with the circle and "pull" pixels from the rectangle.
People tend to program the "push" method, but it can be shown that for some image transformations, this will leave unpainted gaps in the final image. The only general and reliable method is the "pull" method of starting with the structure of the final image and figuring out where the pixels should come from.
Either way you have the problem that multiple pixels in the source will affect each destination pixel, so you have to use non-linear extrapolation. I know it would take me a while to figure out. I would probably google for information rather than working through the math.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by