tweaking enfuse parameters pays

354 views
Skip to first unread message

kfj

unread,
Jul 21, 2011, 6:18:37 AM7/21/11
to hugin and other free panoramic software
Hi group!

Working on the images of my last trip to the Alps I spent a fair
amount of time on a 360X180 of one of my favourite spots. It's a deep-
cut valley with deep shadows - taken on a sunny day with a bit of
fluffy cloud. No way I could get the sky and the shadows right with
one exposure, so I took a set of brackets (-3,-1,+1) and made a
panorama from exposure-fused stacks from it.

Using the defaults produced a pretty good result, but yet again I
couldn't help feeling that there was a bit too much 'averaging'
happening - what I really wanted was more along the lines of a fill
light in the deep shadows and the sky from the darkest exposure, while
the middle range was pretty good as it was in the middle exposure (-1
because my EOS 450D with the Samyang stereographic fisheye exposes too
generously) - and since I had a largish body of water in the image, I
wanted that to be taken as near as from one (the middle) exposure only
as possible, as the water was happily rippling away and averaging
ripples from a bracket looks ugly. Still I wanted to avoid extensive
masking.

So I did a bit of thinking how I could get closer to the effect I
desired. What I ended up with was lowering the exposure sigma to less
than half the default value (that is, --exposure-sigma=.075 where the
default is .2), and I surprised myself by the intensity of the
improvement. Obviously the narrowing of the gaussian function for the
pixel weighting resulted in off-optimal pixels being weighted lower,
coming closer to the effect of a hard mask, but still retaining some
of the gentle gradients resulting from averaging, avoiding artifacts.
By the way - I usually set --saturation-weight to zero as well.

Maybe the exposure sigma default of .2 is for wider brackets - and
this would also explain why there is a notion of enfuse working best
with only two exposures - had I taken the -3 and the +1, I would have
ended up with something similar, but my water would probably have been
messed up (I have yet to try). It would make sense to use a different
sigma for differently spaced brackets - if the sigma is too high,
everything is just averaged, but to my initial surprise I also found
that a too low value is also detrimental, probably because it makes
all individual pixel weights so low that the final effect is averaging
again. My suspicion is that the optimal value is related to the
steepest section of the gaussian curve, and indeed I found little
difference between sigma values from .1 to .05 for my specific
brackets.

This makes me wonder if a 'good' value couldn't be derived from the
spacing of the bracket by means of a simple formula, instead of using
a fixed value no matter what the bracket is.

To cut a long story short, tweaking enfuse parameters pays. It's well
worth spending some time looking deeper into enfuse's manual. Great
tool :)

Looking up the manual I found that the enfuse reference shipping with
hugin's help system still uses the old enfuse parameter notation, i.
e. --wSigma instead of the newer --exposure-sigma, which my enfuse
(4.0-753b534c819d) uses. Is this an oversight or deliberate?

Kay

Gnome Nomad

unread,
Jul 26, 2011, 4:53:38 AM7/26/11
to hugi...@googlegroups.com
kfj wrote:
> Hi group!
>
> Working on the images of my last trip to the Alps I spent a fair
> amount of time on a 360X180 of one of my favourite spots. It's a deep-
> cut valley with deep shadows - taken on a sunny day with a bit of
> fluffy cloud. No way I could get the sky and the shadows right with
> one exposure, so I took a set of brackets (-3,-1,+1) and made a
> panorama from exposure-fused stacks from it.

Hmm, from my reading (and limited experience) about shooting frames to
be turned into a HDR image, you shoot one frame at whatever exposure (at
fixed aperture) gives proper exposure for the darkest parts, one frame
at the corresponding exposure that gives proper exposure for the
lightest parts, then space the intermediate exposures 2-3 stops between
them.

But I do my HDR image processing in QtPFSGui, not Hugin.

--
Gnome Nomad
gnome...@gmail.com
wandering the landscape of god
http://www.cafepress.com/otherend/

kfj

unread,
Jul 26, 2011, 6:52:44 AM7/26/11
to hugin and other free panoramic software


On 26 Jul., 10:53, Gnome Nomad <gnomeno...@gmail.com> wrote:

> kfj wrote:
> > Hi group!
>
> > Working on the images of my last trip to the Alps I spent a fair
> > amount of time on a 360X180 of one of my favourite spots. It's a deep-
> > cut valley with deep shadows - taken on a sunny day with a bit of
> > fluffy cloud. No way I could get the sky and the shadows right with
> > one exposure, so I took a set of brackets (-3,-1,+1) and made a
> > panorama from exposure-fused stacks from it.
>
> Hmm, from my reading (and limited experience) about shooting frames to
> be turned into a HDR image, you shoot one frame at whatever exposure (at
> fixed aperture) gives proper exposure for the darkest parts, one frame
> at the corresponding exposure that gives proper exposure for the
> lightest parts, then space the intermediate exposures 2-3 stops between
> them.

hmm to you, Gnome Nomad ;-)
-3 -1 +1 is precisely that: -3 is for the lightest parts, +1 for the
darkest, and the middle one (-1) ends me up with 2 stops between. What
are you trying to tell me? My posting is not about shooting brackets
but about processing them with enfuse.

As I'm on this topic again, I'd like to add another hopefully helpful
hint. Even though I already put my middle exposure at -1, the +1
exposure still is way to bright, but I need it for the deep shadows.
Nevertheless the result of the fusion often comes out too bright. It
may just be my specific process, but I often found that on top of
tweaking --exposure-sigma, lowering --exposure-mu helped - it makes
the overall result slightly darker and prefers the darker exposures,
but there is still an appreciable fill light from lightest exposure.
So I set my default parameters for enfuse to

--exposure-sigma=.1 --saturation-weight=0 --exposure-mu=.35

and often enough that hits the spot :)

Kay

kevin

unread,
Jul 26, 2011, 9:37:29 AM7/26/11
to hugin and other free panoramic software


On Jul 26, 6:52 am, kfj <_...@yahoo.com> wrote:

> As I'm on this topic again, I'd like to add another hopefully helpful
> hint. Even though I already put my middle exposure at -1, the +1
> exposure still is way to bright, but I need it for the deep shadows.
> Nevertheless the result of the fusion often comes out too bright. It
> may just be my specific process, but I often found that on top of
> tweaking --exposure-sigma, lowering --exposure-mu helped - it makes
> the overall result slightly darker and prefers the darker exposures,
> but there is still an appreciable fill light from lightest exposure.
> So I set my default parameters for enfuse to
>
> --exposure-sigma=.1 --saturation-weight=0 --exposure-mu=.35
>
> and often enough that hits the spot :)
>
> Kay

I've noticed similar issues with night shots. Sometimes blown out
highlights around lights will cause those areas to be brighter then
they should and then you have to tweak some settings. I've tried
different things including using masks to combine images in gimp to
remove the blown out areas where I have other images that contain
detail, but it always seems to leave some harsh edges. Enfuse has the
--entropy-cutoff=LOWER-CUTOFF:UPPER-CUTOFF setting which will make
pixels above and below a certain point either white or black, but I
think what might be more useful would be an option where it gives
pixels above and below a certain point zero weight. If all the pixels
from the combined images were zero weighted then it could make that
pixel white or black (depending upon what the original pixels were).
This way that one image you have where you are trying to capture all
the shadow detail and most of the image is blown out to white, all
that white wouldn't mess up the other images that contain detail in
the white areas.

kfj

unread,
Jul 26, 2011, 11:56:06 AM7/26/11
to hugin and other free panoramic software


On 26 Jul., 15:37, kevin <ke...@bluelavalamp.net> wrote:

> I've noticed similar issues with night shots.  Sometimes blown out
> highlights around lights will cause those areas to be brighter then
> they should and then you have to tweak some settings.  I've tried
> different things including using masks to combine images in gimp to
> remove the blown out areas where I have other images that contain
> detail, but it always seems to leave some harsh edges.  Enfuse has the
> --entropy-cutoff=LOWER-CUTOFF:UPPER-CUTOFF setting which will make
> pixels above and below a certain point either white or black, but I
> think what might be more useful would be an option where it gives
> pixels above and below a certain point zero weight.

If you 'steepen' the gaussian function used for weighting (by
decreasing exposure-sigma), the effect approaches totally cutting off
off-center values, instead of still carrying a noticable part of them
into the final result. Part of the reason why I got into doing that
was because the blown highlights in my brightest shot would still
'bleed through', and going to sigma values below .1, the bleedthrough
would stop.

Entropy isn't really what you want to use as a criterion for excluding
blown highlights, but I can't seem to find a similar 'cutoff' option
for the exposure, probably there isn't one because you get better
(smoother) effects anyway tweaking mu and sigma.

Kay

Gnome Nomad

unread,
Jul 27, 2011, 12:49:16 AM7/27/11
to hugi...@googlegroups.com
kfj wrote:
>
> On 26 Jul., 10:53, Gnome Nomad <gnomeno...@gmail.com> wrote:
>
>> kfj wrote:
>>> Hi group!
>>> Working on the images of my last trip to the Alps I spent a fair
>>> amount of time on a 360X180 of one of my favourite spots. It's a deep-
>>> cut valley with deep shadows - taken on a sunny day with a bit of
>>> fluffy cloud. No way I could get the sky and the shadows right with
>>> one exposure, so I took a set of brackets (-3,-1,+1) and made a
>>> panorama from exposure-fused stacks from it.
>> Hmm, from my reading (and limited experience) about shooting frames to
>> be turned into a HDR image, you shoot one frame at whatever exposure (at
>> fixed aperture) gives proper exposure for the darkest parts, one frame
>> at the corresponding exposure that gives proper exposure for the
>> lightest parts, then space the intermediate exposures 2-3 stops between
>> them.
>
> hmm to you, Gnome Nomad ;-)
> -3 -1 +1 is precisely that: -3 is for the lightest parts, +1 for the
> darkest, and the middle one (-1) ends me up with 2 stops between. What
> are you trying to tell me? My posting is not about shooting brackets
> but about processing them with enfuse.

OK. I just was remembering doing some HDR sequences awhile back, and
seeing ranges of 7-9 stops, and thinking that a range of 4 stops isn't
very much ...

> As I'm on this topic again, I'd like to add another hopefully helpful
> hint. Even though I already put my middle exposure at -1, the +1
> exposure still is way to bright, but I need it for the deep shadows.
> Nevertheless the result of the fusion often comes out too bright. It
> may just be my specific process, but I often found that on top of
> tweaking --exposure-sigma, lowering --exposure-mu helped - it makes
> the overall result slightly darker and prefers the darker exposures,
> but there is still an appreciable fill light from lightest exposure.
> So I set my default parameters for enfuse to
>
> --exposure-sigma=.1 --saturation-weight=0 --exposure-mu=.35
>
> and often enough that hits the spot :)

Cool. I still prefer to use QTPSFGui for my HDR images. I think I'd do
that even if I was going to combine the resulting image into a panorama.

Jeffrey Martin

unread,
Jul 27, 2011, 3:28:37 AM7/27/11
to hugi...@googlegroups.com
Personally i've had the best results using +1.5 and -0.5 exposure derived from a single raw file.

kfj

unread,
Jul 27, 2011, 5:05:41 AM7/27/11
to hugin and other free panoramic software
On 27 Jul., 09:28, Jeffrey Martin <360cit...@gmail.com> wrote:

> Personally i've had the best results using +1.5 and -0.5 exposure derived
> from a single raw file.

Differently processed single raw files are perfect source material -
if the scene can be captured with the dynamic range available. I don't
know what you have, but my sensor's dynamic range is somewhere in the
12 to 14 bit range, and my landscapes sometimes just don't fit into
that. I wish they would. In fact I think the technology to expose the
sensor for a fixed period of time and then count the photons is silly.
What would be much more sensible is measuring the time it takes each
cell to reach saturation. When the exposure is finally stopped, those
cells which aren't full can still be photon-counted to define the
shadows. Store the result in a floating point format and you end up
with a truly HDR raw image without any fuss and then you can proceed
by exposure-blending different versions of it instead of the
cumbersome tone-mapping. I wonder if that's technically feasible, but
why not? Processing happens in the GHz range, that's 2 to the power of
32. Exposure times are in an order of magnitude of thousandth of
seconds. So in 2 ^ -10 seconds you should have 2 ^ 22 clock cycles -
that should be the dynamic range achievable just by measuring the time-
to-satuartion for the cells. If the full cell triggers a store
operation on the current clock value, there you go. Like a neuron
firing. 2 ^ 22 seems like plenty already (can't be bothered just right
now to make dB of it). Wonder if anyone thought of that?

Kay

Jeffrey Martin

unread,
Jul 28, 2011, 3:39:26 AM7/28/11
to hugi...@googlegroups.com
On Wednesday, July 27, 2011 11:05:41 AM UTC+2, kfj wrote:
On 27 Jul., 09:28, Jeffrey Martin <360c...@gmail.com> wrote:

> Personally i've had the best results using +1.5 and -0.5 exposure derived
> from a single raw file.

Differently processed single raw files are perfect source material -
if the scene can be captured with the dynamic range available. I don't
know what you have, but my sensor's dynamic range is somewhere in the
12 to 14 bit range, and my landscapes sometimes just don't fit into
that. I wish they would.

careful of histogram on canon - it is a histogram from the jpeg, even when shooting raw. what is overexposed is not really. so you can push it another stop or more. on my 550D i can push it up to 2 stops more and recover highlights that it says are totally blown.

 
In fact I think the technology to expose the
sensor for a fixed period of time and then count the photons is silly.
What would be much more sensible is measuring the time it takes each
cell to reach saturation. When the exposure is finally stopped, those
cells which aren't full can still be photon-counted to define the
shadows. Store the result in a floating point format and you end up
with a truly HDR raw image without any fuss and then you can proceed
by exposure-blending different versions of it instead of the
cumbersome tone-mapping. I wonder if that's technically feasible, but
why not?


Heh, I wondered this 6 years ago ;-)
http://www.panotools.org/mailarchive/msg/34821#msg34821
maybe such ideas are easy when you're not building the sensors? ;-)) I don't know! It sure seems like a perfect idea.... :) 

BTW I had a chance to use a Leaf back on a mamiya 645DF. 16 bits of color per channel. amazing! not your casual pocket camera though :)

Gnome Nomad

unread,
Jul 28, 2011, 4:39:15 AM7/28/11
to hugi...@googlegroups.com
Jeffrey Martin wrote:
> On Wednesday, July 27, 2011 11:05:41 AM UTC+2, kfj wrote:
>
> On 27 Jul., 09:28, Jeffrey Martin <360c...@gmail.com> wrote:
>
> > Personally i've had the best results using +1.5 and -0.5 exposure
> derived
> > from a single raw file.
>
> Differently processed single raw files are perfect source material -
> if the scene can be captured with the dynamic range available. I don't
> know what you have, but my sensor's dynamic range is somewhere in the
> 12 to 14 bit range, and my landscapes sometimes just don't fit into
> that. I wish they would.
>
>
> careful of histogram on canon - it is a histogram from the jpeg, even
> when shooting raw. what is overexposed is not really. so you can push it
> another stop or more. on my 550D i can push it up to 2 stops more and
> recover highlights that it says are totally blown.

Get to know the CCD chip in your camera. I don't know which CCD Canon
uses. In my Maxxum 7D, the CCD easily blows highlights.

kfj

unread,
Jul 28, 2011, 7:53:11 AM7/28/11
to hugin and other free panoramic software
On 28 Jul., 09:39, Jeffrey Martin <360cit...@gmail.com> wrote:

> careful of histogram on canon - it is a histogram from the jpeg, even when
> shooting raw. what is overexposed is not really. so you can push it another
> stop or more. on my 550D i can push it up to 2 stops more and recover
> highlights that it says are totally blown.

I wonder if this is the full story. When I look at the images, I use
digiKam initially. It shows me blown highlights and I can recover them
to an extent (I do not know the precise magic they use, but I suppose
it's using the fact that one colour channel gets saturated first and
you can extrapolate it's intensity looking at the other channels for
that pixel) digiKam has no reason to tell me something is blown when
it isn't - it processes in 16 bit (at least I believe it does). When
it comes to Canon, you can tell the body to work in 'highlight tone
priority' mode. Initially I used that, but I found out that all it
does is artificially underexpose your images by one stop or so, so you
can 'recover' later. I now prefer to expose on the conservative side
and so protect myself against blown highlights.

I suppose my 450D isn't too far from a 550D, but I'll nevertheless do
a couple of test shots to see if I can also recover two stops from
what it reckons is blown. What raw converter do you use?

> > In fact I think the technology to expose the
> > sensor for a fixed period of time and then count the photons is silly.
> > ...

> Heh, I wondered this 6 years ago ;-)
> http://www.panotools.org/mailarchive/msg/34821#msg34821

So did I, I just never told anyone...

> maybe such ideas are easy when you're not building the sensors? ;-)) I don't
> know! It sure seems like a perfect idea.... :)

We can still dream. And sometimes progress in technology comes from
outsiders or fringe people because they have more freedom to think off
the beaten track and sometimes have knowledge from other fields that
the specialists they are 'infringing upon' lack.

> BTW I had a chance to use a Leaf back on a mamiya 645DF. 16 bits of color
> per channel. amazing! not your casual pocket camera though :)

Lucky you. But I'm confident it won't be long until even your mobile
phone will do 32 bit floating point HDR shots...

I started wondering about the possibilities of stitching individual
images into a larger pictuer in the late 80s, working on 512X512
grayscale frames from a frame grabber attached to a video microscope.
I had a 286 processor (and, wow, a 287 coprocessor). Things took a
long while... such a long while that eventually I gave up on video
microscopy and trying to make sense of the images and turned to other
topics. Many years later I got my first digital camera, and it could
do 2048X1536 in 8 bit RGB! And I found autostitch somewhere. Was I
happy. Time taught me to rather than try and force something in a
bleeding edge technology waiting a few years often does the trick ;)

Kay

Yuval Levy

unread,
Jul 29, 2011, 1:31:31 AM7/29/11
to hugi...@googlegroups.com
On July 27, 2011 05:05:41 AM kfj wrote:
> measuring the time-to-satuartion for the cells.

> Wonder if anyone thought of that?

http://www.google.com/patents/about?id=MkDJAAAAEBAJ&dq=measure+time+to+saturation+%2Bphotography

coming to a camera in your neighborhood photo shop in 17 years?

Yuv

signature.asc

kfj

unread,
Jul 29, 2011, 3:41:40 AM7/29/11
to hugin and other free panoramic software


On 29 Jul., 07:31, Yuval Levy <goo...@levy.ch> wrote:
> On July 27, 2011 05:05:41 AM kfj wrote:
>
> > measuring the time-to-satuartion for the cells.
> > Wonder if anyone thought of that?
>
> http://www.google.com/patents/about?id=MkDJAAAAEBAJ&dq=measure+time+t...
>
> coming to a camera in your neighborhood photo shop in 17 years?

Why 17? I thought what usually happens is that a novel patent is
bought up by the established industry and made available by licensing
terms which make sure it's never used. By the time the patent expires,
it's obsolete, because some much cleverer way has been found to
achieve the desired effect, but the established industry has managed
to sell another few billions of the stuff they made.

Kay

Jeffrey Martin

unread,
Jul 29, 2011, 3:43:09 AM7/29/11
to hugi...@googlegroups.com


On Thursday, July 28, 2011 1:53:11 PM UTC+2, kfj wrote:
On 28 Jul., 09:39, Jeffrey Martin <360c...@gmail.com> wrote:

I suppose my 450D isn't too far from a 550D, but I'll nevertheless do
a couple of test shots to see if I can also recover two stops from
what it reckons is blown. What raw converter do you use?


i use photoshop (adobe camera raw)

Lukáš Jirkovský

unread,
Jul 29, 2011, 5:25:30 AM7/29/11
to hugi...@googlegroups.com
On 28 July 2011 13:53, kfj <_k...@yahoo.com> wrote:
> I suppose my 450D isn't too far from a 550D, but I'll nevertheless do
> a couple of test shots to see if I can also recover two stops from
> what it reckons is blown. What raw converter do you use?

You may want to take a look at rawtherapee 3.x. It can do a very good
job at restoring the highligths. I was able to get this [1] while the
in camera jpeg looks like this [2] using the method described at [3].
It still has some ugly magenta tint in some places but still rt was
able to restore incredible number of detail.

[1] http://blender6xx.ic.cz/pub/_MG_2054.jpg
[2] http://blender6xx.ic.cz/pub/_MG_2054.thumb.jpg
[3] http://rawtherapee.com/forum/viewtopic.php?t=2907

Lukas

kfj

unread,
Jul 29, 2011, 8:09:24 AM7/29/11
to hugin and other free panoramic software


On 29 Jul., 11:25, Lukáš Jirkovský <l.jirkov...@gmail.com> wrote:
>
> You may want to take a look at rawtherapee 3.x. It can do a very good
> job at restoring the highligths. I was able to get this [1] while the
> in camera jpeg looks like this [2] using the method described at [3].
> It still has some ugly magenta tint in some places but still rt was
> able to restore incredible number of detail.

Raw Therapee is too immature for my taste. The concept is really nice
and I've tried it again and again for the past couple of years or so,
but on my system it just hogs resources, takes forever and eventually
crashes for no reason at some unforseen point. Furthermore I can't do
[3] since my current version of Raw Therapee [3.01 alpha 1] does not
have a 'RAW' tab. I use up all my masochism using and programming for
hugin ;-) I'll give it a while and once it says it's something like
3.2 final I'll give it a good long try again. Am I too impatient?

As far as I can see from what I get (before it crashes) blown is
blown. If the sensor limit is hit there just isn't anything you can
do.

Kay

Gnome Nomad

unread,
Jul 29, 2011, 3:29:27 PM7/29/11
to hugi...@googlegroups.com
kfj wrote:
>
> On 29 Jul., 11:25, Lukáš Jirkovský <l.jirkov...@gmail.com> wrote:
>> You may want to take a look at rawtherapee 3.x. It can do a very good
>> job at restoring the highligths. I was able to get this [1] while the
>> in camera jpeg looks like this [2] using the method described at [3].
>> It still has some ugly magenta tint in some places but still rt was
>> able to restore incredible number of detail.
>
> Raw Therapee is too immature for my taste. The concept is really nice
> and I've tried it again and again for the past couple of years or so,
> but on my system it just hogs resources, takes forever and eventually
> crashes for no reason at some unforseen point.

Odd, works flawlessly here.

> Furthermore I can't do
> [3] since my current version of Raw Therapee [3.01 alpha 1] does not
> have a 'RAW' tab. I use up all my masochism using and programming for
> hugin ;-) I'll give it a while and once it says it's something like
> 3.2 final I'll give it a good long try again. Am I too impatient?
>
> As far as I can see from what I get (before it crashes) blown is
> blown. If the sensor limit is hit there just isn't anything you can
> do.

That is true. "Highlight recovery" works by using the extra bit depth
(12) of the RAW image to try to come up with an approximate 8-bit color.
The sensor in my Minolta is very quick to blow highlights, and highlight
recovery doesn't work very well, if at all.

Reply all
Reply to author
Forward
0 new messages