AFAIK, Hugin always searches the entire area of each image for control
points. I use Hugin for all kinds of image registration [1], and often
I would get much better results if I could specify a "region of
interest" where the CP generator could search.
Is this possible with the present version of Hugin? Is there a trick
to getting the Align Images step to search in a limited area in each
image?
Of course I can set CPs manually, but it's a lot of work.
Thanks,
Daniel Reetz
[1]I really love using/abusing Hugin as an image registration tool. In
particular, I like to take in sequences of images, register them all
to one plane in the image, and then average the result for "synthetic
focus":
Poor example:
http://danreetz.com/for_hugin/NissanSynAp.jpg
Better example with custom software my friend Matti wrote (Warning, large!):
http://www.futurepicture.org/images/sinclair_1_full.jpg
Or specify a "region of interest" and discard all CPs generated outside it.
> Is this possible with the present version of Hugin? Is there a trick
> to getting the Align Images step to search in a limited area in each
> image?
Not AFAIK, but there are some elements that can be "re-purposed" for your
application.
If I understand your application correctly, you would like to have CPs
generated on the object to synthetically focus on. You will need to mask that
object in one way or another? Hugin has a mask editor. The one function that
would need to be implemented to achieve your expeted result is pruning CPs
that are outside (or inside) a selected mask. Not excessively difficult to
implement.
There are other pruning mechanism within Hugin as well, but they may not be
helpful in your case.
Celeste prunes control points from the sky. Initially we wanted to exclude
the sky from the CP generation, but it turned out to be computationally more
efficient to do it the other way around.
"clean control points" (a button on the Images tab) prunes statistical
outliers. Must press the button a few times. I found it to be excellent at
removing CPs from moving subjects; and very good at removing CPs from
foreground subjects (those pesky CPs that are more parallax-affected than the
far away CPs).
> Of course I can set CPs manually, but it's a lot of work.
You don't want that. That said, adding CP's manually in Hugin is a very fast
process. Click left, click right, right-click. You don't have to position
your mouse perfectly on the spot on the left and right image. On right-
clicking Hugin fine-tunes the location of the CP, so you just need to target
the approximate area (+/- 10pixels).
Yuv
Isn't this already achieved with "Remove control points in masks" from
the 'Edit' menu?
Carl
Duh! Of course. Shows how much I have been using the masking function... not.
Thanks for completing the info.
Yuv
I believe cpfind is already exclude mask aware. Just set an exclude
mask on any parts of an image where you don't want control points, run
cpfind, and you'll get control points only in regions that haven't been
excluded.
Here's an example:
http://VictoriaVR.ca/tmp/cpfind-without-mask.jpg
http://VictoriaVR.ca/tmp/exclude-mask.jpg
http://VictoriaVR.ca/tmp/cpfind-with-mask.jpg
Cheers,
BBB
--
Bob Bright
Vancouver Island Digital Imaging
(250) 857-9887
BBBr...@VictoriaVR.ca
http://VictoriaVR.ca
Regards,
Daniel Reetz
cpfind does honor alpha channels and masks defined in the pto file.
It removes any matches found in the alpha channels (this is needed for
remapped images, otherwise one could get "false" matches at the
corners/edges of a remapped image.)
It will still analyse all parts of the image, though, so there is not
much computational benefit. I think the typical savings are not really
worth the coding effort.
> I am currently toying with this mechanism for use in another demo
> plugin, but I want to throw in rewarping of the parts of the images
> that correspond to the ROIs to a common projection to make them
> geometrically as similar as possible, thus improving CPG performance
> especially with fisheye images and avoiding warp-related CPG problems
> - some sort of high-end matching which would produce very good
> quality, well-distributed CPs, particularly for applications like lens
> calibration.
Yes, something like that would be very nice. Or one could try Least
squares matching. (estimates local affine transformation as part of the
matching process, is typically accurate to ~ 0.1 pixel). However, it
needs good initialisations (1-2 pixels error, good estimate for the
initial affine transform).
ciao
Pablo