How to get image indices in polar coordinates
Show older comments
Actually the title is the question. Thank you
Answers (2)
Image Analyst
on 26 Nov 2011
0 votes
Where is your origin? At the upper left like it normally is for images? Have you seen cart2pol()?
4 Comments
Michael Shapira
on 26 Nov 2011
Image Analyst
on 26 Nov 2011
You don't use it with image objects. You use it on pixel coordinates. So it appears that you really don't want this function and want to do something totally different than what your subject line is. What do you really want to do, find, or measure in your image, and where did you upload your image to (e.g. tinypic.com)?
Michael Shapira
on 27 Nov 2011
Image Analyst
on 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.
Walter Roberson
on 26 Nov 2011
0 votes
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.
Categories
Find more on Blocked Images in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!