5

I want to unwarp a 2D fisheye image to a 3d cube.So I thought it is necessary to unwarp the fisheye image to 6 cubic image and remap 6 cubic image to the 3d cube.And Now I am confused about the first step and can't find some specific paper and code implemented about that in internet ,and hope somebody can give me some idea. The result I can get is here:

cubic image cubic image

fisheye image enter image description here

Community
  • 1
  • 1
user2968731
  • 117
  • 1
  • 9
  • You can't get the whole cube from one image. Take a look of the part of the cubemap on the left. Do you see that 90 degree turn of the staircase in the fisheye image? – Colonel Thirty Two Oct 27 '14 at 14:08
  • buics are generally extracted from photographing a mirrored sphere from several angles – ratchet freak Oct 27 '14 at 14:34
  • Thanks.But I use these two pic only for showing an example.[link]http://neuron.tuke.sk/pluchta/Pocitacove%20Videnie/Prednasky/HTML/Offaxis%20fisheye%20projection.htm this link show the basic theory but I don't figure out that how to implement it. – user2968731 Oct 27 '14 at 15:16

1 Answers1

0

It is not possible to unwrap an arbitrary fisheye image to the cubemap. However, if you were talking about the spherical environment map (SEM), but not fisheye image, then it can be done with some limitations.

Some time ago, I've managed to write a software that could convert a SEM map to cubemap and vice versa. So I can prove that it is possible. You should be aware, that you would get large distortions in the region close to the edge of the SEM, that is mapped to the center of back face of cubemap. Read this article, you will find there all needed information to implement what you want.

There is a function that maps the direction vector to uv coordinates of the SEM on page #9. On page #21 you will find similar function, but for the cubemap. So, your strategy would be to find for every texel of cubemap a direction vector, then for this direction vector calculate SEM coordinates and sample a texel from the SEM map.

P.S. From the link, that you've added in your comments, I've notice that you were talking about a half sphere environment maps. All the logic would be the same, except the mapping from 3d direction vector to SEM coordinates. It's not hard to change the equation from the page #9 in order to work with half sphere. You should be aware, that for a half-sphere SEM you will get a half cubemap. I mean, without the back face and with cropped side faces.

Pidhorskyi
  • 1,562
  • 12
  • 19
  • Thanks,bro.In fact,I want to create a hemicube frome a 2d fisheye image,And [link]http://www.realitypixels.com/turk/quicktimevr/defish/defish.html in this link,it implemented it in hemicube mode – user2968731 Oct 29 '14 at 06:58