Re: Questions about the Log Polar Transform.



Okay - I finally worked it out (some things take some thought, others
don't - this does.....); it's really quite simple:

(1) Select a point in polar coords,
(2) Convert it to cartesian coordinates
(3) Interpolate the point in cartesian space




"Robin Tucker" <idontwanttobespammedanymore@xxxxxxxxxxxxxxx> wrote in
message news:db63vj$6up$1$8302bc10@xxxxxxxxxxxxxxxxxxx
>> That formula will only give you angles between -90 and +90 degrees. To
>> get proper polar coordinates, you'll have to use atan2(), or look at
>> the sign of (x-xc) and make a correction to get angles in the left half
>> of the plane.
>
> Yes, I noticed this so am now using atan2.
>
>>
>> That's the first half of the mapping. This gives you the polar
>> coordinates of the pixel in the source image. Then you have to map
>> that to a new position (x', y') in the destination image using
>> something like
>>
>> x' = k1 * r + k2
>> y' = k3 * a + k4
>>
>> where k1-k4 are constants used to set the size of the output image and
>> make the X and Y addresses all positive.
>
>
>
> Examples help (I'm not all that good at math):
>
> Resulting Image Map is 320 x 240 pixels.
> Source Image Map is 320 x 240 pixels,
>
> so, k1, k3 are both 1, k2 = 160, k4 = 120?
>
> Resulting Image Map is 320 x 240 pixels
> Source Image Map is 160 x 120 pixels,
>
> so, k1 = 0.5, k3 = 0.5, k2 = 160, k4 = 120?
>
>
>>
>> The easiest thing to do in this case is to operate in output image
>> space. For every pixel location (x', y') in the output image, calculate
>> the input pixel location (x, y) by inverting the expressions above.
>> This will give you a position that isn't exactly aligned with any input
>> pixel.
>>
>
> This is where I'm falling over (apart from everything else). If I
> iterate across the final image in Y and X, to get a mapping back from log
> polar coordinate space to cartesian space, how would I rearrange the given
> equations (I'm not a math graduate, to my great shame).
>
>
>
> Thanks.
>
>
>
>
>
>
>
>


.


Quantcast