Page 1 of 2

Using IM to translate Equirectangular panorama to Cubemap ?

Posted: 2016-02-03T04:38:49-07:00
by Oliv59
Hello here,

Here is the thing : i searched, a lot, here and across the web, to find a way to convert with PHP an equirectangular panorama (standard dimensions of 2 for 1), in a cubemap.
Couldn't find anything very interesting, so i made my way here to ask you, is there a way to do so ?

Thanks very much !
Oliv.

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Posted: 2016-02-03T10:33:16-07:00
by fmw42
Imagemagick has nothing built-in to do that directly. But it might be done by scripting if one knows the details of the conversion.

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Posted: 2016-02-03T10:55:18-07:00
by Oliv59
Thanks fmw42, but that's the point, i don't know how to convert ;)

Anyway, thnaks for your asnwer ...
Oliv.

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Posted: 2016-02-03T10:56:13-07:00
by Bonzo
I did not read it fully but there is an interesting thread on stackoverflow.

Woops I forgot the link!
http://stackoverflow.com/questions/2967 ... o-cube-map

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Posted: 2016-02-03T11:16:01-07:00
by Oliv59
Yes, i found it, that's the script i'm trying to run on my server if i can't manage a better way (full php, for example) ;)
Thx !

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Posted: 2016-02-03T13:13:55-07:00
by fmw42

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Posted: 2016-02-03T13:54:47-07:00
by Bonzo
I have a sense of deja vous after reading your last post fmw42. I am sure there was a post about this a year or so ago.

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Posted: 2016-02-03T14:09:34-07:00
by Oliv59
yes, i think so too ;)
And with same question, and same answers ;)

Oh, by the way, it's a sense of "deja vu"

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Posted: 2016-02-03T14:20:09-07:00
by fmw42
If I had more time, I could probably script something. But unfortunately, I am too busy right now. Also some of the scripting is likely to rely upon -fx, which is extremely slow. So for fast processing it would have to be made into a MagickFilter, which I am not well-versed in creating.

By surely there is software out there that will do it for you. Panotools is like free and should have that ability. Seems like one of the links I sent above was for panotools.

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Posted: 2016-02-03T14:49:31-07:00
by snibgo
Given the maths from the links Fred gives, the forward and reverse transformations could easily be coded as a process module (MagickFilter). Fx would be horribly slow for megapixel-sized images. Perhaps they could be written with "-function ArcTan" etc creating a displacement map.

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Posted: 2016-02-03T15:27:37-07:00
by Bonzo
I did see a post about using Hugin; but it looks like the code needs to be run on a server and I do not know how easy that would be to install.

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Posted: 2016-02-03T16:02:41-07:00
by fmw42
Hugin has client software that runs on your own computer. So that should be one option. But I believe Hugin costs $. Panotools, I think is free.

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Posted: 2016-02-11T12:14:01-07:00
by Oliv59
Hello here,

Just wanted to thank you for your help. I finally made it using the python script, than i run through a PHP command.
Works fine for me, although it's a little bit long, but no big deal, it makes the job, that's enough for me ...

So thank you very much !

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Posted: 2016-02-11T13:17:19-07:00
by Bonzo
I would have had a go at doing it in php but like you I had no idea how to convert the python code to php.

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Posted: 2016-02-11T13:38:31-07:00
by Oliv59
same here.
I'll try on a day or another to convert the python script to php, but ... not today ;)