panomatic and thus cpfind use a RANSAC step for outlier removal. This
used to be based on a homography, which works ok for non-wide angle
images. It breaks for fisheye images, here a large error tolerance must
be choosen, and this results in a rather weak outlier check for wide
angle and fisheye images.
Additionally, the homography is more general than what we expect for
panoramic images (it can also "mirror" images, for example), and this
can result in some false matches slipping through, even when a
relatively strict RANSAC threshold is choosen. Unfortunately, this can
sometimes connect unrelated images together, and cpclean doesn't help as
it won't remove all matches in an image pair.
I have thus implemented a new RANSAC model that can make use of the
restrictions we have in panoramas, and also include prior information
about lens type, HFOV and distortion etc. Basically, it tries to
estimate roll,pitch and yaw for each image pair (using two control
points), and checks if the remaining points are consistent, and repeats
that a few times.
A new --ransacmode parameter can be used to switch between the ransac
modes. By default it uses the homography and switches to the
roll,pitch,yaw model if the HFOV is bigger than 65 degrees, the same
value that is used to decide whether to remap to stereographic or not.
For testing, the HFOV can also be estimated in the RANSAC routine, but
this is quite fragile due to panotools problems with estimating HFOV on
image pairs.
Some examples:
--ransacmode rpy (new)
http://www.flickr.com/photos/vonengel/5378995090/
--ransacmode auto (default mode, uses homography)
http://www.flickr.com/photos/vonengel/5378994908
Unfortunately, in some cases, the HFOV is not know very well (incomplete
EXIF data, bad crop factors entered by the user etc...), so one cannot
unconditionally recommend --ransacmode rpy.
It might be possible to work around that problem, but it will require
some significant work, and I'm not sure if it worth it.
For the user that means:
1. User has a good estimate of the HFOV (EXIF Data or prior
calibrations) -> use cpfind --ransacmode rpy
which makes cpfind virtually bullet proof to really bad mismatches.
2. Bad EXIF Data and user doesn't know about crop factors or the like ->
use cpfind --ransacmode auto (the default) or cpfind --ransacmode
homography, and accept some outliers.
I hesitate to default to --ransacmode rpy, as this will probably lead to
quite some breakage for novice users, who enter bad crop factors.
I find 2. a bit unsatisfying as it means that we will get suboptimal
results for many inexperience users (and many experienced ones too, who
don't know about all the cpfind internals...).
Whats your opinion about that?
- Should we add more default presets to the control point detector
preferences?
- Try to automatically add --ransacmode rpy, if the hugin could
successfully read HFOV from the EXIF data?
- Try to robustly add HFOV to the RANSAC model? Maybe just trying a
range of initial HFOVs would be sufficient... However, I'm not sure if I
can do that with my limited time budget.
Another way to reduce the problem would be to use a camera-crop factor
database, such as the one from Autopano PRO:
http://www.autopano.net/wiki-en/Cameras.txt
ciao
Pablo
It doesn't really work like this. Hugin looks exclusively at the
image dimensions, so both the landscape and portrait shots will have
the same lens number and field of view.
If you have actually rotated the pixels of one photo in an image
editor then Hugin will see two different lens numbers and field of
views, but the field of view will be 'correct' and doesn't need
to be changed to get a good stitch.
--
Bruno
but if the first six are portrait and
the up shot landscape, if it's a manual lens (like my Samyang) I have
to tell hugin every time it's the same, even if the image dimensions
are the same to the other shots. More a nuisance. I have to have two
lens.ini files handy, or go through the dialog every time of 'do I
want to accept the parameters even though the image dimensions are
different'.
> sorry to take this thread off on a tanget, but can i clarify
> bruno's statement?
>
> so your standard 6 shots around and 1 shot up pano (fullframe
> fisheye) where the "up" shot has been rotated to landscape
> orientation by the camera - this should not pose any problems for
> hugin?
No camera I have seen actually rotates the image file saved in the
camera. i.e. they all produce landscape images but add an EXIF tag
indicating the position of the orientation sensor.
So if you feed these photos into Hugin it does the right thing: they
all get the same lens number, but get the initial roll set ∓90°
depending on the EXIF data.
However if you are processing with a RAW converter, it might
silently rotate a photo and save it in portrait format. In this
case Hugin would assign a different lens number.
(personally I think it would suck if I asked a RAW converter to
process a series of photos identically but they ended up with
different pixel dimensions).
> why is it HFOV and not FOV "in the narrow image dimension" ?
> wouldn't this be better?
See all the other recent threads about the panotools lens model.
Yes it isn't ideal.
--
Bruno
Am 24.01.2011 18:12, schrieb kfj:
> J. Martin asks
>
>> so your standard 6 shots around and 1 shot up pano (fullframe fisheye) where
>> the "up" shot has been rotated to landscape orientation by the camera - this
>> should not pose any problems for hugin?
>
> I'd say - not really a problem, but if the first six are portrait and
> the up shot landscape, if it's a manual lens (like my Samyang) I have
> to tell hugin every time it's the same, even if the image dimensions
> are the same to the other shots.More a nuisance. I have to have two
> lens.ini files handy, or go through the dialog every time of 'do I
> want to accept the parameters even though the image dimensions are
> different'.
So all your image are physically in Landscape mode (i.e. width >
height)? Then hugin should ask only once, otherwise its a bug.
Pre-rotating the images outside hugin is not a good idea. Even if hfov
and a/b/c parameters are applicable, what about the shift parameters
d/e? Left or right rotation makes a big difference here, and there is no
reliable way for hugin to figure that out.
ciao
Pablo
On Mon, Jan 24, 2011 at 11:35:46PM +0100, Pablo d'Angelo wrote:
> Pre-rotating the images outside hugin is not a good idea. Even if hfov
> and a/b/c parameters are applicable, what about the shift parameters
> d/e? Left or right rotation makes a big difference here, and there is no
> reliable way for hugin to figure that out.
Why not? When I get back from vacation I usually run a script on my
pictures collection that uses the exif info to rotate all portrait
images. This has the added advantage for the panorama photos that when
I load them into Hugin, and when I want to do manual control points,
they start out right-side-up. So: Why not rotate them?
(The "hfov" parameter becomes a bit ambiguous, I agree. And it becomes
non-obvious that the 90 degree HFOV (landscape) and the 60 degree HFOV
(portrait) shots are from the same lens.... Instead of using hfov, I
think we should move to 35mm-equiv-lens-length or diagonal-fov.)
Roger.
--
** R.E....@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2600998 **
** Delftechpark 26 2628 XH Delft, The Netherlands. KVK: 27239233 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
Q: It doesn't work. A: Look buddy, doesn't work is an ambiguous statement.
Does it sit on the couch all day? Is it unemployed? Please be specific!
Define 'it' and what it isn't doing. --------- Adapted from lxrbot FAQ
> (The "hfov" parameter becomes a bit ambiguous, I agree. And it becomes
> non-obvious that the 90 degree HFOV (landscape) and the 60 degree HFOV
> (portrait) shots are from the same lens.... Instead of using hfov, I
> think we should move to 35mm-equiv-lens-length or diagonal-fov.)
>
> Roger.
A portable lens profile is in the works. Thomas Sharpless has put together a
wiki page that discusses the issues and some possible solutions. We want to
change this but we want to change it right and once.
http://wiki.panotools.org/Lens_Correction_in_PanoTools.
It is currently being discussed on the panotools deve list on soureforge.
https://lists.sourceforge.net/lists/listinfo/panotools-devel
--
Jim Watters
http://photocreations.ca
My idea is to pass a parameter to the CPG that defines magnification
of the images based on their field of view. Why that? I sometimes mix
images taken with different lenses: Fisheye shots for the 360x180 side
of things, and for those parts of the image where it doesn't matter so
much (sky, ocean etc.) - and rectilinear shots, sometimes even zoomed
for super-clear details, where it matters. In my experience, the CPGs
work best when they are presented with images which roughly share the
same amount of pixels per degree of fov. To achieve this with the
current CPGs, which, if at all, only allow scaling by a factor, I have
to blow up some images and shrink some, and then the CPG generation
works best - but it's laborious. If I could tell the CPG to scale all
images to, say, 50 pixels per degree overall, I would achieve
precisely the effect I want by specifying one single parameter. It'd
make things so much easier for mixed-lens takes.
I know that theoretically SURF and SIFT features are (quite) scale-
insenstive, but my experience tells me that this truth only goes so
far. I'm not sure how scale-insenstive the gradient-based detector in
cpfind is. But I feel that implementing my proposition might be easy
and it'd give us the opportunity to see if this might be a cheaply
bought improvement in performance.
Also, it'd instantly put an estimate on the images: if it's 1000
pixels from a consumer point-and-shoot camera, you may want to go
fullscale,
This method seems promising, and it's on my list of scripts to convert
into a plugin for the python plugin interface I've written to whet
everyone's appetite. Until then there's the pure python
implementation, and there is also a perl script by Bruno Postle, which
scales by factors of two:
http://www.google.com/url?sa=D&q=http://panotools.svn.sourceforge.net/viewvc/panotools/trunk/Panotools-Script/bin/ptohalve%3Fview%3Dmarkup%26pathrev%3D1291
The next idea, to look at the overlapping parts once the overlap has
been roughly established, is also promising and heas been previously
exploited, though I'm not entirely sure where the code is. Another
interesting aspect along these lines is to warp the overlapping parts
of two images to a common projection and run the CPGs on those warped
partial images, to later retransform the CPs to original image
coordinates. This has also been done, and I've experimented with it
myself, but found the gain not so noteworthy as to make me want to
investigate the matter more deeply -
--
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
Am 11.02.2011 08:12, schrieb Oskar Sander:
> Maybe a stupid question, what happens when ypr are not the most
> significant parameters like in a "mosaic"? Will any of the RANSAC
> models work (I would assume one has to use the old version if anything...)
The homography model should work relativly well, unless you are trying
to make a mosaic with fisheye images.
The ransac mode can be selected with the --ransacmode parameter, so you
don't need to go back to an older version. Note that cpfind will use the
homography for images with HFOV < 65� automatically.
ciao
Pablo
Am 07.02.2011 23:10, schrieb Jeffrey Martin:
I'm quite swamped with "real" work right now, so I don't have time to
work on cpfind for the next weeks.
> HI Kay,
>
> a bunch of nice ideas!
>
> comments below
>
> On Monday, February 7, 2011 3:34:25 PM UTC+1, kfj wrote:
>
> If I could tell the CPG to scale all
> images to, say, 50 pixels per degree overall, I would achieve
> precisely the effect I want by specifying one single parameter. It'd
> make things so much easier for mixed-lens takes.
>
>
> ok, with a minimum image width of say 320 (long side), this would be
> great, i think.
The FOV normalisation is a nice idea, but I needs a bit more effort than
a simple scaling.
> I know that theoretically SURF and SIFT features are (quite) scale-
> insenstive, but my experience tells me that this truth only goes so
> far. I'm not sure how scale-insenstive the gradient-based detector in
> cpfind is. But I feel that implementing my proposition might be easy
> and it'd give us the opportunity to see if this might be a cheaply
> bought improvement in performance.
It should perform similar to SURF in that respect.
> The idea is to run the process on smaller images and once the
> orientations are established, to replace the images with full scale
> versions and have all pto parameters that build on image coordinates
> rescaled. I wrote this because I wanted to work on the screen-sized
> images I carry with me on my laptop and apply the results to the full-
> scale images back home with the fat data corpus. It works, and
> surprisingly well. The scaled-down versions are usually a fair bit
> crisper than the full-sized images, so there is enough detail for the
> CPGs to work on - and since the feature detectors produce subpixel
> accuracy, the scaled-up pto often stitches without any need for
> further intervention - if you want you can run a global fine-tune on
> the CPs.
Note that a global finetune is not really the best thing, as most of
the control points found by cpfind/panomatic/sift will be in some higher
scale, and the finetune only uses a small window for correlation.
> The next idea, to look at the overlapping parts once the overlap has
> been roughly established, is also promising and heas been previously
> exploited, though I'm not entirely sure where the code is.
The --multirow option of cpfind does that.
> Another
> interesting aspect along these lines is to warp the overlapping parts
> of two images to a common projection and run the CPGs on those warped
> partial images, to later retransform the CPs to original image
> coordinates. This has also been done, and I've experimented with it
> myself, but found the gain not so noteworthy as to make me want to
> investigate the matter more deeply -
>
>
> do you want some 2000 image panos to test it on? in that case the time
> savings might be very significant. what I mean is, sure for panos
> containing 4 or 10 images this just won't matter but for gigapixel
> images it might save minutes or hours.
Have you tried the multirow mode of cpfind for this type of panoramas?
It was specially designed for that, and should be faster than doing a
miniature pano and then reusing the overlaps, as it first matches only
the consecutive images, connects strips, optimizes and then looks for
control points in the overlapping images.
I don't have such a large pano, so I don't have much experience with it,
though.
ciao
Pablo