Open fangchuan opened 2 weeks ago
@fangchuan I can definitely see some issues when doing cubemap -> equirectangular -> perspective view when dealing with low resolution cubemaps; loss of data being one. And your idea of doing cubemap -> perspective view mapping seems to be a great way of mitigating the problem. I would like to help, but unfortunately, I don't have too much free time to implement this.
On the top of my head, one way could be to create a mapping of pixels for grid sampling by combining cube2equi and equi2pers in this library and create cube2pers function. I think projecting the cubemap to a high resolution equirectangular grid and sampling the pixels for perspective view might be good enough, but we would have to try it out to see.
@fangchuan I can definitely see some issues when doing cubemap -> equirectangular -> perspective view when dealing with low resolution cubemaps; loss of data being one. And your idea of doing cubemap -> perspective view mapping seems to be a great way of mitigating the problem. I would like to help, but unfortunately, I don't have too much free time to implement this.
On the top of my head, one way could be to create a mapping of pixels for grid sampling by combining cube2equi and equi2pers in this library and create cube2pers function. I think projecting the cubemap to a high resolution equirectangular grid and sampling the pixels for perspective view might be good enough, but we would have to try it out to see.
Hi, thanks for your advice. I fail to generate perspective images by wrapping cubemaps, below are an example of my failure cases:
I try to warp the surrounding cubemaps to my expected subview: yaw=0.0, pitch=-26.43 degree. The front and down view work reasonably, but when I apply homograph to the left and right view, it results in a messy overlayed on the perspective image. I guess these incorrect warpped region is reasoned by the scale ambiguity in homograph transforms, since it works in the image plane where z=1.0, it may incorrectly make some pixels visible, which should be back of the image plane.
Additionally, I finally make it through cube2equi following equi2pers pipeline,
However, this pipeline is a bit time-consuming, it cost at least 1.25s in my torch dataloader, where I do 32 times cube2equi+equi2pers to get perspective images I want.
Can you preprocess your cubemap offline and convert it to a high-resolution panorama (e.g., 1024x2048) for faster loading into your dataloader? Loading panorama and cropping arbitrary perspective views should be fast enough. This isn’t an elegant solution, but I recall it worked well with a 1024x2048 panorama and cropping a few 256x256 perspective views. Regarding the cube2pers pipeline, I’ll find an efficient approach when I have time!
Can you preprocess your cubemap offline and convert it to a high-resolution panorama (e.g., 1024x2048) for faster loading into your dataloader? Loading panorama and cropping arbitrary perspective views should be fast enough. This isn’t an elegant solution, but I recall it worked well with a 1024x2048 panorama and cropping a few 256x256 perspective views. Regarding the cube2pers pipeline, I’ll find an efficient approach when I have time!
That's be great! Yeah, I am trying to precompute all panorama beforehand. I still not give up how to warp perspectives from cubemaps directly, and if you have have any plan, please let me know if I can help. Thanks a lot!
Hi, really awesome work. I am working on panorama and perspective 3D vision, and recently we are organizing a huge panorama dataset from scratch, we also try to transform panorama to perspective images using these libs. However, since our pano images have relative small resolution 512x1024, so the resulting perspective images are not good enough in terms of resolution. Since the cubemap images resolution is fine (at least 512x512), We found that directly converting cubemaps to perspectives can circumvent the resolution problem, just using Homograph transform between the cubemaps and subview perspectives. Now I can make 8 subview perspectives from the cubemap dices, the 8 subviews distribute evenly across the vertical axis. But I want do more things in this procedure, get more diverse perspectives from the cubemaps, which can rotate among roll and pitch angles, but I fail to get reasonable results when doing homograph warping. Could you help me figure out the bug, or we can push together to this project to enable transform between cubemaps and perspectives. Here is my code snippet:
I am looking forward your reply @haruishi43