Newbie: Hugin - Fixing horizontal lines and general advice on panoramic stitch

748 views
Skip to first unread message

Stephen Hartley

unread,
Jun 3, 2017, 9:38:47 AM6/3/17
to hugin and other free panoramic software
Total newbie question here, thanks in advance for any tips on how to improve my first hugin stitch.  Taken using a tripod and rotating ball head, with standard rectilinear lens. No effort was made to rotate around the no-parallax point, I don't know how significant this is for my pano?

Source jpegs:



Stitched with Hugin 2016.2.0.be8da0221960 on Mac.  

Spent a day experimenting with hugin, and this is my best result: output using this pto project file.


Could anyone more experienced give me some pointers on how to fix the following:


  1. Horizon line, particularly at the top of the sea - I added a horizontal line but this has caused the whole image to slant towards the left.
  2. Areas of yellow paving have curved edges.  Again, these should be horizontal, I added a horizontal line, but this does not seem to have had the desired effect - the edges should be parallel to the horizontal edges (top and bottom) of the image.
  3. Four noticeable stitching artefacts: two on the grey railings (fence) in front of the black car, one on the bicycle path, immediately to the left of the painting of the bicycle wheel, and again on the sea horizon line, quite a bump about a quarter of the way into the image from the left edge.  I struggled to add more manual control points for the sea joint and wonder if this might be causing the problem, if so, any known workaround?

Thanks in advance for your help and advice,

Steve

Sean Greenslade

unread,
Jun 3, 2017, 6:16:31 PM6/3/17
to 'Stephen Hartley' via hugin and other free panoramic software
Hi, Stephen. I took a crack at your pano, see my comments below:

On Fri, Jun 02, 2017 at 03:00:25PM -0700, 'Stephen Hartley' via hugin and other free panoramic software wrote:
> Total newbie question here, thanks in advance for any tips on how to
> improve my first hugin stitch. Taken using a tripod and rotating ball
> head, with standard rectilinear lens. No effort was made to rotate around
> the no-parallax point, I don't know how significant this is for my pano?

It will matter for the fence, since that gets pretty close to the
camera. In general, the closer something is to the lens, the more
parallax effect you get.

> Source jpegs:
>
> 1 <https://www.dropbox.com/s/1aj7359lu3qnmj1/DSC_8657.jpg?dl=0>
> 2 <https://www.dropbox.com/s/wo367hzqfuzxnem/DSC_8659.jpg?dl=0>
> 3 <https://www.dropbox.com/s/sevisohruvnlh2w/DSC_8662.jpg?dl=0>
> 4 <https://www.dropbox.com/s/r86z7if5dtfw20b/DSC_8668.jpg?dl=0>
> 5 <https://www.dropbox.com/s/12qxrfxxpcrgl46/DSC_8672.jpg?dl=0>

One of the images in the .pto seems to be missing from this list.

> Stitched with Hugin 2016.2.0.be8da0221960 on Mac.
>
> Spent a day experimenting with hugin, and this is my best result: output
> <https://www.dropbox.com/s/uxfehujkyso1pbm/output6.jpg?dl=0> using this pto
> project file. <https://www.dropbox.com/s/cna8l2k429qp0ao/output.pto?dl=0>
>
>
> Could anyone more experienced give me some pointers on how to fix the
> following:
>
> 1. Horizon line, particularly at the top of the sea - I added a
> horizontal line but this has caused the whole image to slant towards the
> left.

I tend to prefer using vertical lines. Take things like lightpoles, and
add a few vertical lines spaced out across the pano. The horizontal line
of the land-water horizon is also useful. I added one horizontal line
and three vertical lines, which worked pretty well.

> 2. Areas of yellow paving have curved edges. Again, these should be
> horizontal, I added a horizontal line, but this does not seem to have had
> the desired effect - the edges should be parallel to the horizontal edges
> (top and bottom) of the image.

That is due to the projection you're using. If preserving straight lines
is important, try a different projection, like Panini.

> 3. Four noticeable stitching artefacts: two on the grey railings (fence)
> in front of the black car, one on the bicycle path, immediately to the left
> of the painting of the bicycle wheel, and again on the sea horizon line,
> quite a bump about a quarter of the way into the image from the left edge.
> I struggled to add more manual control points for the sea joint and wonder
> if this might be causing the problem, if so, any known workaround?

I masked out the fence from the first picture, since it's causing the
most parallax. I also dropped all control points that were in that
region of that photo. Try to favor control points on farther-away
objects when you have parallax issues.

Also make sure to remove control points on clouds / moving objects.

Once all your control points and masks are in order, you can change the
optimizer to calculate view and distortion as well. Under the photos
tab, start stepping down the geometric optimizations dropdown. Do each
in sequence, checking on the pano each time you optimize (make sure
nothing explodes). Stop at "Everything without translation".

I also duplicated the farthest-right image, and masked the sky in one
and the land in the other. Then I added control points only to those
regions. This will allow the blender to find a seam in the pebbles of
the beach, where it's less likely to cause a visible artifact.

I also ran the photometric optimization to correct some of the color
variations in the images. Even with all the settings on manual, the
camera's RAW to JPG conversion introduces some variations in the color
between the images. I noticed this mostly in the blacktop of the road.

Here's what I managed to come up with after playing with this for about
half an hour:

http://seangreenslade.com/tmp/output.jpg

And here's the PTO:

http://seangreenslade.com/tmp/output.pto

Let me know if you have any questions.

--Sean

Stephen Hartley

unread,
Jun 5, 2017, 8:01:33 AM6/5/17
to hugin and other free panoramic software
Thank you so much Sean for taking the time to reply and examine my images.  You have given me a plenty to work on, I shall progress through these and see how I get on, and likely post more questions!

Really helpful, thank you again.

Regards

Steve

panostar

unread,
Jun 5, 2017, 8:27:31 AM6/5/17
to hugin and other free panoramic software
On Saturday, June 3, 2017 at 2:38:47 PM UTC+1, Stephen Hartley wrote:
No effort was made to rotate around the no-parallax point, I don't know how significant this is for my pano?

It's very significant.  Parallax errors are inevitable. You need to  generate control points only on the most distant features, which are very much less affected by parallax issues.  The expected glitches occurring in the nearby features must then be dealt with one way or another - eg. masking and/or editing in a suitable image editor such as Photoshop.

Only in the rectilinear projection are all straight line features preserved.  However, for angles of view greater than 100 - 120 degrees, the edges acquire an unacceptable degree of distortion.  Your panorama has a hfov of 146 degrees, and therefore looks somewhat unnatural:


In cylindrical projection, the only straight line features preserved are verticals and the straight line of the horizon. All other straight line features will become curved to a greater or lesser degree.  No attempt should be made to straighten or level these curved features, as doing so is likely to introduce unwelcome distortions and misalignments elsewhere.  This is how the cylindrical version looks (with glitches edited):


John  

Stephen Hartley

unread,
Jun 5, 2017, 10:03:31 AM6/5/17
to hugin and other free panoramic software
Thanks for your efforts and explanations here John.  I especially like your cylindrical projection, and will attempt to recreate that one myself.

Regards

Steve
Message has been deleted

Abrimaal

unread,
Jun 6, 2017, 4:29:40 PM6/6/17
to hugin and other free panoramic software
I can only add that detection of horizontal lines require some boring work what could be easily done by the program.

Now you have to:
rotate all the images 90 deg (or the final panorama)
detect vertical lines
rotate the images back
change alignment of every line from vertical to horizontal

It could be easily performed by
"Detect horizontal lines"
or
"Detect vertical and horizontal lines"
but... I am not a programmer and I can dream only.

Frederic Da Vitoria

unread,
Jun 6, 2017, 4:35:03 PM6/6/17
to hugin-ptx
2017-06-06 22:29 GMT+02:00 Abrimaal <abri...@wp.pl>:
I can only add that detection of horizontal lines require some boring work what could be easily done by the program.

Now you have to:
rotate all the images 90 deg (or the final panorama)
detect vertical lines
rotate the images back
change alignment of every line from vertical to horizontal

It could be easily performed by
"Detect horizontal lines"
or
"Detect vertical and horizontal lines"
but... I am not a programmer and I can dream only.

Since you have tried: did this improve the end result?

--
Frederic Da Vitoria
(davitof)

Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org

Gnome Nomad

unread,
Jun 6, 2017, 6:56:37 PM6/6/17
to hugin-ptx


On Tue, Jun 6, 2017, 10:35 Frederic Da Vitoria <davi...@gmail.com> wrote:
2017-06-06 22:29 GMT+02:00 Abrimaal <abri...@wp.pl>:
I can only add that detection of horizontal lines require some boring work what could be easily done by the program.

Now you have to:
rotate all the images 90 deg (or the final panorama)
detect vertical lines
rotate the images back
change alignment of every line from vertical to horizontal

It could be easily performed by
"Detect horizontal lines"
or
"Detect vertical and horizontal lines"
but... I am not a programmer and I can dream only.

Since you have tried: did this improve the end result?

Could this "rotate-find verticals-rotate back-change verticals to horizontals" process be done using Hugin's Python scripting interface?

Can images be rotated in Hugin, find vertical lines be run, then images rotated back and vertical lines changed back to horizontal?

Or perhaps add a UI option to "toggle selected lines between vertical and horizontal?

In the panos I do, finding horizontal lines for the horizon (for beach shots) and church pews (for church interiors) would really speed things up.

David
--

David W. Jones
gnome...@gmail.com
authenticity, honesty, community
http://dancingtreefrog.com

Abrimaal

unread,
Jun 7, 2017, 10:40:21 AM6/7/17
to hugin and other free panoramic software
I have not tried with landscapes, but the results with straightening architecture are satisfying.

Frederic Da Vitoria

unread,
Jun 7, 2017, 10:57:11 AM6/7/17
to hugi...@googlegroups.com
2017-06-07 16:40 UTC+02:00, Abrimaal <abri...@wp.pl>:
> I have not tried with landscapes, but the results with straightening
> architecture are satisfying.
>
> On Tuesday, June 6, 2017 at 10:35:03 PM UTC+2, Frederic Da Vitoria wrote:
>>
>> 2017-06-06 22:29 GMT+02:00 Abrimaal <abri...@wp.pl <javascript:>>:
>>
>>> I can only add that detection of horizontal lines require some boring
>>> work what could be easily done by the program.
>>>
>>> Now you have to:
>>> rotate all the images 90 deg (or the final panorama)
>>> detect vertical lines
>>> rotate the images back
>>> change alignment of every line from vertical to horizontal
>>>
>>> It could be easily performed by
>>> "Detect horizontal lines"
>>> or
>>> "Detect vertical and horizontal lines"
>>> but... I am not a programmer and I can dream only.
>>>
>>
>> Since you have tried: did this improve the end result?

"Satisfying": do you mean that without the horizontal lines, they are
less than satisfactory?

What I am wondering is: do the horizontal lines change anything? Or
would the result be just as good without the horizontal lines?

Abrimaal

unread,
Jun 9, 2017, 3:43:59 PM6/9/17
to hugin and other free panoramic software

T. Modes

unread,
Jun 10, 2017, 6:14:29 AM6/10/17
to hugin and other free panoramic software

This is wrong. Only in rectilinear projection horizontal lines are horizontal and parallel. In all other projections there is only one horizontal line - the horizon (and not even this apply to all projections. There are also projections which have a bended horizon). All other horizontal lines in the real world are always bend (in more or less extend).
So horizontal lines help only in rectilinear projection (see also tutorial http://hugin.sourceforge.net/tutorials/perspective/en.shtml ).
This is a very limited range and requires some more knowledge about the image content.
Reply all
Reply to author
Forward
0 new messages