6 images (cube map) into equirectangular?

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?".
stuka
Posts: 5
Joined: 2015-08-31T12:46:36-07:00
Authentication code: 1151

6 images (cube map) into equirectangular?

Post by stuka »

I need to convert 6 images (up, down, left, right, front, back) into 1 equirectangular image.

Such as these:
Image
into something similar to this:
Image

There are probably some image editors which can do this. Thing is, I have a video, so need to batch convert. Can use the command line tool too, and just put the command in a loop.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: 6 images (cube map) into equirectangular?

Post by snibgo »

That input won't transform to that output. One looks like the sky, the other looks like the Greek island of Santorini.
snibgo's IM pages: im.snibgo.com
stuka
Posts: 5
Joined: 2015-08-31T12:46:36-07:00
Authentication code: 1151

Re: 6 images (cube map) into equirectangular?

Post by stuka »

imagine the first is also Santorini.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: 6 images (cube map) into equirectangular?

Post by Bonzo »

Doing a search it looks like the OP wants to do this: http://paulbourke.net/miscellaneous/sphericalpano/
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: 6 images (cube map) into equirectangular?

Post by snibgo »

I can hardly see the small input, but the horizontal part doesn't look like four rectilinear images. It looks like a cylindrical projection. If the OP provided corresponding inputs and outputs, we could see.
snibgo's IM pages: im.snibgo.com
stuka
Posts: 5
Joined: 2015-08-31T12:46:36-07:00
Authentication code: 1151

Re: 6 images (cube map) into equirectangular?

Post by stuka »

Bonzo's page has some example images. So does this page http://stackoverflow.com/questions/2967 ... o-cube-map
snibgo, I'm sorry I don't have better corresponding inputs and outputs. I'd make some, but I don't know how to convert between the two that's why I'm posting here.

Cubemap and equirectangular are projection/mapping types you can learn about on wikipedia.
https://en.wikipedia.org/wiki/Cube_mapping
https://en.wikipedia.org/wiki/Equirecta ... projection
If explanation of equirectangular is confusing from the above link, maybe this explanation will help: it's unwrapping an image from a sphere (sphere map?) to a 2x1 rectangle.

I hope it's clear now.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: 6 images (cube map) into equirectangular?

Post by fmw42 »

IM does not have projection mapping built in. I have some very slow scripts that do some. See fisheye2pano and fisheye2rect and defisheye and pano2rect at the link below. I have not done any cube mapping.
stuka
Posts: 5
Joined: 2015-08-31T12:46:36-07:00
Authentication code: 1151

Re: 6 images (cube map) into equirectangular?

Post by stuka »

Yeah, you have some nice scripts there but none could be used in some way to turn 6 cubemap images into equirectangular sadly.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: 6 images (cube map) into equirectangular?

Post by snibgo »

I can learn about many things on Wikipedia. But I don't know which apply to your situation.

The Wiki page on cube mapping show the horizontal stripe as four rectilinear images, like ordinary photographs, where straight lines in real life remain straight in the image. But the single input you have provided so far doesn't look like that.

If all your images require the same transformation, a displacement map could be built and applied to each (perhaps with supersampling). It wouldn't matter if building the map with "-fx" was slow, because it would only be done once.

You say you have a video to convert. Please provide some sample frames.
snibgo's IM pages: im.snibgo.com
jules43
Posts: 11
Joined: 2015-09-01T06:14:31-07:00
Authentication code: 1151

Re: 6 images (cube map) into equirectangular?

Post by jules43 »

It's possible Pano2VR will do what you want.

http://ggnome.com/pano2vr
stuka
Posts: 5
Joined: 2015-08-31T12:46:36-07:00
Authentication code: 1151

Re: 6 images (cube map) into equirectangular?

Post by stuka »

snibgo wrote:You say you have a video to convert. Please provide some sample frames.
Actually I have a 3d program where I make 3d animations, "video" was probably the wrong term to use, it's a 3d animation right now, not yet rendered to a 2d video.

But I really don't understand why you still want a sample. I've given you already. You don't need mine specifically.
Here's more: http://paulbourke.net//geometry/transfo ... l#cube2cyl
Plau
Posts: 1
Joined: 2017-02-20T04:31:32-07:00
Authentication code: 1151

Re: 6 images (cube map) into equirectangular?

Post by Plau »

Hi,

Thanks for posting this. I am having a very hard time to find out how to create an equirectangular image from 6 images.

I've tried Pano2VR, PTGui, and many more but it seems impossible to stitch these images.

My images don't have EXIF data as they have been designed in the computer. They are computer generated basically.

Does anybody have any idea of how to stitch these images?


Thanks!
jumpjack
Posts: 69
Joined: 2010-12-10T05:29:16-07:00
Authentication code: 8675308

Re: 6 images (cube map) into equirectangular?

Post by jumpjack »

I have a similar, but "reverse" need: I'd like to get multiple images from a spherical image. Each of the multiple images should show what I'd see looking toward a specific direction in the sphere. But I don't know which projections are involved, any help?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: 6 images (cube map) into equirectangular?

Post by fmw42 »

I have just created 2 new scripts to do both these directions, cube2sphericalpano and sphericalpano2cube. Note that they will be slow due to the use of -fx to do the transformation. See my link below for the scripts.
jumpjack
Posts: 69
Joined: 2010-12-10T05:29:16-07:00
Authentication code: 8675308

Re: 6 images (cube map) into equirectangular?

Post by jumpjack »

This looks interesting, but the script sphericalpano2cube can only "look" left, front, right, back, over, under; I'd need to be able to specify how many degrees to look "left" or "right" (not just 90° or 270°).
The final objective is to constantly look (virtually) at the same object while moving parallel to it.
I'll try to explain better: I make a 360° video while moving ahead and the object is on my right; on each frame, the object will appear in a different positions: intially at 20°, then 40°, then 60°.... up to 160°. If I can extract a view with each of these headings from each frame of the video, I'll be able to create a new video which looks like I was moving around the object.
Post Reply