What is hugin's best fit?

193 views
Skip to first unread message

icysubdweller

unread,
Feb 16, 2010, 2:35:57 AM2/16/10
to hugin and other free panoramic software
I've seen hugin report "good fit" and "bad fit" after optimization.
Is there anything better? Does it ever say, "Excellent fit"?

I bought myself a pano head for Christmas, and today I had a chance to
play with it and try to calibrate it. I shot a sequence of 2-row x 4-
pic panos of the side of my house, moving the camera out the upper
rail 3mm at a time. I'm allowing plenty of overlap between shots,
easily upwards of 30% of image width/height on all seams. I saw the
errors reported by hugin start out large, get smaller and smaller,
then start getting big again as I slid the camera out the rail.

So then I shot another sequence of panos around the setting with the
smallest error, this time moving the camera 1mm per sequence. The
best result I got was Mean error = 3.3 and max error = 17.1. There
were still some visible problem spots in the image, but I figured,
"Eh, automatic CP generation, I could do better by hand."

To verify, I brought my setup inside and shot an indoor pano using the
best settings I had discovered outdoors. The initial results were
very good, on par with what I got outside: mean error = 2.8 and max
error = 13.8 using automatic CP generation. But still some visible
problems.

So now I've spent the last 3 hours tweaking the control points. The
image dislocations seem to move around, but not predictably, and are
never completely gone. Qualitatively, 4 hours of work playing with
positions of CPs, making a few tentative forays into optimizing lens
params, etc., hasn't changed the result at all. If I go hunt around
the image and count the problems, the number and size of the
dislocations are always approximately the same, no matter what I do.

Does anyone have any suggestions where to go with this? What kind of
error levels are needed to produce a "perfect" result (which I define
as not being able to spot any stitching errors in the final pano)? Is
this a calibration issue of the pano head? Play in the tripod/head/
pano head setup... would it cause this? If my error rates seem low
enough, what could be other causes of my issues? Complex lens
distortions not modeled/correctable by hugin? Or does it just take
more practice than this, and this is all easily explained by user
inexperience (in which case, what are the beginner problems I'm likely
overlooking)?

Also, along a different line: I'm shooting with an Olympus E-620 and
a Zuiko ED 12-60mm lens at 12mm, which is 24mm in 35mm-equivalent
terms (2x crop factor). It's a medium-wide lens, and image elements
in the corners of the image can be rather rotated from one image to
the next. Often I find the largest errors reported for CPs are in the
corners of the images. Autopano-sift-c tends to always find CPs
towards the center of the images; usually it's my hand-placed CPs that
are out in the corners, and which report large errors. I often can't
"fine-tune" the points because the fine-tuner often moves one of the
two points somewhere else in the image where it finds a better match.
Yet the points are visually dead-on when I place them, on well-defined
image features. ??? Does that give anyone a clue what I might be
experiencing?

Thanks for any ideas...

John McAllister

unread,
Feb 16, 2010, 4:39:16 AM2/16/10
to hugi...@googlegroups.com
The mean and maximum errors you report are huge.
They should, ideally, be less than one.
You can find rogue points by looking at the CP lists associated with the image pairs.
These lists can be sorted by clicking the distance header.
Try removing those that exceed a distance greater than one and then reoptimise.
 
Try setting up parallax correction manually using near and far objects, use the viewfinder first then try a few test shot pairs.
In this instance I would rcommend that you start out producing a single row pano.
You certainly don't need 30% overlap, 10%, or even less, should be fine.
If you have a lot of overlap, Autopano will naturally create most points nearer to the image centre; and you simply waste image data and memory.
 
Create all of your CPs by hand, concentrate your points near to the edges and corners (centre of the overlap region), twelve should be sufficient, then optimise everything.
 
See how you get on, good luck.
 
John McAllister

Gerry Patterson

unread,
Feb 16, 2010, 9:31:14 AM2/16/10
to hugi...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group.
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugi...@googlegroups.com
To unsubscribe from this group, send email to hugin-ptx+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx

Hello,

I am not certain that recommending such a small overlap is a good idea.  This may be ok for cp generation, but the rest of the work flow would be hindered by it.

One reason for more overlap is to allow enblend more room to create larger seams for lower frequency data.  Another reason for more overlap is to give the photometric optimizer for datapoints to compute the response curves from.

Best regards,

Gerry

icysubdweller

unread,
Feb 16, 2010, 12:44:12 PM2/16/10
to hugin and other free panoramic software
Thanks for the info. It leads me to some other questions:

1) Placing manual CPs: I've heard people say "Put the CPs at about the
same distance" but I'm not sure what that means... I think it could
mean a) if you have stuff in the foreground / midground / background
of an image pair, then all the CPs should be (pick one...) midground.
Or it could mean b) don't put any *single* CP on a point that is
defined by things at 2 different distances from the camera, such as
where a telephone pole at the street crosses the gutter on a house 50
feet back from the street.

2) I've also heard people say, "Pick well-spaced CPs that span the
entire overlap of the image pair." This seems counter to the idea
that in a side-by-side image pair with foreground / midground /
background features, all the CPs should be in the midground... but
seems to be inline with what John's recommending. So does distance
from the camera matter?

3) John, you suggest putting the CPs "in edges and corners near center
of overlap region", which in my mind suggests a single 'line' of
points with half the overlap on one side and half the overlap on the
other. I've seen other people recommend a constellation more like 2
lines... one more-or-less following each edge of the overlap. How
would the SW treat these 2 cases differently? Is there a benefit one
way or the other?

Thanks again, this info was very useful.

Rodney

John McAllister

unread,
Feb 16, 2010, 5:47:41 PM2/16/10
to hugi...@googlegroups.com
If you sort out parallax, just roughly, then where in the picture you put your points, near or far, isn't too important; choose far.
When choosing CP sites, just place your points practically nearest to the sides and corners of both images.
I was wrong to suggest using the centre of the overlap area.
Spread them into the area of overlap, as if they have violent charge.
Think of the lever.
So to bed.

Steeve

unread,
Feb 17, 2010, 4:51:19 PM2/17/10
to hugin and other free panoramic software
Some notes from my experience.

I got a Panoraus last year and was very disappointed with the initial
results. I don't have the numbers for the CP errors to hand by they
were quite high. After I while I realised the problem was that I had
attached the Panoraus to my normal camera tripod's head. This had a
lot of slack when the camera was tilted up/down. With luck I found I
could unscrew the tripod's head and attach the Panoraus directly to
the base of tripod. This was much better and I now normally find the
worst-case cp error is <2.

It sounds to me that you are making the calibration process too hard.
My calibration technique was to use two nails, one near the lense
(30cm) the other further away (2m). I them moved the camera back on
the Panoraus slide, and rotated the camera to see the two nails move
relative to each other. Then moved the camera back and repeat. I just
visually assessed the movement on the cameras view-finder. Repeating
these steps until the movement was minimised.

My other comment is that with my lense the FOV number from the EXIF
data is too high (96degree) when I allow Hugin to optimise this it is
normally reduced to 94degrees.. This significantly reduces the average
CP error.

Maybe these comments will help you.

Regards
Stephen

John McAllister

unread,
Feb 17, 2010, 5:30:48 PM2/17/10
to hugi...@googlegroups.com
Good comment,
 
I think the point to emphasise is that parallax correction can be fairly approximate, and still provide good results.
Parallax accomodation is only critical when producing images of near fields, such as interiors at high resolution, and with longer focal lengths.
Still, do everything you can to eliminate Px, and create lens profiles for your chosen focal lengths.
 
I agree that, in most cases, a simple hands-on approach to parallax correction, will work well.
 
An example might inform: I determined a parallax correction for my 10mm and EOS camera of 100mm, by trial and error.
I've gained very good results, I built my lens profile around this correction (eliminate parallax before creating a lens profile).
 
I learnt subsequently, that I was about 7mm out, but couldn't detect any image problems.
Hugin handled it all.
 
Take lots of pictures.
Improve by increments.
Every defect is a gem.
 
John

icysubdweller

unread,
Feb 17, 2010, 10:48:34 PM2/17/10
to hugin and other free panoramic software
Thanks both for your ideas. What does a lens profile include? How do
you know when a lens profile is 'right'? I saw someone recently
observe that allowing hugin to optimize lens parameters results in
parameters that seem to vary widely from run to run of the optimizer,
even though the changes in mean error or visual appearance of the
result barely changes at all. This follows my experience too. Are
these the values that get saved in a lens profile?

I did try doing the "2 nails" kind of experiment a couple different
times, using floor lamps, sighting across a tree branch back to the
siding on my house, etc. Which sort of got me "in the ballpark." E.g.
I could tell 25 mm was wrong and 85 was closer. But when it got down
to "Is it 83, 84, 85, or 86mm?", I could never see any difference.
And I was still getting lots of errors in my stitched images.

Yesterday I tried John's suggestion of placing all CPs maunally. I
took 4 images in a single row, using the best settings for my pano
head that I'd found otherwise. I put 8-10 CPs between each image
pair. Fine tuned everything, stitched, and got a mean error of 2.3,
max of 13.0. [Compared to a mean of 2.8 for auto-gen'd CPs on a 2-row
pano.] Better, but still not below 1.0.

I looked up my lens on dpreview. It is known to have "bubble
distortion" and some image shift at 12mm... how much of an issue is
that likely to be? Is hugin as reliable at handling those distortions
as it is at barrel or pincushion distortion? Should I *always* be
optimizing lens parameters? Do I need more than 8-10 CPs per image
pair to reliably perform lens param optimization?

Thanks again,
Rodney

John McAllister

unread,
Feb 18, 2010, 2:27:53 PM2/18/10
to hugi...@googlegroups.com
A lens profile should be created in fairly well controlled circumstances, don't worry too much for now.
85mm is within the ballpark for a lens of your type, there is plenty of margin for error if you are working outside.
Note that optimisation preceeds stitching, and can be repeated after cleaning up the CPs.
Remember my suggestion to cull rogue points under the CP tab, add some new ones if they are getting thin.
This process might provide some insight into why you are getting poor optimisation; see where they are falling within the image overlap.
Don't worry about so-called bubble distortion; it is essentially a generic characteristic of all wide lenses, and Huggy copes.
 
Keep trying... it will all come together.
 
John

icysubdweller

unread,
Feb 21, 2010, 1:10:13 AM2/21/10
to hugin and other free panoramic software
OK, I won't worry too much about the lens profiles for the time being.

What I've discovered with much practice is that, on the Optimizer tab,
if I select "the Custom parameters selected below" and select *all* of
the lens parameters (v, a, b, c, d, e) I am usually seeing pretty big
values for d and e. For example, d = 14.4 and e = 40.5 on the pano
I'm stitching right now. With those (d,e) values in there, all of a
sudden my errors will drop quite low, which is great.

So now my next question... When should I re-optimize alignment?

My process currently looks like this: I set CPs, optimize alignment,
twiddle CPs, optimize alignment, repeat, until errors are nice and
low. Then I move on to the Exposure tab and optimize. Then I move on
to the Stitcher tab... calc FoV, calc Optimal Size. Finally, I look
at the fast preview window. In the preview window, I like to do
things like adjust the rotation of the panorama (Numerical transform),
center, fit, straighten, set the crop borders, whatever it needs to
make it a finalized image.

At that point, if I look back at the Assistant tab, it says that
"Images or CPs have changed, new alignment is needed." But if I go
back to the Optimizer tab and optimize alignment again, I *always* get
worse errors than I did when I finished the alignment stage of the
process. Why is this? Is it actually necessary to re-align at that
point, or is the alignment that was computed prior to rotating/
cropping/etc. still valid?

Thanks for all your help! Things are definitely improving!
Rodney


James Legg

unread,
Feb 21, 2010, 1:43:48 PM2/21/10
to hugi...@googlegroups.com
On Sat, 2010-02-20 at 22:10 -0800, icysubdweller wrote:
> My process currently looks like this: I set CPs, optimize alignment,
> twiddle CPs, optimize alignment, repeat, until errors are nice and
> low. Then I move on to the Exposure tab and optimize. Then I move on
> to the Stitcher tab... calc FoV, calc Optimal Size. Finally, I look
> at the fast preview window. In the preview window, I like to do
> things like adjust the rotation of the panorama (Numerical transform),
> center, fit, straighten, set the crop borders, whatever it needs to
> make it a finalized image.
>
> At that point, if I look back at the Assistant tab, it says that
> "Images or CPs have changed, new alignment is needed." But if I go
> back to the Optimizer tab and optimize alignment again, I *always* get
> worse errors than I did when I finished the alignment stage of the
> process. Why is this?

The control point error is measured in distance in pixels across the
output image, so it is affected when you change the field of view and
canvas size.

> Is it actually necessary to re-align at that
> point, or is the alignment that was computed prior to rotating/
> cropping/etc. still valid?

The previous optimise should still be valid. However, the error value
that matters is the one you get when optimising just before the stitch.

-James

John McAllister

unread,
Feb 21, 2010, 2:08:18 PM2/21/10
to hugi...@googlegroups.com
Rodney,

Dump the Assistant tab.
Just work through from images, control points, exposure, optimise, clean
CPs, re-optimise if necessary, preview (straighten, center, fit), stitch.
Look at your results.

Surprise yourself !

John


icysubdweller

unread,
Feb 21, 2010, 4:05:57 PM2/21/10
to hugin and other free panoramic software
Ah, thanks, this does help me understand what's happening.

If the control point error is measured in pixels across the output
image, and if I always see the error getting bigger, it seems to imply
I'm always doing something at the end of the process that makes the
canvas size bigger.

I suspect that this is caused by the default option in the Assistant
settings that says to downscale the final pano to 70% of the max
width. I'm guessing that when the "Calculate Optimal Size" button in
the Stitcher tab is used, it "undoes" the 70% scaling and returns the
canvas to full size, which would be a significant cause of the errors
rising in the final stitch.

I guess I'll change the Assistant preference to 100%, but also follow
John's advice to ignore the Assistant most of the time. Sometimes the
Auto-CP works, though, so I usually check it first just to see what
happens. :-) But as a result, I have always ended up working on a
scaled-down canvas for my whole CP optimization process, which is not
good.

Thanks for both of your comments,
Rodney

On Feb 21, 10:43 am, James Legg <lankyle...@gmail.com> wrote:
> The control point error is measured in distance in pixels across the
> output image, so it is affected when you change the field of view and
> canvas size.
>

> > Is it actually necessary to re-align at that
> > point, or is the alignment that was computed prior to rotating/
> > cropping/etc. still valid?
>

Reply all
Reply to author
Forward
0 new messages