Next: , Previous: , Up: Internal Routines   [Contents][Index]


15.5.121 ctop

ctop( im [, x0, y0])

Transforms two-dimensional image im from Cartesian (rectangular) to polar coordinates. im must be of types float or double. x0 and y0 specify the floating-point Cartesian coordinates of the center of the polar coordinate system, which defaults to the middle of the image.

The result is another two-dimensional image of the same type as im. If p = ctop(im, x0, y0), and if (r, a) are the coordinates of a pixel in the result image, then the coordinates of the corresponding pixel in im are (x0 + r*cos(a*#2pi/dimen(p,0), y0 + r*sin(a*#2pi/dimen(p,1))). The first dimension of the result image measures the polar angle, and the second one the polar radius. The unit of the radius is one pixel. The unit of the azimuth is 360/dimen(p,1) degrees.

Results are included for all (integer) values of the radius for which the corresponding circle falls completely within the image im. The size of the second dimension of the result is equal to one more than the radius of the biggest circle (around the selected center) that falls completely within the image. The result image samples im at a resolution of approximately one sample per pixel. The size of the first dimension is approximately equal to #2pi*r if r is the largest included radius. The exact size of the first dimension is chosen such that it has factors only from the set 2, 3, and 5, so that Fourier transforms with fft in that dimension can be performed relatively quickly.

Reverse: ptoc

See also: dimen, fft, sin, #2pi


Next: , Previous: , Up: Internal Routines   [Contents][Index]