Not a Panorama - just control points for Enfuse - How to?

195 views
Skip to first unread message

Isaac Gouy

unread,
Nov 3, 2010, 2:12:41 AM11/3/10
to hugin and other free panoramic software
align_image_stack + enfuse is very cool for exposure fusion and focus
fusion as-long-as the photos align well.

Is there a way to use Hugin control points on a stack of not so well
aligned photos - to align the photos and somehow save them off as
tiffs or somehow pass through to enfuse?

I'm not trying to create a panorama, just fuse photos at different
exposures or fuse photos at different focus.

kfj

unread,
Nov 3, 2010, 5:50:36 AM11/3/10
to hugin and other free panoramic software


On 3 Nov., 07:12, Isaac Gouy <igo...@yahoo.com> wrote:
> align_image_stack + enfuse is very cool for exposure fusion and focus
> fusion as-long-as the photos align well.
>
> Is there a way to use Hugin control points on a stack of not so well
> aligned photos - to align the photos and somehow save them off as
> tiffs or somehow pass through to enfuse?

You can easily do that. First you set up the hugin project to your
liking, then you don't stitch the images together but ask hugin to
only output the remapped images. Once you have the remapped images,
you can call enfuse manually.

Why do you have to do it that way? If the images don't overlap
sufficiently, hugin doesn't call enfuse on them as a group when the
fused panorama output is selected, because it doesn't realize that
they are actually meant as a stack. Even if you select images to be
part of a stack, it stubbornly refuses to enfuse them if they don't
overlap sufficiently. Instead it call enfuse for every single of them
(which could be omitted - I think it should require very little
programming effort to notice that enfuse is about to be called with a
single image, and the call could then be omitted entirely - but this
is how things are currently) - and then stitches together these
'stacks' consisting of one image each with enblend. The result is a
'patchwork' look and not the 'stack of transparent layers' you
anticipated. But the warped images will be shaped just so that they
can be blended manually with enfuse without any further ado. Enfuse
itself will fuse whatever it's given. The warped images may not look
as if they can be just put 'on top' of each other - but don't be
fooled: nona, which has produced the warped images, may have saved
them as 'cropped images', conserving the place in the grater context
of the panorama where the partial images are to be put.

So, again, in a nutshell:
find/set CPs in hugin
choose to output individual remapped images
enblend them 'manually'

with regards
KFJ

Bruno Postle

unread,
Nov 3, 2010, 11:29:53 AM11/3/10
to kfj, hugin and other free panoramic software
(Apologies my phone won't let me quote properly)

If your bracketed sets are not well aligned there is no need to save the intermediate files and blend them manually.

Hugin has two exposure fusion modes: 'fused and blended' fuses stacks together first then seam blends the result, this requires the stacks to be approximately aligned, i.e. handheld using an SLR bracketing mode is fine; the other 'blended and fused' mode is what you need if you want to do exposure fusion but don't have identifiable stacks.

--
Bruno



kfj

unread,
Nov 4, 2010, 6:12:26 AM11/4/10
to hugin and other free panoramic software
My mistake. I had actually tried my assumption, but all the images I
used for the test had an EV value of 0. In that case hugin assumed
there was nothing to enfuse, the images being all equally exposed, and
just enblended them.
The 'blended and fused' mode Bruno refers to has been renamed recently
and is now called 'Exposure fused from any arrangement', so if you are
using a very recent version, that's the one you want.
Let me stress that your differently exposed images need EV values,
whether they are in your photos or whether you set them manually.
Hugin will then stitch similarly exposed images together into layers
and enfuse these layers. If you don't have similarly exposed images to
make up layers to be subsequentially enfused and still want to enfuse
them all, they should all have different EV values - I tried with 0,
1, 2 etc. and it worked. Of course you can still do it manually as I
wrote in my previous post ;)

with regards
Kay

Eric O'Brien

unread,
Nov 4, 2010, 5:49:28 PM11/4/10
to hugi...@googlegroups.com
One might consider this, also, an indication that the documentation
might be expanded or clarified on this point. ;)

(In case it's not already addressed.)

eo

Isaac Gouy

unread,
Nov 4, 2010, 8:23:26 PM11/4/10
to hugin and other free panoramic software


On Nov 3, 2:50 am, kfj <_...@yahoo.com> wrote:
> On 3 Nov., 07:12, Isaac Gouy <igo...@yahoo.com> wrote:
>
> > align_image_stack + enfuse is very cool for exposure fusion and focus
> > fusion as-long-as the photos align well.
>
> > Is there a way to use Hugin control points on a stack of not so well
> > aligned photos - to align the photos and somehow save them off as
> > tiffs or somehow pass through to enfuse?
>
> You can easily do that. First you set up the hugin project to your
> liking, then you don't stitch the images together but ask hugin to
> only output the remapped images.


So I have 3 photos taken hand-held with different focus (same
exposure) and of course there's say 5% movement.

I have 28 and 32 control points fixing those 3 photos (after Images
tab "Clean Control Points")

On Stitcher tab I set the horizontal "Field of View".
On Stitcher tab I set the "Panorama Canvas Size" to the original photo
size.
On Stitcher tab I checked "Output Normal" "Remapped images"

On Stitcher tab I clicked "Stitch now!"

And 3 images were saved.

BUT those 3 images show just the same movement between them as the
original images?



Isaac Gouy

unread,
Nov 4, 2010, 8:48:29 PM11/4/10
to hugin and other free panoramic software
So I have 3 photos taken hand-held with different focus (same
exposure) and of course there's say 5% movement.

I have 28 and 32 control points fixing those 3 photos (after Images
tab "Clean Control Points")

On Stitcher tab I set projection "Rectilinear".
On Stitcher tab I set horizontal "Field of View" and deleted vertical.
On Stitcher tab I set "Panorama Canvas Size" width to the original
photo
width.
On Stitcher tab I click "Calculate Optimal Size".

On Stitcher tab I check "Exposure Fusion" "Blended and fused
panorama"
On Stitcher tab I check "Exposure Fusion" "Remapped images"
(no other options are checked)
On Stitcher tab I set some "Image Fusion" Options
On Stitcher tab I clicked "Stitch now!"


BUT the files seem to be ignored (is there a way to have the command
line information logged, it's kind of difficult to grab it from that
popup window before the window closes)

"C:/Program Files/Hugin/bin/nona" -z PACKBITS -r ldr -e 12.9658 -m
TIFF_m -o "c_exposure_layers_" -i 0 "C:/Users/Andy/AppData/Local/Temp/
hug3987.tmp"
"C:/Program Files/Hugin/bin/nona" -z PACKBITS -r ldr -e 12.9658 -m
TIFF_m -o "c_exposure_layers_" -i 1 "C:/Users/Andy/AppData/Local/Temp/
hug3987.tmp"
"C:/Program Files/Hugin/bin/nona" -z PACKBITS -r ldr -e 12.9658 -m
TIFF_m -o "c_exposure_layers_" -i 2 "C:/Users/Andy/AppData/Local/Temp/
hug3987.tmp"
"C:/Program Files/Hugin/bin/enblend" --compression NONE -f4224x3148 -o
"c_exposure_00.tif" "c_exposure_layers_0000.tif"
"c_exposure_layers_0001.tif" "c_exposure_layers_0002.tif"
enblend: info: loading next image: c_exposure_layers_0000.tif 1/1
enblend: info: loading next image: c_exposure_layers_0001.tif 1/1
enblend: warning: some images are redundant and will not be blended
enblend: info: loading next image: c_exposure_layers_0002.tif 1/1
enblend: warning: some images are redundant and will not be blended
enblend: info: writing final output
"C:/Program Files/Hugin/bin/exiftool" -overwrite_original_in_place -
TagsFromFile "C:/Users/Andy/Pictures/learnACDSeePro4Beta/handheld-
blend/DSC07484.JPG" -ImageDescription -Make -Model -Artist -WhitePoint
-Copyright -GPS:all -DateTimeOriginal -CreateDate -UserComment -
ColorSpace -OwnerName -SerialNumber "c_exposure_00.tif"
1 image files updated
"C:/Program Files/Hugin/bin/enfuse" --compression NONE --exposure-
weight=0 --saturation-weight=0 --contrast-weight=1 --hard-mask --
contrast-window-size=9 -o "c_blended_fused.tif" "c_exposure_00.tif"
enfuse: warning: only one input image given.
enfuse: warning: Enfuse needs two or more overlapping input images in
order to do
enfuse: warning: blending calculations. The output will be the same
as the input.
enfuse: info: loading next image: c_exposure_00.tif 1/1


2010.2.0.d8ce0ba947cc built by Matthew Petroff, on Windows Vista SP2

kfj

unread,
Nov 5, 2010, 1:29:46 PM11/5/10
to hugin and other free panoramic software


On 5 Nov., 01:48, Isaac Gouy <igo...@yahoo.com> wrote:

> So I have 3 photos taken hand-held with different focus (same
> exposure) and of course there's say 5% movement.

If you're trying to make a focus stack, all the photos are likely to
have the same exposure. As I've pointed out previously, if your images
have the same EV value, enfusing them with hugin will NOT WORK. You
can see from the output you have posted that enfuse is never called
with more than one image. The output also shows that nona is called
every time with the same -e value (12.9658), which is precisely that
self-same EV value which is equal for all images. If you don't want to
blend your images manually you have to give them separate fake EV
values (like, 0, 1, 2). Your enfuse parameters are fine like this, but
since enfuse never enfuses any images, they have no effect. I'll
explain the output to you:

"C:/Program Files/Hugin/bin/nona" -z PACKBITS -r ldr -e 12.9658 -m
TIFF_m -o "c_exposure_layers_" -i 0 "C:/Users/Andy/AppData/Local/Temp/
hug3987.tmp"
...
- your images get warped, so you can put them on top of each other.
The result is written to a temporary file

"C:/Program Files/Hugin/bin/enblend" --compression NONE -f4224x3148 -o
"c_exposure_00.tif" "c_exposure_layers_0000.tif"
"c_exposure_layers_0001.tif" "c_exposure_layers_0002.tif"
...
- your warped images are stitched together. This is because they all
have the same EV value. It is not what you want.

"C:/Program Files/Hugin/bin/enfuse" --compression NONE --exposure-
weight=0 --saturation-weight=0 --contrast-weight=1 --hard-mask --
contrast-window-size=9 -o "c_blended_fused.tif" "c_exposure_00.tif"
enfuse: warning: only one input image given.
...
the stitched image is passed to enfuse. But since this is only one
image, there is nothing to enfuse, as enfuse does point out to you
saying 'enfuse: warning: only one input image given.'

You write that your images are something like 5% misaligned. I predict
you won't have very good results. Focus stacks neeed to be done with
as little parallactic error as possible (you're using a hard mask,
after all). I'd recommend to redo the photography with a tripod.

Finally, your output also shows that you have asked for:

On Stitcher tab I check "Exposure Fusion" "Blended and fused
panorama"
On Stitcher tab I check "Exposure Fusion" "Remapped images"

If you want the 'blended and fused panorama', you must use images with
different EV
If you make 'remapped images', you get several (remapped) images which
you can then enfuse manually.

Did you try to call enfuse manually on your remapped images
(c_exposure_layers_0000.tif etc.)?

One last bit of advice: You talk about brackets. Mostly people will
think you've done exposure brackets. Focus stacks are less frequently
done. I think your problem would have been more quickly analyzed if
you had mentioned that you're trying to make a focus stack;)

with regards
KFJ

Isaac Gouy

unread,
Nov 5, 2010, 2:50:02 PM11/5/10
to hugin and other free panoramic software


On Nov 5, 10:29 am, kfj <_...@yahoo.com> wrote:
> On 5 Nov., 01:48, Isaac Gouy <igo...@yahoo.com> wrote:
>
> > So I have 3 photos taken hand-held with different focus (same
> > exposure) and of course there's say 5% movement.
>
> If you're trying to make a focus stack, all the photos are likely to
> have the same exposure. As I've pointed out previously, if your images
> have the same EV value, enfusing them with hugin will NOT WORK. You
> can see from the output you have posted that enfuse is never called
> with more than one image. The output also shows that nona is called
> every time with the same -e value (12.9658), which is precisely that
> self-same EV value which is equal for all images. If you don't want to
> blend your images manually you have to give them separate fake EV
> values (like, 0, 1, 2).


Where do I have to give them separate fake EV values?

In the exif of the photos?

In some input field in Hugin?


-snip-
> You write that your images are something like 5% misaligned. I predict
> you won't have very good results. Focus stacks neeed to be done with
> as little parallactic error as possible (you're using a hard mask,
> after all). I'd recommend to redo the photography with a tripod.

When I take photos with a stable camera, align_image_stack on the
command line seems fine - no need for me to set control points and
wrestle with Hugin.

Thanks for your help.

Isaac Gouy

unread,
Nov 5, 2010, 4:33:57 PM11/5/10
to hugin and other free panoramic software


On Nov 5, 10:29 am, kfj <_...@yahoo.com> wrote:
-snip-
> If you want the 'blended and fused panorama', you must use images with
> different EV
> If you make 'remapped images', you get several (remapped) images which
> you can then enfuse manually.

I hacked the EXIF to give the images different exposure times

"C:/Program Files/Hugin/bin/nona" -z PACKBITS -r ldr -e 12.9658 -m
TIFF_m -o "n_exposure_layers_" -i 0 "C:/Users/Andy/AppData/Local/Temp/
hug341B.tmp"
"C:/Program Files/Hugin/bin/nona" -z PACKBITS -r ldr -e 11.9658 -m
TIFF_m -o "n_exposure_layers_" -i 1 "C:/Users/Andy/AppData/Local/Temp/
hug341B.tmp"
"C:/Program Files/Hugin/bin/nona" -z PACKBITS -r ldr -e 10.6439 -m
TIFF_m -o "n_exposure_layers_" -i 2 "C:/Users/Andy/AppData/Local/Temp/
hug341B.tmp"

Maybe I just have wrong expectations about what "remapped" means - as
far as I can tell

n_exposure_layers_0000.tif
n_exposure_layers_0001.tif
n_exposure_layers_0002.tif

have the same misaligned geometry as the original photos, and when
enfused give just the kind of multiple image mess you would imagine
when misaligned images are merged together.



Isaac Gouy

unread,
Nov 5, 2010, 8:41:33 PM11/5/10
to hugin and other free panoramic software


On Nov 5, 10:29 am, kfj <_...@yahoo.com> wrote:
-snip-
> If you want the 'blended and fused panorama', you must use images with
> different EV

And it seems necessary to click "Optimize now!" on the Optimizer tab.

Then the _blended_fused.tif is at least recognizable as an attempt to
remap and fuse the photos.

Although from what I've seen a stable camera is a basic requirement
for enfuse exposure fusion and focus fusion - any movement beyond what
align_image_stack can fix seems to be too much movement for an
acceptable result.

kfj

unread,
Nov 6, 2010, 4:58:53 AM11/6/10
to hugin and other free panoramic software
On 6 Nov., 01:41, Isaac Gouy <igo...@yahoo.com> wrote:

> Where do I have to give them separate fake EV values?
> In the exif of the photos?
> In some input field in Hugin?

You don't have to change anything in your images, though that works
just the same. It's enough to go to the 'camera and lens' tab, choose
the 'photometric' subsection, select each image in turn and enter the
fake EV value in the 'EV' field in the lower left of the screen.

> Although from what I've seen a stable camera is a basic requirement
> for enfuse exposure fusion and focus fusion - any movement beyond what
> align_image_stack can fix seems to be too much movement for an
> acceptable result.

Correct. To use enfuse you need very precise alignment. Much more than
in ordinary stitching, where enblend can just try and put the seam
somewhere where there's little visible discrepancy. Your 'movement'
inevitably translates to parallactic errors, so precise alignment
becomes impossible and the result is disappointing. This is no fault
of the software, it's a direct consequence of the laws of optics.
So you absolutely must shoot from the same position. If you can't use
a tripod, find a rock or tree. The problem with focus stacks is that
you have to change the focus between shots, so unless your camera is
mounted somehow, it's very difficult to maintain the same position
from one shot to the next. With exposure blending, you can just do an
AEB with a steady hand and that may still be enough.

with regards
Kay

Isaac Gouy

unread,
Nov 6, 2010, 12:39:31 PM11/6/10
to hugin and other free panoramic software


On Nov 6, 1:58 am, kfj <_...@yahoo.com> wrote:
> On 6 Nov., 01:41, Isaac Gouy <igo...@yahoo.com> wrote:
>
> > Where do I have to give them separate fake EV values?
> > In the exif of the photos?
> > In some input field in Hugin?
>
> You don't have to change anything in your images, though that works
> just the same. It's enough to go to the 'camera and lens' tab, choose
> the 'photometric' subsection, select each image in turn and enter the
> fake EV value in the 'EV' field in the lower left of the screen.
>
> > Although from what I've seen a stable camera is a basic requirement
> > for enfuse exposure fusion and focus fusion - any movement beyond what
> > align_image_stack can fix seems to be too much movement for an
> > acceptable result.
>
> Correct. To use enfuse you need very precise alignment. Much more than
> in ordinary stitching, where enblend can just try and put the seam
> somewhere where there's little visible discrepancy. Your 'movement'
> inevitably translates to parallactic errors, so precise alignment
> becomes impossible and the result is disappointing. This is no fault
> of the software, it's a direct consequence of the laws of optics.

The only reason I was tempted to try was that as you say, in ordinary
stitching there's often little visible discrepancy.


> So you absolutely must shoot from the same position. If you can't use
> a tripod, find a rock or tree. The problem with focus stacks is that
> you have to change the focus between shots, so unless your camera is
> mounted somehow, it's very difficult to maintain the same position
> from one shot to the next. With exposure blending, you can just do an
> AEB with a steady hand and that may still be enough.

As long as the camera provides a wide enough bracket, otherwise it's
the same situation as focus fusion :-)
Reply all
Reply to author
Forward
0 new messages