Hello Chris
Here is the little script I use
It is slightly changed from a script found here :
http://linuxfr.org/forums/47/28659.html
I also have some code before and after to print execution time
############################
#! /bin/bash
## convertion of my jpg images in tif
for i in *.JPG
do
echo "conversion de $i"
convert -compress none $i z_$i.tif
done
## align the images and delete the original non aligned tif files
align_image_stack -v -m -a mask z_*.tif
rm -f z_*.tif
# check the presence of a former output from enfuse
numero=$(ls final* | grep final | wc -w)
## Change the temp file (because I don't have enough disk space on the
partition where the software is installed)
export TMPDIR=./
## blending of the images with enfuse
enfuse -o final_$numero.tiff -v -m 400 --wExposure=0.01
--wSaturation=0.01 --wContrast=1 --HardMask --ContrastWindowSize=9 mask*.tif
#############################
So I use the HardMask option as recommended in the documentation for
focus stacking to avoid too soft final images.
But I never tried the soft mask approach. And as you point out, it could
indeed decrease the hallo problems thanks to the arithmetic averaging
over all the images for non contrasted pixels.
I was however maybe a little bit over-optimistic about the results with
these --wExposure=0.01 --wSaturation=0.01 options.
I run some rapid tests on reduced size images but the results on full
size images seems to be better but not as better as on the smaller size
images (so maybe I also have to change the value of the
ContrastWindowSize option ?). I should made more systematic tests on
full size images but this is less easy because of computation time...
I got the examples from the man pages by simply typing "man enfuse" in
the console.
But indeed, "enfuse --version" shows that I'm using 3.2 version.
This is the version that is in the official ubuntu repositories...
You speak about section 5.4 of the manual but I was not able to find it
(I downloded the tar.gz of 4.2 version and I looked in enfuse.info doc)
I suppose you speak about section 4.4 : Local Contrast Weighting
I already read it but the standard deviation was very easy to understand
while the Laplacian of Gaussian was really less easy ...
I was even not sure which kind of problems this approach could solve. So
I will look at it more carefully now...
You also ask how my problems looks like.
There are in fact two kind of problems that could be solved (at least
partially) by choosing the image used when there is no difference of
contrast (in HardMask mode) :
- the formation of a hallo around objects that are well detached on the
background
- a transition from sharp parts of the image to blurred ones that is
very rapid and don't look very natural
I have posted two examples of these problems here :
Ex 1
http://picasaweb.google.be/gilles.sanmartin/Enfuse_ex1?authkey=Gv1sRgCL29__KI_PXGogE#
Ex2
http://picasaweb.google.be/gilles.sanmartin/Enfuse_ex2?authkey=Gv1sRgCOC8iavluu2-owE#
In example 1 there is a clear hallo around the butterfly egg because
first image was used for non contrasted pixels.
Using last image value for not contrasted pixels would have avoided this
problem.
Sometimes the "reference" image to use to avoid the hallo is not the
last one.
In example 2 you have the first and the last image of the stack and the
output from enfuse (slightly post-treated).
In this output the transition from sharp to blur is very rapid because
first image has been used for non contrasted pixels.
You have a fourth image that is a manual merge of the enfuse output and
the last image of the stack in which the transition looks more natural.
This is the result I guess we could have obtained if last image had been
used as first image...
There is an other (maybe more important) problem in this image : hallo
around the egg of the first plan. But I guess that it would be very
difficult to avoid this hallo (even with the combined Sdev - LoG method).
Thanks for your input
Gilles
Le 24/07/10 16:44, cspiel a écrit :
On Jul 23, 3:34 am, Gilles San Martin<[email protected]>
wrote:
Bruno, your solution works if you want the last image to be used in case
of no contrast differences. If you want an other image (from the middle
of the stack) as reference, you have a problem with align_image_stack
that is used before enfuse in the script.
What are you doing? What is the exact
command line you use to call Enfuse? In
particular, I'd be interested whether you use a
hard or a soft mask.
For a soft mask each pixel contributes according
to its total weight (with the "interesting"
corner case of all weights being equal to zero).
Identical weights lead to arithmetic averaging.
For a hard mask and identical weights Enfuse
prefers the first image unless all weights are
zero, where it uses a value between the minimum
and the maximum weight. See "enfuse.h" around
line 1290.
How does your problem look like such that image
order matters despite all weights being the
same?
But it is possible I guess to
first use align_image_stack and then rename the reference image so that
it is placed in first position. This is however not very convenient (the
script runs generally during 1-2 hours for each stack, during the night...)
Though I neither know where you started
from, nor where you are headed to, I'd say this
clearly sounds sub-optimal.
Erik, your solution is really wonderful ! The transition from the sharp
area to the out of focus area is much more natural but additionally the
halo problems seem to be much better managed (in the few tests I made).
(1) Activating another weighting
category besides contrast weighting may break
the tie between the weights as you report above.
However, be aware that one category can
overpower another, especially if the latter is
based on faint differences.
(2) On how to attack the halo problem
with focus-stacking in Enfuse see the manual
Section 5.4 in general an Sec. 5.4.3 in
particular.
The information is in the man page of enfuse (example section) but not
in the enfuse reference manual (and I read only this one...) where
example are given with 0 values for saturation and exposure .
Wow, you are the first one to publicly
confess that he actually has read the manual!
But you must have run into an old and
conceivably outdated manual page. The man pages
for versions 4.x do not feature any example
sections at all.
You'll have more fun if the documentation you
refer to matches the Enblend and Enfuse versions
you are using. For the 4.x series this is
particularly easy as both Enblend and Enfuse
know how to identify themselves with the
"--version" option:
$ ~/projects/enblend/BUILD/src/enfuse --version
enfuse 4.1-125ae50943b4
...
and the manual pages also feature a version id:
ENFUSE(1) User Commands ENFUSE(1)
NAME
enfuse - manual page for enfuse 4.1-125ae50943b4
SYNOPSIS
enfuse [options] [--output=IMAGE] INPUT...
...
BTW, for the same reasons the manuals carry
version ids, too.
Maybe it could be useful to add this information to the wiki ?
I'd prefer to add useful information to
the official manual[s]. As I know one of the
hacker dudes who have access to the repository,
perhaps we can get that into the official
distribution.
Thank you,
Chris
--
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