Using IM to translate Equirectangular panorama to Cubemap ?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Oliv59
Posts: 6
Joined: 2016-02-03T03:45:00-07:00
Authentication code: 1151

Using IM to translate Equirectangular panorama to Cubemap ?

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Post 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.
Oliv59
Posts: 6
Joined: 2016-02-03T03:45:00-07:00
Authentication code: 1151

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Post by Oliv59 »

Thanks fmw42, but that's the point, i don't know how to convert ;)

Anyway, thnaks for your asnwer ...
Oliv.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Post 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
Oliv59
Posts: 6
Joined: 2016-02-03T03:45:00-07:00
Authentication code: 1151

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Post 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 !
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Post 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.
Oliv59
Posts: 6
Joined: 2016-02-03T03:45:00-07:00
Authentication code: 1151

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Post 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"
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Post 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.
snibgo's IM pages: im.snibgo.com
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Post 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.
Oliv59
Posts: 6
Joined: 2016-02-03T03:45:00-07:00
Authentication code: 1151

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Post 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 !
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Post 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.
Oliv59
Posts: 6
Joined: 2016-02-03T03:45:00-07:00
Authentication code: 1151

Re: Using IM to translate Equirectangular panorama to Cubemap ?

Post by Oliv59 »

same here.
I'll try on a day or another to convert the python script to php, but ... not today ;)
Post Reply