How do I generate a equirectangular with Hugin? I have enough images for a 360 view of my scene. I see the Cubic Projection or equirectangular in the Hugin documentation but I see no mention of it in the software itself. I read a script "DorinDXN" that generates a 6 pics from a pano equirectangular. there is the opposite?
@echo press any key if pano.tif was produced by PTGui
pause
@echo.
@echo -----------------------------------------------------
@echo Generating Face_0 FRONT
@echo p f0 w1500 h1500 v100 >script.txt
@echo m g1 i2 f0 m0>>script.txt
@echo o w6000 h3000 f4 p0 r0 v360 y0 u10 m0 n"pano.tif">>script.txt
@nona_gui -o cube_0.tif script.txt
@echo.
@echo -----------------------------------------------------
@echo Generating Face_1 RIGHT
@echo p f0 w1500 h1500 v100 >script.txt
@echo m g1 i2 f0 m0>>script.txt
@echo o w6000 h3000 f4 p0 r0 v360 y270 u10 m0 n"pano.tif">>script.txt
@nona_gui -o cube_1.tif script.txt
@echo.
@echo -----------------------------------------------------
@echo Generating Face_2 BACK
@echo p f0 w1500 h1500 v100 >script.txt
@echo m g1 i2 f0 m0>>script.txt
@echo o w6000 h3000 f4 p0 r0 v360 y180 u10 m0 n"pano.tif">>script.txt
@nona_gui -o cube_2.tif script.txt
@echo.
@echo -----------------------------------------------------
@echo Generating Face_3 LEFT
@echo p f0 w1500 h1500 v100 >script.txt
@echo m g1 i2 f0 m0>>script.txt
@echo o w6000 h3000 f4 p0 r0 v360 y90 u10 m0 n"pano.tif">>script.txt
@nona_gui -o cube_3.tif script.txt
@echo.
@echo -----------------------------------------------------
@echo Generating Face_4 UP
@echo p f0 w1500 h1500 v100 >script.txt
@echo m g1 i2 f0 m0>>script.txt
@echo o w6000 h3000 f4 p270 r0 v360 y0 u10 m0 n"pano.tif">>script.txt
@nona_gui -o cube_4.tif script.txt
@echo.
@echo -----------------------------------------------------
@echo Generating Face_5 DOWN
@echo p f0 w1500 h1500 v100 >script.txt
@echo m g1 i2 f0 m0>>script.txt
@echo o w6000 h3000 f4 p90 r0 v360 y0 u10 m0 n"pano.tif">>script.txt
@nona_gui -o cube_5.tif script.txt
@echo.
@del script.txt
PS: nona_gui same nona.exe
Answer
If you're trying to remap six cube faces back to an equirectangular, the easiest way to do it is with the commercial software package, Pano2VR. Pano2VR lets you feed it six cube face images individually, or in a t-cross format, and will transform it into an equirectangular and vice versa.
If you're looking for an open source command-line way to do this, apparently some Blender users needed to do this same task, and one of them wrote a Python utility called cube2sphere that also takes six cube faces images as input and outputs an equirectangular. You will need to install Blender.
Via the Hugin GUI, the basic logic is that you load up the six cube faces as input, and then specify the HFOV as 90º, and manually position the faces with the following yaw,pitch settings (roll = 0):
- back = 0,0
- left = 90,0
- front = 180,0
- right = -90,0
- top = 0,90
- bottom = 0,-90
And set all the lens correction parameters to 0. You will need to be in the Panorama editor window (Interface → Advanced or Expert shows it more readily than being it the Simple Interface Hugin defaults to), and you probably need to change the display to Positions and Lens parameters to make these changes, although the Layout tab and Move/Drag tab can also be used for positioning.
But when I attempted to recreate the equirectangular from the cube faces in this way, nona kept throwing black patches in when it blended the images into a single equirectangular.
However, outputting the cube faces as remapped images with no exposure correction should give you images you can combine with masks/layers in something like Photoshop or Gimp into an equirectangular.
No comments:
Post a Comment