Polar to cartesian and back

  • I have been working with a 360 lense from this company http://www.0-360.com/

    I needed a quick way to see what the images were like unwarped and there was not much around. There was one polar to cartesian gl actor I found but it did not allow for adjustments. This is made with a core image filter published as a quartz composer patch. As it is reliant on aspect ration and resolution you will have to put your processing resolution at 1920 x 1080.
    There are 2 qc patches to put in your free frame folder an isadora patch and a couple of image samples. The centrex and centrey controls on the polar to cartesian are to find the centre of the circle. If these are wrong then the image does not un-warp correctly. This is pretty efficient as it is a core image filter (testing in QC shows a massive difference in setting QC to run as 32bit vs 64 - not sure how that is effected in Isadora but I assume it stays 32).
    You can download the sample here
  • Beta Gold

    Isadora has a simple way to calculate cartesian to polar:

    Mousewatcher (or whatever sensor gives you y and y coordinates) - and calc angle in which x2 and y2 are set to 50\. Et voila. (Don't forget to trigger values updates into trigger input of the calc angle....
    But I can't figure out the polar to cartesian.... 


  • Sure calculating the angle is not that hard but this is for unwarping whole images that are shot on a spherical mirror (realtime and HD). Unless I missed something and you can use that coordinate to unwarp an image some how.

  • Fred,

    I think it's not a problem of polar to cartesian transformation (who are just 2 ways to write the position in space, 1 with x/y, cartesian, other one with angle and distance, polar)
    It's mor a question of projection from space to plan, like in cartography you have mercator or lambert projection.
    Perhaps you could try with the 3D Mesh Projector, who make the transform in real time, using the relative coordinate of the same point in different geometric system.
    The problem is that the description format (.dat) is not well documented. I worked a bit on it but I stopped for that reason, but it could be a way to resolve your problem.
    Hope that help,

  • OK again, the problem is solved and the files above are there if anyone else wants a GPU solution for using 360 lenses and wants to see the footage. Have a look at the files and you will see what they do. I am not actually using Isadora for this project, I am displaying the images in an oculus rift so I wrote my own software solution. I thought I would share an Isadora friendly version of part of it. Still use full if you want 360, live or in playback.

  • Beta Gold

    Thanks Fred.

  • Thanks Fred, gave it a try. Inside the zip is an empty foleder called 'To Freeframe'
    Was there supposed to be anything in there?

    I put the .qtz files into my Compositions folder and they load ok as QC actors.
    Scene 'car to pol' in the izz patch works perfectly but pol to car has no visible output from the QC actor
    I checked in QC and the inputs/outputs are published.

    I am using latest izzy beta 1.5.30f23

    jamie :)

  • Sorry I updated the link above, it should all work now.

  • thanks @Fred

  • @fred, I just tried downloading the sample above but the link is broken :-(
    Do you still have this patch and sample somewhere? I am trying to work with similar images to those from the 0-360 tool, and to interact with them via Isadora and an OSC accelerometer. I think your patch would be very useful for getting me started.

    Many thanks

    Mark M

  • I will have a better look when I get the chance, so far I dont find the old files. 

    I made it using Quartz composer and programming in the core image filter node in QC and published the inputs and outputs
    I think this code looks like it will do both directions
    Best of luck

  • Thanks, Fred.

    I'm afraid I have no knowledge of Quartz Composer... yet! Always something new to learn!