[snip]
Terry Duell has written a tutorial describing a very simple
technique for calibrating lens distortion parameters with hugin:
http://hugin.sourceforge.net/tutorials/calibration/
The advantage of this technique is that it doesn't rely on perfectly
rectangular buildings or involve multiple overlapping photos taken
with a panoramic head - Just a simple scene that anyone can
construct.
The other advantage is that it has real potential for automatic
processing.
--
Bruno
They are there, but you need to know where to look ;-)
http://wiki.panotools.org/Hugin_Control_Points_tab#Straight_line_control_points
--
Bruno
Hi
Just a few comments on the tutorial...
I really like the simplicity of it and it taught me something new about
hugin (the straight line CPs, which I've always found missing ;-) )
The sample image (230.jpg) is a bit of a tricky one, because the one
linked on the site is a bit too small to get accurate marks for the
lines, the contrast is simply too low and the resolution too coarse. I
did my ultimate best (may not be much ;-) and I got:
a:0.18826
b:-0.60268
c:0.60079
which is quite a lot and not the same as the tutorial values a=0.00104,
b=-0.00169 and c=0.00509
(I can't help thinking the tutorial might have been written with the
full image resolution and not the file linked in the tutorial, a lower
resolution with the original exif might give confusing lens parameters?)
So if this is the problem, I'd suggest replacing the image with the
original or updating the tutorial with the right values for the sample
image. Better still would be using a different picture with more easily
visible lines...
The .pto file is attached...
Cheers
Simon
Hi Terry
that's what I did (though I'm not sure I was precise enough) and this is
what I got for my 50mm lens on my sony a100:
a: 0.03355
b:-0.13657
c: 0.16691
Still quite large values, aren't they? However the resulting image (in
preview) doesn't look strangely distorted, so they can't be that far off
I think...
For the tutorial a quick note that the sample image is scaled and thus
will result in different values might be good....
Cheers
Simon
> I am puzzled about one point in the tutorial. You say the pano
> projection has to be set to rectilinear, even when calibrating a
> fisheye image. I don't understand why the output projection should
> have any effect on the optimization. Can you explain?
Panotools treats line control points in output space. This is: If you
have straight line control points the line will only be straight in
rectilinear projection, which is the only one to keep straight lines
in reality straight in the image. Read
http://wiki.panotools.org/Lens_correction_model and particularily
http://wiki.panotools.org/Panotools_internals#Line_control_points for
details.
The idea of using string lines is clever, but one must keep in mind
that a string line is never exactly straight. It's own weight always
bends it down more or less. The string tension must be very high in
order to be almost straight...
best regards
Erik Krause
http://www.erik-krause.de
Take several pictures, rotating the camera so that the line appears in a
numerous places within the frames, different distances from the center.
It is not necessary to rotate around the NPP.
Then optimize a single set of lens parameters across all frames to make
all the lines straight, leaving pitch/roll/yaw locked at zero for all
frames.
This method tested OK for me a couple of years ago, but I have not used
it a lot so I don't know what all can go wrong with it.
--Rik
> the purpose with the calibration foul be to be able to correct
> individual images using Fulla (and maybe directly in Lightroom
> eventually) but also to have a starting value when stitching linear
> panoramas of wreck sites.
Why does it need to be underwater to calibrate ?
regards
mick
Fix a laser pointer so it aims from a higher point on one side of the
glass to the table surface on the other side of the glass. Eventually
mark the spot where the laser pointer hits the table.
Fill your glass with tap water and watch the beam being refracted (I
hope that's the right term) in a different angle when travelling from
glass through water instead glass/air.
The same water resistant lens has different values when used in standard
or underwater conditions.
Carl
I tried the several-lines method for calibrating my lens, and it indeed worked
quite nicely.
Oskar Sander wrote:
>
> sorry for waking up an old thread.
>
> I'd like to use this method to calibrate a UW camera set-up. That is,
> a camera in a housing with a wide angle lens attached on the housing.
> Obviously this set-up is very much different from the camera on land
> so I need to do it in the pool, so I need to plan the exercise in
> beforehand.
>
>
> The pool have a lot of natural lines to use in the tiles of the pool,
> the question is if these would be good enough, or if I must make my
> own lines using a little buoy with a weight and orange string to get
> enough accuracy?
My experience was that the lines from the spacings between tiles look nice
until you start and use them for setting the control points. The exct
placement gets a bit uncertain and thus you get a higher noise which falls
back on the derived parameters unless you have many points.
I.e., if you use them I'd make sure to take a lot of images with lines going
through the FOV at different positions and in different angles. If I remember
correct I was using something like 10 images, defining some 30 lines in
there...
Pit
--
Dr. Peter "Pit" Suetterlin http://www.astro.su.se/~pit
Institute for Solar Physics
Tel.: +34 922 405 590 (Spain) P.Suet...@royac.iac.es
+46 8 5537 8534 (Sweden) Peter.Su...@astro.su.se
Oh you mean the lens is inside a box ?
I thought that the lens would be in the water.
regards
mick
Tom Sharpless wrote:
> Did your calibration image set cover 360 degrees?
No, this was a a-b-c calibration only. I left the FOV fixed
> It seems to me that if you use multiple images for calibration, then
> the correct focal length or fov becomes a critical parameter (which is
> not the case for single-image straight line calibration). And it is
> known that the PT optimizer will almost always choose a wrong value
> for that unless you force it to be right by insisting on closure of a
> full circular image set.
Hmm, good point. I didn't check if a (small) change in the FOV results in
different a-b-c, but it seems somewhat reasonable.
> But the straight line control point optimization (as currently
> implemented) requires that the output projection be rectilinear. So
> naively I would suppose that only a part of your straight line data
> would be usable, unless the rectilinear error is computed separately
> for each image, ignoring the rotation that aligns it on the
> panosphere?
Yes. I kept all images at yaw/pitch/roll=0 and thus had a maze of lines
within the FOV and requested each of the lines to be straight in the output...
> Some time ago I looked into the possibility of making libpano optimize
> straight lines on the panosphere (where they become great circles)
> instead of in a rectilinear projection.
Yes, I remember.
> My hope was to better support calibration of fish eye lenses, which is a
> continuing problem. My code gave worse results than the existing method, so
> I gave it up.
I guess the reason is that in your method it strongly depends on the correct
location of the image (y,p,r), isn't it? So it would be a good thing for
panoramas in general, but meybe less for calibration only?
> However I still think Hugin needs an easy and reliable way to do
> straight line lens calibration. I believe that after many years of
> using various calibration systems, photogrammetrists finally decided
> the straight line method was best. And they often use naturally
> occurring straight lines rather than special calibration rigs. The
> key is software that can follow lines and estimate their positions to
> subpixel accuracy. The raw image of a calibration line will in
> general be curved, so a human has to designate which lines are
> straight in reality -- but not set dozens of control points on them.
Hmm, indeed. an automatic line finding algorithm might be a handy thing.
Sounds like calling for Hough transforms or alike. But for fisheye images
that really must be an awkward job...
Cheers,