fuenwang / Equirec2Perspec

A tool to project equirectangular panorama into perspective images
MIT License
268 stars 55 forks source link

I can't understand the algorithm #2

Open milad-ahmadi opened 4 years ago

milad-ahmadi commented 4 years ago

I do not understand the algorithm used in this implementation. Do you have an article or resource for this implementation to help me? Thanks

fuenwang commented 4 years ago

Hi:

I have written a quick explanation of equirectangular projection or spherical projection in my previous paper. https://arxiv.org/abs/1811.05304 You can see the chapter 3 first. If you have something not understatnding, feel free to ask me :)

ZhouMengjie commented 4 years ago

Hi:

I still feel confused about this algorithm even after reading your paper. Your code seems more complicated than what has been mentioned in your paper. But at least, could you give me a simple explanation about the input parameter RADIUS in function GetPerspective(self, FOV, THETA, PHI, height, width, RADIUS = 50)? Thanks very much!

fuenwang commented 4 years ago

Hi,

FoV is the field of view of perspective image converted from equirectangular image. THETA and PHI are the longitude and latitude. In here you can treat the two parameters as the viewing direction of perspective image. Height and width are the resolution of perspective image. For RADIUS, because the equirectangular image can be seen as a sphere, we can set any positive number as RADIUS.

ZhouMengjie commented 4 years ago

Many thanks for your prompt reply! So the unit of RADIUS is meter or something else?

fuenwang commented 4 years ago

There is no unit for RADIUS because we don't have any depth information to know the scale.

milad-ahmadi commented 4 years ago

Hi:

I have written a quick explanation of equirectangular projection or spherical projection in my previous paper. https://arxiv.org/abs/1811.05304 You can see the chapter 3 first. If you have something not understatnding, feel free to ask me :)

Thanks.

ZhouMengjie commented 4 years ago

There is no unit for RADIUS because we don't have any depth information to know the scale.

Thanks very much!

ZhouMengjie commented 4 years ago

Sorry for the bothering, I still feel confused about the RADIUS. I found even I change it to 35, 50, 128 even 1000. Those images look quite similar. I could tell any difference between them.

fuenwang commented 4 years ago

Yes, it will be the same. Because eventually, I will still normalize the sphere to a unit sphere. So you can actually ignore this parameters. The reason why I add this parameters is that I just want to visualize the unit sphere with RGB color in OpenGL before. If I set RADIUS as one, we cannot see anything because it's too close to the origin.

ZhouMengjie commented 4 years ago

Yes, it will be the same. Because eventually, I will still normalize the sphere to a unit sphere. So you can actually ignore this parameters. The reason why I add this parameters is that I just want to visualize the unit sphere with RGB color in OpenGL before. If I set RADIUS as one, we cannot see anything because it's too close to the origin.

ok, got it. thanks very much for your help and your patience. best wishes.

zk94007 commented 4 years ago

It's working great, but for now, I want to have vice-versa module, like I can get perspective view image from panorama, and I want to get panorama from perspective image, i think current output image is not enough to revert, so we can produce more left-most, right-most image to get panorama again. Is there any algorithm(article) or codes for this module? @fuenwang

fuenwang commented 4 years ago

@topcoder613 I have merge the equirectangular to cubemap and cuebmap to equirectangular utility. Please see this. https://github.com/fuenwang/PanoramaUtility