How to reproject equirectangular image correctly?

461 views
Skip to first unread message

Christopher Bruns

unread,
Jun 13, 2015, 10:39:27 AM6/13/15
to hugi...@googlegroups.com
I want to reproject some aerial equirectangular images taken with a Ricoh Theta camera. I want to rotate the images to a particular orientation, then write the image back out as a new equirectangular image of the same size, but with a different orientation.

Here is what I have tried:
* run Hugin.
* Select "Add images..." and load my (already perfectly stitched) equirectangular image.
* Select "Equirectangular" as the Lens type.
* Select "Fast Preview Panorama".
* Select the "Move/Drag" tab in the panorama viewer window.
* Drag the image around until a) the horizon is perfectly level, and b) my desired reference point is horizontally centered in the image.
* Select the "Stitcher" tab in the stitcher window.
* Select Equirectangular projection
* Select 3584x1792 (the original image size) as the canvas size
* Select "Remapped Images"->"No exposure correction, low dynamic range"
* Click "Stitch"

But the resulting image has a dramatic exposure discontinuity seam, at the location where the original image left/right edges were, i.e. at the seam between the original horizontal +180/-180 degree boundary. What should I try next, to avoid this seam?

Is there another program I should use to perform this sort of reprojection from equirectangular to equirectangular?

dex Otaku

unread,
Jun 14, 2015, 4:29:15 AM6/14/15
to hugi...@googlegroups.com
Hi Christopher,
You might improve this by using the --wrap option of enblend.  Add --wrap to the enblend parameters on the stitch page in the main hugin window.  
See also: panini-renderer; search for 'panini' on sourceforge.  That tool might let you rotate and rerender more easily*.


* can't recall if panini will output equirectangular

dex Otaku

unread,
Jun 14, 2015, 4:41:58 AM6/14/15
to hugi...@googlegroups.com
Note that I'm assuming you're using enblend.  :)

Christopher Bruns

unread,
Jun 14, 2015, 8:56:21 AM6/14/15
to hugi...@googlegroups.com


On Sunday, June 14, 2015 at 4:29:15 AM UTC-4, dex Otaku wrote:
Hi Christopher,
You might improve this by using the --wrap option of enblend.  Add --wrap to the enblend parameters on the stitch page in the main hugin window.  
See also: panini-renderer; search for 'panini' on sourceforge.  That tool might let you rotate and rerender more easily*.


Thank you Dex for the helpful advice. "--wrap" looks like just the sort of thing for this sort of problem, especially since "--wrap=horizontal" is the default and correct parameter to --warp for this situation.

Unfortunately, embarrassingly, it seems I asked the wrong question. I turns out that the "exposure discontinuity" I complained about, is rather a consequence of the fact that the leftmost and rightmost ~40 pixels of my input image are ignored from each edge. On a hunch, I resized my 3584x1792 input image to 2048x1024, ran the same process in hugin, and got a beautiful perfect reprojected image out. Thus I suspect something in the process is silently grumpy about the 3582x1792 image size. I will investigate this some more.

Carlos Eduardo G. Carvalho (Cartola)

unread,
Jun 14, 2015, 5:11:44 PM6/14/15
to hugi...@googlegroups.com
It looks really strange. I usually do that with bigger images with no problem (12000x6000 usually). I also usually don't touch enblend options.

Maybe you can make available for us your PTO hugin file and one original image for testing. (don't attach). The difference from your steps is that I usually don't stitch the remapped images, I go for the default option, which uses enblend. The remapped images only transform originals with nona.

Cheers,

--
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
---
You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hugin-ptx+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hugin-ptx/c4a8cf40-e134-429f-9482-7e27e1a4f6ce%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Christopher Bruns

unread,
Jun 15, 2015, 9:21:59 AM6/15/15
to hugi...@googlegroups.com

A larger image works for me too; I upsampled each image from 3584x1792 to 4096x2048 before processing in Hugin, figuring that power-of-2 dimensions would be the very safest. And the rotated images came out perfect. Thus I was able to complete my workflow and process about 20 images in my current project. So my needs are satisfied, now that I inserted this upsample step in my workflow.

I don't have the PTO file under my fingers at the moment. I will try to upload it later.

Cheers,
Christopher

Jim Watters

unread,
Jun 15, 2015, 9:35:01 AM6/15/15
to hugi...@googlegroups.com
Christopher,

If you have seams where the original image met it might mean you have some
default values for lens distortion and sensor shift. a,b,c,d,e,f,g should all be 0

Jim
--
Jim Watters
http://photocreations.ca

Christopher Bruns

unread,
Jun 16, 2015, 2:17:23 PM6/16/15
to hugi...@googlegroups.com
OK. I figured out the problem by looking at the lens parameters, like Jim Watters suggested.

When I drag an image taken directly from my Ricoh Theta M15 camera, onto Hugin, and select "Equirectangular" projection, the lens horizontal field of view (HFOV) gets automatically set to 369.5 degrees. But the HFOV value should be 360 degrees. So the stitch ends up discarding part of my original image.

On the other hand, when I drag an image that I resized onto Hugin, a dialog pops up ASKING me what the HFOV is, so I type "360" and all works OK. Presumably some metadata has been discarded from my resized image.

Obviously, the workaround is to always manually set the HFOV to 360. The perfect world solution would be for either a) the Ricoh Theta M15 to write metadata that does not confuse Hugin, or b) for Hugin to not be confused by the metadata that the Ricoh Theta M15 writes.

Thanks Cartolo and Jim for your help.


--
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
--- You received this message because you are subscribed to a topic in the Google Groups "hugin and other free panoramic software" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hugin-ptx/Sj5hKEOF8b0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hugin-ptx+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hugin-ptx/557ED42F.5010808%40photocreations.ca.
Reply all
Reply to author
Forward
0 new messages