Hi All While we are on the subject of automating lens calibration, it might be appropriate to think about the shortcomings of the lens model in libpano, which is unchanged since the 1994 version of PanoTools. 1) it offers just two model lens curves, rectilinear and equal-angle spherical; whereas in reality most short focal length lenses, whether 'normal' or 'fisheye', follow some other curve (the existence of the "Thoby Projection" proves this is a practical issue); 2) the 3- coefficient polynomial correction, that we rely on to take care of the differences between the model and actual curves, is ambiguous (many sets of coefficients can match the same lens) and somewhat unstable (small changes in control point set can give big changes in the polynomial); 3) worse, the correction polynomial is specific to the size and orientation of the image array, so that PT calibrations are not portable between cameras, or even between different resolution settings of the same camera, or rotated copies of the same image.
It would not be hard to replace the PT lens model with one that is free of those defects. That would let us have really useful, shareable lens databases, and give us the full benefit of work like Thomas's on automating the identification of lens and camera. It should be noted that information about sensor dimensions and pixel array formats remains just as important, but is no longer factored into the "lens" calibration, so another database of camera characteristics is an essential part of any solution. For Panini-Pro, I developed a portable universal lens model, and supporting lens and camera databases. I've had good experience with it as a way to manually match my various fish-eye lenses and camera formats. The lens model has 4 parameters: focal length (as given by the manufacturer); curve shape, which 'zooms' continuously from rectilinear through stereographic through equal-angle to equal-area; and major and minor correction factors, which adjust a 4 term polynomial, but in a way that does not allow wild deviations from a realistic model. In addition of course the working lens/camera model must know the physical and logical (pixel) dimensions of the camera sensor (to support full camera calibration it also accepts optical axis offsets and tilts). I haven't yet tried optimizing these parameters from control points, but I am confident that would be a stable process, as they simply cannot generate absurd curves. Would anyone like to work with me on putting this model into libpano13 and setting up Hugin to test it? (Or perhaps calibrate-lens would be a more suitable test bed). My Hugin build environment (for Windows) is not up to date and I could use some help updating it. Plus I have little time to program outside my primary commitment to Panini-Pro. Merry Christmas and a Happy New Year, -- Tom On Dec 19, 5:49 am, kfj <[email protected]> wrote: > On 16 Okt., 15:12, "T. Modes" <[email protected]> wrote: > > > Hi all, > > > I added code to display the lens in the GUI. It is using the > > information stored in the EXIF section to identify the lens (via the > > exiv2 lib). With this information it would be possible to > > automatically set the correct projection when adding images to Hugin. > > But to implement this I need more information. > > > I need the lens type/name (as reported by hugin or exiv2) and the > > projection you are using for this lens. > > Thomas, I'm manually patching the name of my Samyang fisheye into the > EXIF data, since it's a manual lens and the body knows nothing of it. > When I do that, I can set the Lens Model by assigning > > -LensModel="Walimex Pro Fisheye 8mm" > > but I cannot find a way of setting the Lens Type. I have the suspicion > that the Lens type is an integral number pertaining only to Canon > Lenses, and whatever string I pass it comes out 0. In exiv2 I get > > IMG_3928.tif Exif.CanonCs.LensType Short 1 (0) > IMG_3928.tif Exif.CanonCs.Lens Short 3 9.0 mm > IMG_3928.tif Exif.Canon.LensModel Ascii 24 Walimex Pro > Fisheye 8mm > > when I do what you propose: > > > The lens name can be read inside Hugin (images tab) or you are using > > exiv2 (run "exiv2 -pt image.jpg | grep Lens" and search for lens name > > in the output, depending on the maker a different tag is shown). > > Which tag does your code look up? > In the hugin images tab, I get Lens (0), as if the code was looking at > the Lens Type tag. > > > PS: If the lens is not recognized by exiv2 (and therefore by hugin), > > this will not work. In this case it needs to be fixed in exiv2 or the > > lens information is not stored inside the EXIF header, e.g. for some > > manual lenses. This can't be fixed by Hugin. > > This is why I patch the lens info with exiftool. I am using this > command: > > exiftool -FNumber=8.0 -ApertureValue=8.0 -FocalLength="9.35 mm" - > LensModel="Walimex Pro Fisheye 8mm" -ShortFocal="9.35 mm" - > LongFocal="9.35 mm" -Lens="9.35 mm" -FocusDistanceLower="0.45 mm" - > FocusDistanceUpper="inf" -FocalLengthIn35mmFormat="14.96 mm" > <myimage.CR2> > > maybe looking at the Lens Type tag is wrong, and the Lens Model tag, > which actually contains a string, so you can search against it in a > database, is better? Or is this only so with Canon bodies? > > And, while I'm at it, I never got an echo on my proposals to autoload > lens.ini files based on the Lens Model EXIF tag. Maybe you didn't look > at my postings concerning the matter, they're in this thread just a > few up from here. > > Kay -- 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/hugin-ptx
