360° Panorama Stitching - Output Consistently Warped/Distorted

148 views
Skip to first unread message

Kyle Johnson

unread,
Dec 19, 2014, 2:07:57 PM12/19/14
to hugi...@googlegroups.com
Hello,

I am attempting to stitch 360° panoramas shot with an 8mm lens on a crop sensor camera in portrait orientation. The images eventually fed to the stitching workflow are four TIFF files, each rotated 90° around the nodal point.

Our old workflow involves the use of PTGui, which produces a perfect result with little configuration. However, I'd like to get this working under command line tools such as cpfind, nona, etc.

The issue is that all images are warped, as though the camera is sitting atop a hill. See the image below for an example of this (viewed using krpano), with a straight red line added for reference. The camera remained perfectly stationary and the nodal point was properly set in this panorama.

The same type of curvature is visible when facing the opposite direction (180° rotated), and 90° left and right is like looking downhill.

The Hugin GUI produces a far more curved result with the default configuration. When stitched using a variety of other tools, the panorama has always come out flawlessly, thus I do not believe it is an issue with our technique or image content.

Here is the basic script we use to build these panoramas.

pto_gen --projection=2 --output=project.pto *.tif
pto_var --set "v=112.5" --output=project.pto project.pto
pto_var --opt "v,d,e,g,t,EeV,Er,Eb,Vb,Vc,Vd,Vx,Vy,Ra,Rb,Rc,Rd,Re,y,p,r,TrX,TrY,TrZ" --output=project.pto project.pto
cpfind -o project.pto project.pto
cpclean -o project.pto project.pto
linefind --output=project.pto project.pto
autooptimiser -a -l -m -s -o project.pto project.pto
pano_modify -s -c -o project.pto project.pto
nona -o working_ project.pto
enblend --output="completed.tif" working_*
convert completed.tif -quality 100 #{name}.jpg
I have tried several variations on cpfind options, such as --fullscale and sieve1/sieve2 settings, as well as changes to optimizer settings, but none significantly impact this curvature issue, and many of those introduce other problems.

In general, what should I do to improve the output? Am I doing something wrong?

If more information is needed, I can provide it.

Thanks.
--Kyle

Kyle Johnson

unread,
Dec 19, 2014, 2:36:15 PM12/19/14
to hugi...@googlegroups.com
Hello,

One other piece of information which may be helpful, which I seem to have omitted:

The Hugin GUI provides a "straighten" function, which is recommended in the FAQ. This does fix the panorama. I assume the autooptimizer tool with -s would do the same thing, and linefind should help as well, but both are already in place.

What I'm looking for is some command or parameter or general suggestion that can achieve the same result. Hugin didn't fork when running the straighten function, so whatever it is doing isn't being called in an external tool, otherwise I would just use that.

Thanks.

Terry Duell

unread,
Dec 19, 2014, 5:10:51 PM12/19/14
to hugi...@googlegroups.com
Hello Kyle,

On Sat, 20 Dec 2014 06:07:57 +1100, Kyle Johnson <ky...@shoppescene.com>
wrote:

[snip]

>
> Here is the basic script we use to build these panoramas.
>
>> pto_gen --projection=2 --output=project.pto *.tif
>> pto_var --set "v=112.5" --output=project.pto project.pto
>> pto_var --opt
>> "v,d,e,g,t,EeV,Er,Eb,Vb,Vc,Vd,Vx,Vy,Ra,Rb,Rc,Rd,Re,y,p,r,TrX,TrY,TrZ"
>> --output=project.pto project.pto
>> cpfind -o project.pto project.pto
>> cpclean -o project.pto project.pto
>> linefind --output=project.pto project.pto
>> autooptimiser -a -l -m -s -o project.pto project.pto
>> pano_modify -s -c -o project.pto project.pto
>> nona -o working_ project.pto
>> enblend --output="completed.tif" working_*
>> convert completed.tif -quality 100 #{name}.jpg
>>
>> I have tried several variations on cpfind options, such as --fullscale
> and sieve1/sieve2 settings, as well as changes to optimizer settings, but
> none significantly impact this curvature issue, and many of those
> introduce other problems.
>
> In general, what should I do to improve the output? Am I doing something
> wrong?
>

I'm guessing (as usual) but I would try adding "--fov=AUTO --projection=2"
to pano_modify and see if that makes any difference...assuming you want
equirectangular projection, or use 1 for cylindrical projection, which may
give less distortion.

Cheers,
--
Regards,
Terry Duell

Kyle Johnson

unread,
Dec 21, 2014, 3:34:55 PM12/21/14
to hugi...@googlegroups.com
Hello,

The issue seems to have been resolved by:
  • adding "b" to the pto_var --opt list
  • adding --canvas=9200x4600 to pano-modify
  • increasing sieve2 and minmatches settings
The main issue, I believe, may actually have been closely related to our lack of correct --canvas setting. At one point it was explicitly set to a different resolution, and at another it was removed entirely.

Anyway, thanks for the suggestions. :-)

On Friday, December 19, 2014 1:07:57 PM UTC-6, Kyle Johnson wrote:
Reply all
Reply to author
Forward
0 new messages