10
@setfilename enfuse.info
11
@include versenfuse.texi
12
@settitle Fusing Multiple Images with Enfuse @value{VERSION}
14
@include varsenfuse.texi
15
@include config-h.texi
17
@set default-image-cache-cachesize 1024@dmn{MB}
18
@set default-image-cache-blocksize 2048@dmn{KB}
20
@c Define a new index for syntactic comments.
22
@c Define a new index for options.
28
@c Categorization for the GNU Info System
31
@dircategory Individual utilities
34
* enfuse: (enfuse). Fuse images using a multiresolution spline.
39
@c Summary Description and Copyright
43
This manual is for Enfuse (version @value{VERSION}, @value{UPDATED}),
44
a program to merge different exposures of the same scene to produce an
45
image that looks much like a tonemapped image.
47
Copyright @copyright{} 2004--2012 @sc{Andrew Mihal}.
50
Permission is granted to copy, distribute and/or modify this document
51
under the terms of the @acronym{GNU} Free Documentation License,
52
Version 1.2 or any later version published by the Free Software
53
Foundation; with no Invariant Sections, no Front-Cover Texts and no
54
Back-Cover Texts. A copy of the license is included in the section
55
entitled ``@acronym{GNU} Free Documentation License''.
61
@c Title Page and Copyright
66
@subtitle Fusing Multiple Images
67
@subtitle with Enfuse version @value{VERSION}, @value{UPDATED}
83
@c For the TeX output the List-of-Tables and List-of-Figures appear
84
@c right after the Table-of-Contents. In all other formats they go
85
@c right before the indices.
87
@c Adjust page number so that we get roman numerals for the
88
@c List-of-Tables and List-of-Figures. This screws up Texinfo's page
89
@c count so that we must undo it later.
94
@unnumbered List of Tables
98
@unnumbered List of Figures
104
@c ``Top'' Node and Master Menu
111
This manual is for Enfuse (version@tie{}@value{VERSION},
112
@value{UPDATED}), a program to merge different exposures of the same
113
scene to produce an image that looks much like a tonemapped image.
117
* Overview:: Overview of Enfuse's features
118
* Workflow:: Enfuse's role in combining images
119
* Invocation:: Command line options and arguments
120
* Color Profiles:: How Enblend handles @acronym{ICC} color profiles
121
* Weighting Functions:: Description of all weighting functions
122
* Understanding Masks:: How to interpret masks and mask files
123
* Tuning Memory Usage:: Balancing @acronym{RAM} and swap
124
* Applications:: Possible applications of Enfuse
125
* Helpful Programs:: Useful other programs
126
* Bug Reports:: How to write bug reports
127
* Authors:: Major contributors
128
* FDL:: @acronym{GNU} Free Documentation License
130
* List of Tables:: List of all tables
131
* List of Figures:: List of all figures
132
* Program Index:: Names of programs referenced
133
* Syntactic-Comment Index:: Keys of syntactic comments
134
* Option Index:: Index of all options
135
* General Index:: Topic index
140
--- The Detailed Node Listing ---
146
* Standard Workflow:: The usual, all-in-one thing
147
* External Mask Manipulation:: Fiddling around with the masks yourself
152
* Common Options:: General options
153
* Extended Options:: Memory control and others
154
* Fusion Options:: Image fusion control
155
* Expert Options:: Local contrast and local entropy selection configuration
156
* Option Delimiters:: How to separate options' arguments
162
* Weighting Pixels:: General concept of weighting pixels
163
* Exposure Weighting:: Weighting by exposure
164
* Saturation Weighting:: Weighting by saturation
165
* Local Contrast Weighting:: Weighting by local contrast
166
* Local Entropy Weighting:: Weighting by local entropy
170
* Weighted Average:: Enfuse's default weighting algorithm
171
* Disabling Averaging:: ``Super Trouper'' weighting for focus stacks
173
Local Contrast Weighting
175
* Standard Deviation:: Standard deviation (@acronym{SDev}) in a square of pixels
176
* Laplacian of Gaussian:: @acronym{LoG}, a second derivative method
177
* Blend SDev and LoG:: Mix both methods
178
* Scaling and Choice of Mode:: How parameters do not scale; neither does mode
186
* What Images:: What makes images fusable?
187
* Repetition:: Just taking the same shot multiple times
188
* Exposure Series:: Varying the exposure time
189
* Flash Exposure Series:: Varying the flash output
190
* Polarization Series:: Changing the polarizer angle
191
* Focus Stacks:: Stacking images with different in-focus distance
195
* Exposure Series Tips:: Some hints for beginners
196
* Exposure Series Misconceptions:: What works despite the hype
200
* Why Focus Stacks:: Why take the hassle?
201
* Preparing Focus Stacks:: How to get suitable input images
202
* Local Contrast Based Fusing:: Fundamental command line options
203
* Basic Focus Stacking:: Simple, standard deviation method
204
* Advanced Focus Stacking:: Advanced, Laplacian technique
205
* Expert Stacking:: Tips for focus stacking experts
207
Advanced Focus Stacking
209
* Local Contrast Problem:: What is the problem Kenneth?
210
* Laplacian Edge Detection:: Using a Laplacian-of-Gaussian to detect edges
211
* Local Contrast Enhancement:: Boosting local contrast before weighting
212
* Suppressing Noise or Recognizing Faint Edges:: The best of both worlds
213
* Focus Stacking Decision Tree:: What to do and how to fuse
233
@c Undo the roman page numbering we used for the Table-of-Contents,
234
@c the List-of-Tables, and the List-of-Figures.
241
@cindex Mertens-Kautz-Van Reeth exposure fusion
242
Enfuse merges overlapping images using the
243
@sc{Mertens}-@sc{Kautz}-@sc{Van Reeth} exposure fusion
244
algorithm.@footnote{Tom Mertens, Jan Kautz, and Frank van Reeth,
245
``Exposure Fusion'', Proceedings of the 15th Pacific Conference on
246
Computer Graphics and Applications, pages 382--390.} This is a quick
247
way for example to blend differently exposed images into a nice output
248
image, without producing intermediate high-dynamic range
249
(@acronym{HDR}) images that are then tonemapped to a viewable image.
250
This simplified process often works much better than tonemapping
253
Enfuse can also be used to build extended depth-of-field
254
(@acronym{DOF}) images by blending a focus stack.
256
The idea is that pixels in the input images are weighted according to
257
qualities such as, for example, proper exposure, good local contrast,
258
or high saturation. These weights determine how much a given pixel
259
will contribute to the final image.
261
@cindex Burt-Adelson multiresolution spline
262
A @sc{Burt}-@sc{Adelson} multiresolution spline blender@footnote{Peter
263
J. Burt and Edward H. Adelson, ``A Multiresolution Spline With
264
Application to Image Mosaics'', @acronym{ACM} Transactions on
265
Graphics, @abbr{Vol@.} 2, @abbr{No@.} 4, October 1983, pages
266
217--236.} is used to combine the images according to the weights.
267
The multiresolution blending ensures that transitions between regions
268
where different images contribute are difficult to spot.
270
Enfuse uses up to four criteria to judge the quality of a pixel, which
271
@ref{Table:weighting-criteria} briefly describes.
273
@float Table,Table:weighting-criteria
275
@dbtitle{Weighting Criteria}
277
@cindex weighting, exposure
278
The exposure criteria favors pixels with luminance close to the middle
279
of the range. These pixels are considered better exposed than those
280
with high or low luminance levels.
283
@cindex weighting, saturation
284
The saturation criteria favors highly-saturated pixels. (Note that
285
saturation is only defined for color pixels.)
288
@cindex weighting, local contrast
289
The contrast criteria favors pixels inside a high-contrast
290
neighborhood. Enfuse can use standard deviation, Laplacian magnitude,
291
or a blend of both as local contrast measure.
294
@cindex weighting, local entropy
295
The entropy criteria prefers pixels inside a high-entropy
296
neighborhood. In addition, Enfuse allows the user to mitigate the
297
problem of noisy images when using entropy weighting by setting a
301
@caption{Enfuse's four weighting criteria. (Also see @ref{Table:default-weights} for the default weights of these criteria.)}
303
@shortcaption{Weighting criteria}
306
For the concept of pixel weighting, and details on the different
307
weighting functions, see @ref{Weighting Functions}.
309
Adjust how much importance is given to each criterion by setting the
310
weight parameters on the command line. For example, if you set
311
@samp{--exposure-weight=1.0} and @samp{--saturation-weight=0.5},
312
Enfuse will favor well-exposed pixels over highly-saturated pixels
313
when blending the source images. The effect of these parameters on
314
the final result will not always be clear in advance. The quality of
315
the result is subject to your artistic interpretation. Playing with
316
the weights may or may not give a more pleasing result. The authors
317
encourage you to experiment, perhaps using
318
down-sized@footnote{Downsampling with a good interpolator reduces
319
noise, which might not desired to judge the image quality of the
320
original-size image. Cropping might be an alternative, though.} or
321
cropped images for speed.
323
@cindex alpha channel
324
@cindex channel, alpha
325
Enfuse expects but does not require each input image to have an alpha
326
channel. By setting the alpha values of pixels to zero, users can
327
manually remove those pixels from consideration when blending. If an
328
input image lacks an alpha channel, Enfuse will issue a warning and
329
continue assuming all pixels should contribute to the final output.
330
Any alpha value other than zero is interpreted as ``this pixel should
331
contribute to the final image''.
333
@cindex multi-layer image
334
@cindex image, multi-layer
335
@cindex multi-directory @acronym{TIFF}
336
@cindex @acronym{TIFF}, multi-directory
337
@cindex @command{tiffcopy}
338
@cindex @command{tiffsplit}
339
Enfuse reads all layers of multi-layer images, like, for example,
340
multi-directory @acronym{TIFF} images@footnote{Use utilities like,
341
e.g., @command{tiffcopy} and @command{tiffsplit} of LibTIFF to
342
manipulate multi-directory @acronym{TIFF} images. @xref{Helpful
343
Programs}.}. The input images are processed in the order they appear
344
on the command line. Multi-layer images are processed from the first
345
layer to the last before Enfuse considers the next image on the
349
Find out more about Enfuse on its @uref{http://@/sourceforge.net/,
350
SourceForge} @uref{http://@/enblend.sourceforge.net/, web page}.
357
Enfuse is a part of a chain of tools to assemble images. It merges
358
photos of the same subject at the same location and same direction,
359
but taken with varying exposure parameters.
362
* Standard Workflow:: The usual, all-in-one thing
363
* External Mask Manipulation:: Fiddling around with the masks yourself
367
@node Standard Workflow
368
@section Standard Workflow
369
@cindex workflow, standard
371
@include workflow.texi
374
@node External Mask Manipulation
375
@section External Mask Manipulation
376
@cindex workflow, external mask manipulation
378
@include external-masks.texi
385
@command{enfuse} [@var{OPTIONS}] [@code{--output=}@var{IMAGE}]
386
@var{INPUT}@enddots{}
389
Fuse the sequence of images @var{INPUT}@dots{} into a single
392
@cindex literal filename
393
@cindex filename, literal
394
@cindex response file
395
Input images are either specified literally or via so-called response
396
files (see below). The latter are an alternative to specifying image
397
filenames on the command line.
401
* Image Requirements:: Input image requirements
402
* Response Files:: Files listing the images' names
403
* Common Options:: General options
404
* Extended Options:: Memory control and others
405
* Fusion Options:: Image fusion control
406
* Expert Options:: Local contrast and local entropy selection configuration
407
* Option Delimiters:: How to separate options' arguments
411
@node Image Requirements
412
@section Image Requirements
413
@cindex input image requirements
415
All input images must comply with the following requirements.
422
The images agree on their number of bits-per-channel, this is, their
435
See option@tie{}@option{--depth} below for an explanation of different
439
Enfuse understands the images' filename extensions as well as their
442
You can check the supported extensions and formats by calling Enfuse
443
with the option pair @option{--version@tie{}--verbose} and scan the
444
output for @samp{Supported image formats} or @samp{Supported file
448
Moreover, there are some ``good practices'', which are not enforced by
449
the application, but almost certainly deliver superior results.
453
Either all files lack an @acronym{ICC} profile, or all images are
454
supplied with the @emph{same} @acronym{ICC} profile.
457
If the images' meta-data contains resolution information
458
(``@acronym{DPI}''), it is the same for all pictures.
463
@section Response Files
464
@cindex response file
466
@include filespec.texi
470
@section Common Options
471
@cindex options, common
473
Common options control some overall features of Enfuse.
475
Enfuse accepts arguments to any option in uppercase as well as in
476
lowercase letters. For example, @samp{deflate}, @samp{Deflate} and
477
@samp{DEFLATE} as arguments to the @code{--compression} option
478
described below, all instruct Enfuse to use the @sc{Deflate}
479
compression scheme. This manual denotes all arguments in lowercase
483
@item --compression=@var{COMPRESSION}
484
@opindex --compression
485
@cindex output file compression
487
Write a compressed output file.
489
Depending on the output file format, Enfuse accepts different values
490
for @var{COMPRESSION}.
493
@item @acronym{JPEG} format.
494
@cindex @acronym{JPEG} compression
495
@cindex compression, @acronym{JPEG}
497
The compression either is a literal integer or a keyword-option
502
Set @acronym{JPEG} quality@tie{}@var{LEVEL}, where @var{LEVEL} is an
503
integer that ranges from 0--100.
505
@item jpeg[:@var{LEVEL}]
506
Same as above; without the optional argument just switch on (standard)
507
@acronym{JPEG} compression.
509
@item jpeg-arith[:@var{LEVEL}]
510
@cindex arithmetic @acronym{JPEG} compression
511
@cindex compression, arithmetic @acronym{JPEG}
512
Switch on arithmetic @acronym{JPEG} compression. With optional
513
argument set the arithmetic compression@tie{}@var{LEVEL}, where
514
@var{LEVEL} is an integer that ranges from 0--100.
517
@item @acronym{TIF} format.
518
Here, @var{COMPRESSION} is one of the keywords:
522
Do not compress. This is the default.
525
@cindex deflate compression
526
@cindex compression, deflate
527
Use the @sc{Deflate} compression scheme also called
528
@acronym{ZIP}-in-@acronym{TIFF}. @sc{Deflate} is a lossless data
529
compression algorithm that uses a combination of the @acronym{LZ77}
530
algorithm and @sc{Huffman} coding.
532
@item jpeg[:@var{LEVEL}]
533
@cindex compression, @acronym{JPEG}
534
Use @acronym{JPEG} compression. With optional argument set the
535
compression@tie{}@var{LEVEL}, where @var{LEVEL} is an integer that
539
@cindex @acronym{LZW} compression
540
@cindex compression, @acronym{LZW}
541
Use @sc{Lempel}-@sc{Ziv}-@sc{Welch} (@acronym{LZW}) adaptive
542
compression scheme. @acronym{LZW} compression is lossless.
545
@cindex packbits compression
546
@cindex compression, packbits
547
Use @sc{PackBits} compression scheme. @sc{PackBits} is a particular
548
variant of run-length compression; it is lossless.
551
@item Any other format.
552
Other formats do not accept a @var{COMPRESSION} setting.
554
However, @uref{http://@/hci.iwr.uni-@/heidelberg.de/@/vigra/,
555
@acronym{VIGRA}} automatically compresses @file{png}-files with the
559
@item --layer-selector=@var{ALGORITHM}
560
@opindex --layer-selector
561
@cindex layer selection
562
@cindex layer selection
563
Override the standard layer selector algorithm, which is
564
@samp{@value{src::layer-selector}}.
566
This version of Enfuse offers the following algorithms:
569
@cindex layer selection, all-layers
570
Select all layers in all images.
573
@cindex layer selection, first-layer
574
Select only first layer in each multi-layer image. For single-layer
575
images this is the same as @samp{all-layers}.
578
@cindex layer selection, largest-layer
579
Select largest layer in each multi-layer image, where the
580
``largeness'', this is the size is defined by the product of the layer
581
width and its height. The channel width of the layer is ignored. For
582
single-layer images this is the same as @samp{all-layers}.
585
@cindex layer selection, no layer
586
Do not select any layer in any image.
588
This algorithm is useful to temporarily exclude some images in
596
Print information on the available options and exit.
598
@item -l @var{LEVELS}
599
@itemx --levels=@var{LEVELS}
602
@cindex pyramid levels
603
@cindex levels, pyramid
604
Use at most this many @var{LEVELS} for pyramid @footnote{As
605
Dr.@tie{}Daniel Jackson correctly
606
@uref{http://stargate.wikia.com/@/wiki/@/The_@/Tomb, noted}, actually,
607
it is not a pyramid: ``Ziggaurat, it's a
608
@uref{http://en.wikipedia.org/@/wiki/@/Ziggaurat, Ziggaurat}.''}
609
blending if @var{LEVELS} is positive, or reduce the maximum number of
610
levels used by @minus{}@var{LEVELS} if @var{LEVELS} is negative;
611
@samp{auto} or @samp{automatic} restore the default, which is to use
612
the maximum possible number of levels for each overlapping region.
614
The number of levels used in a pyramid controls the balance between
615
local and global image features (contrast, saturation, @dots{}) in the
616
blended region. Fewer levels emphasize local features and suppress
617
global ones. The more levels a pyramid has, the more global features
618
will be taken into account.
620
As a guideline, remember that each new level works on a linear scale
621
twice as large as the previous one. So, the zeroth layer, the
622
original image, obviously defines the image at single-pixel scale, the
623
first level works at two-pixel scale, and generally, the @math{n}-th
624
level contains image data at @power{2, n}-pixel scale. This is the
625
reason why an image of
626
@math{width}@classictimes{}@/@math{height}@dmn{pixels} cannot be
627
deconstructed into a pyramid of more than
630
@math{floor(log_2(min(width, height)))}
634
<mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline">
642
<mo>⁡</mo>
646
<mo>⁡</mo>
648
<mi mathvariant="italic">width</mi>
649
<mi mathvariant="italic">height</mi>
654
<mo>⌋</mo>
659
$\lfloor \log_2(\min(\mathit{width}, \mathit{height})) \rfloor$
674
<mml:mi mathvariant="italic">width</mml:mi>
677
<mml:mi mathvariant="italic">height</mml:mi>
683
</inlineequation>
687
If too few levels are used, ``halos'' around regions of strong local
688
feature variation can show up. On the other hand, if too many levels
689
are used, the image might contain too much global features. Usually,
690
the latter is not a problem, but is highly desired. This is the
691
reason, why the default is to use as many levels as is possible given
692
the size of the overlap regions. Enfuse may still use a smaller
693
number of levels if the geometry of the overlap region demands.
695
Positive values of @var{LEVELS} limit the maximum number of pyramid
696
levels. Depending on the size and geometry of the overlap regions
697
this may or may not influence any pyramid. Negative values of
698
@var{LEVELS} reduce the number of pyramid levels below the maximum no
699
matter what the actual maximum is and thus always influence all
700
pyramids. Use @samp{auto} or @samp{automatic} as @var{LEVELS} to
701
restore the automatic calculation of the maximum number of levels.
703
The valid range of the absolute value of @var{LEVELS} is
704
@value{src::minimum-pyramid-levels} to
705
@value{src::maximum-pyramid-levels}.
708
@itemx --output=@var{FILE}
711
Place output in @var{FILE}.
713
@cindex @file{@value{src::default-output-filename}}
714
@cindex default output filename
715
@cindex output filename, default
716
If @option{--output} is not specified, the default is to put the
717
resulting image in @file{@value{src::default-output-filename}}.
719
@item --parameter=@var{KEY}[=@var{VALUE}]:@dots{}
720
Set a @var{KEY}-@var{VALUE} pair, where @var{VALUE} is optional. This
721
option is cumulative. Separate multiple pairs with the usual numeric
724
This option has the negated form @option{--no-parameter},
725
@opindex --no-parameter
726
which takes one or more @var{KEY}s and removes them from the list of
727
defined parameters. The special key@tie{}@samp{*} deletes all
730
Parameters allow the developers to change the internal
731
workings of Enfuse without the need to recompile.
734
@itemx --verbose[=@var{LEVEL}]
737
Without an argument, increase the verbosity of progress reporting.
738
Giving more @option{--verbose}@tie{}options will make Enfuse more
739
verbose. Directly set a verbosity level with a non-negative integral
742
Each level includes all messages of the lower levels.
749
only warnings and errors
752
reading and writing of images
755
mask generation, pyramid, and blending
758
reading of response files, color conversions
761
image sizes, bounding boxes and intersection sizes
764
detailed information on the optimizer runs (Enblend only)
767
estimations of required memory in selected processing steps
770
The default verbosity level of Enfuse is
771
@value{src::default-verbosity-level}.
777
Output information on the Enfuse version.
779
Team this option with @option{--verbose} to show configuration
780
details, like the extra features that have been compiled in.
783
@itemx --wrap=@var{MODE}
786
@cindex 360@textdegree{} panoramas
788
Blend around the boundaries of the panorama.
790
As this option significantly increases memory usage and computation
791
time only use it, if the panorama will be
795
consulted for any kind measurement, this is, all boundaries must match
796
as accurately as possible, or
799
printed out and the boundaries glued together, or
802
@cindex virtual reality
803
fed into a virtual reality (@abbr{VR}) generator, which creates a
804
seamless environment.
807
Otherwise, always avoid this option!
809
With this option, Enfuse treats the panorama of width@tie{}@math{w}
810
and height@tie{}@math{h} as an infinite data structure, where each
811
pixel@tie{}@math{P(x, y)} of the input images represents the set of
817
<mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline">
849
@footnote{Solid-state physicists will be reminded of the
850
@uref{http://@/en.wikipedia.org/@/wiki/@/Born-@/von_@/Karman_@/boundary_@/condition,
851
@sc{Born}-@sc{von@tie{}K@'arm@'an} boundary condition}.}.
853
@var{MODE} takes the following values:
858
This is a ``no-op''; it has the same effect as not giving
859
@option{--wrap} at all. The set of input images is considered open at
863
Wrap around horizontally:
866
@math{S_P(x, y) = @{P(x + m * w, y): m in Z@}.}
870
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
890
<mo>⁢</mo>
899
<mtext>  in  </mtext>
910
S_P(x, y) = \{P(x + m w, y): m \in Z\}.
957
This is useful for 360@textdegree{} horizontal panoramas as it
958
eliminates the left and right borders.
961
Wrap around vertically:
964
@math{S_P(x, y) = @{P(x, y + n * h): m in Z@}.}
968
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
989
<mo>⁢</mo>
997
<mtext>  in  </mtext>
1008
S_P(x, y) = \{P(x, y + n h): n \in Z\}.
1012
This is useful for 360@textdegree{} vertical panoramas, as it
1013
eliminates the top and bottom borders.
1016
@itemx horizontal+vertical
1017
@itemx vertical+horizontal
1018
Wrap around both horizontally and vertically:
1021
@math{S_P(x, y) = @{P(x + m * w, y + n * h): m, n in Z@}.}
1025
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
1045
<mo>⁢</mo>
1052
<mo>⁢</mo>
1064
<mtext>  in  </mtext>
1075
S_P(x, y) = \{P(x + m w, y + n h): m, n \in Z\}.
1138
In this mode, both left and right borders, as well as top and bottom
1139
borders, are eliminated.
1142
Specifying @option{--wrap} without @var{MODE} selects horizontal
1147
@node Extended Options
1148
@section Extended Options
1149
@cindex options, extended
1151
Extended options control the image cache, the color model, and the
1152
cropping of the output image.
1155
@item -b @var{BLOCKSIZE}
1157
@cindex image cache, block size
1158
Set the @var{BLOCKSIZE} in kilobytes (@acronym{KB}) of Enfuse's image
1161
This is the amount of data that Enfuse will move to and from the disk
1162
at one time. The default is @value{default-image-cache-blocksize},
1163
which should be ok for most systems. See @ref{Tuning Memory Usage}
1166
Note that Enfuse must have been compiled with the image-cache feature
1167
for this option to be effective. Find out about extra features with
1168
@code{enfuse --version --verbose}.
1174
@cindex color appearance model
1175
@cindex @acronym{CIECAM02}
1176
Force the use of the @acronym{CIECAM02} color appearance model for
1177
blending colors instead of blending inside the @acronym{RGB} color
1180
@cindex color profile
1181
@cindex @acronym{ICC} profile
1182
@cindex profile, @acronym{ICC}
1183
@cindex @acronym{sRGB} color space
1184
@cindex color space, @acronym{sRGB}
1185
All input files should have identical @acronym{ICC} profiles when this
1186
option is specified. If no @acronym{ICC} profile is present, Enfuse
1187
assumes that all images use the @acronym{sRGB} color space.
1188
@xref{Color Profiles}.
1190
Please keep in mind that using @acronym{CIECAM02} blending may change
1191
the colors in the output image.
1193
This option can be negated; see option@tie{}@option{--no-ciecam}
1197
@itemx --depth=@var{DEPTH}
1200
@cindex bits per channel
1201
@cindex channel width
1202
Force the number of bits per channel and the numeric format of the
1205
Enfuse always uses a smart way to change the channel depth, to assure
1206
highest image quality (at the expense of memory), whether
1207
requantization is implicit because of the output format or explicit
1208
with option@tie{}@option{--depth}.
1212
If the output-channel width is larger than the input-channel width of
1213
the input images, the input images' channels are widened to the output
1214
channel width immediately after loading, that is, as soon as possible.
1215
Enfuse then performs all blending operations at the output-channel
1216
width, thereby preserving minute color details which can appear in the
1220
If the output-channel width is smaller than the input-channel width of
1221
the input images, the output image's channels are narrowed only right
1222
before it is written to disk, that is, as late as possible. Thus the
1223
data benefits from the wider input channels for the longest time.
1226
All @var{DEPTH} specifications are valid in lowercase as well as
1227
uppercase letters. For integer format, use
1230
@item @code{8}, @code{uint8}
1231
Unsigned 8@dmn{bit}; range: 0..255
1233
Signed 16@dmn{bit}; range: @minus{}32768..32767
1234
@item @code{16}, @code{uint16}
1235
Unsigned 16@dmn{bit}; range: 0..65535
1237
Signed 32@dmn{bit}; range: @minus{}2147483648..2147483647
1238
@item @code{32}, @code{uint32}
1239
Unsigned 32@dmn{bit}; range: 0..4294967295
1242
For floating-point format, use
1244
@c Minimum positive normalized value: 2^(2 - 2^k)
1245
@c Epsilon: 2^(1 - n)
1246
@c Maximum finite value: (1 - 2^(-n)) * 2^(2^k)
1249
@c IEEE single: 32 bits, n = 24, k = 32 - n - 1 = 7
1250
@item @code{r32}, @code{real32}, @code{float}
1251
@cindex @acronym{IEEE754} single precision float
1252
@cindex single precision float, @acronym{IEEE754}
1253
@acronym{IEEE754} single precision floating-point, 32@dmn{bit} wide,
1254
24@dmn{bit} significant
1258
Minimum normalized value: @semilog{1.2, -38}
1260
Epsilon: @semilog{1.2, -7}
1262
Maximum finite value: @semilog{3.4, 38}
1265
@c IEEE double: 64 bits, n = 53, k = 64 - n - 1 = 10
1266
@item @code{r64}, @code{real64}, @code{double}
1267
@cindex @acronym{IEEE754} double precision float
1268
@cindex double precision float, @acronym{IEEE754}
1269
@acronym{IEEE754} double precision floating-point, 64@dmn{bit} wide,
1270
53@dmn{bit} significant
1274
Minimum normalized value: @semilog{2.2, -308}
1276
Epsilon: @semilog{2.2, -16}
1278
Maximum finite value: @semilog{1.8, 308}
1282
If the requested @var{DEPTH} is not supported by the output file
1283
format, Enfuse warns and chooses the @var{DEPTH} that matches best.
1285
@cindex @acronym{OpenEXR}, data format
1286
The @acronym{OpenEXR} data format is treated as
1287
@acronym{IEEE754}@tie{}float internally. Externally, on disk,
1288
@acronym{OpenEXR} data is represented by ``half'' precision
1289
floating-point numbers.
1291
@c ILM half: 16 bits, n = 10, k = 16 - n - 1 = 5
1292
@cindex @acronym{OpenEXR}, half precision float
1293
@cindex half precision float, @acronym{OpenEXR}
1294
@uref{http://@/www.openexr.com/@/about.html#@/features,
1295
@acronym{OpenEXR}} half precision floating-point, 16@dmn{bit} wide,
1296
10@dmn{bit} significant
1300
Minimum normalized value: @semilog{9.3, -10}
1302
Epsilon: @semilog{2.0, -3}
1304
Maximum finite value: @semilog{4.3, 9}
1307
@item -f @var{WIDTH}x@var{HEIGHT}
1308
@itemx -f @var{WIDTH}x@var{HEIGHT}+x@var{XOFFSET}+y@var{YOFFSET}
1310
@cindex output image, set size of
1312
@cindex size, canvas
1313
Ensure that the minimum ``canvas'' size of the output image is at
1314
least @var{WIDTH}@classictimes{}@/@var{HEIGHT}. Optionally specify
1315
the @var{XOFFSET} and @var{YOFFSET}, too.
1317
@pindex nona @r{(Hugin)}
1319
This option only is useful when the input images are cropped
1320
@acronym{TIFF} files, such as those produced by
1321
@command{nona}@footnote{The stitcher @command{nona} is part of Hugin.
1322
@xref{Helpful Programs}.}.
1324
Note that option@tie{}@option{-f} neither rescales the output image,
1325
nor shrinks the canvas size below the minimum size occupied by the
1326
union of all input images.
1328
@item --fallback-profile=@var{PROFILE-FILENAME}
1329
@opindex --fallback-profile
1330
@cindex profile, fallback
1331
@cindex fallback profile
1332
@cindex @acronym{CIECAM02}
1333
Use the @acronym{ICC} profile in @var{PROFILE-FILENAME} instead of the
1334
default @acronym{sRGB}. See option@tie{}@option{--ciecam} and
1335
@ref{Color Profiles}.
1337
This option only is effective if the input images come without color
1338
profiles and blending is performed in @acronym{CIECAM02} color
1343
@cindex alpha channel, associated
1344
Save alpha channel as ``associated''. See the
1345
@uref{http://@/www.awaresystems.be/@/imaging/@/tiff/@/tifftags/@/extrasamples.html,
1346
@acronym{TIFF} documentation} for an explanation.
1350
Gimp (before version@tie{}2.0) and CinePaint (@pxref{Helpful
1351
Programs}) exhibit unusual behavior when loading images with
1352
unassociated alpha channels. Use option @option{-g} to work around
1353
this problem. With this flag Enfuse will create the output image
1354
with the associated alpha tag set, even though the image is really
1357
@item -m @var{CACHESIZE}
1359
@cindex image cache, cache size
1360
Set the @var{CACHESIZE} in megabytes (@acronym{MB}) of Enfuse's image
1363
This is the amount of memory Enfuse will use for storing image data
1364
before swapping to disk. The default is
1365
@value{default-image-cache-cachesize}, which is good for systems with
1366
3--4@dmn{gigabytes} (@acronym{GB}) of @acronym{RAM}. See @ref{Tuning
1367
Memory Usage} for details.
1369
Note that Enfuse must have been compiled with the image-cache feature
1370
for this option to be effective. Find out about extra features with
1371
@code{enfuse --version --verbose}.
1374
@opindex --no-ciecam
1375
@cindex color appearance model
1376
@cindex @acronym{CIECAM02}
1377
Disable the use of the @acronym{CIECAM02} color appearance model for
1380
See option@tie{}@option{--ciecam} for details. Also see @ref{Color
1385
@node Fusion Options
1386
@section Fusion Options
1387
@cindex options, fusion
1389
Fusion options define the proportion to which each input image's pixel
1390
contributes to the output image.
1393
@item --contrast-weight=@var{WEIGHT}
1394
@opindex --contrast-weight
1395
@cindex weight, local contrast
1397
Sets the relative @var{WEIGHT} of high local-contrast pixels.
1399
Valid range: @value{src::minimum-weight-contrast} @leq{} @var{WEIGHT}
1400
@leq{} @value{src::maximum-weight-contrast}.
1402
Default: @value{src::default-weight-contrast}.
1404
See @ref{Local Contrast Weighting} and @ref{Expert Options, Option
1405
contrast-window-size}.
1407
@item --entropy-weight=@var{WEIGHT}
1408
@opindex --entropy-weight
1409
@cindex weight, entropy
1411
Sets the relative @var{WEIGHT} of high local entropy pixels.
1413
Valid range: @value{src::minimum-weight-entropy} @leq{} @var{WEIGHT}
1414
@leq{} @value{src::maximum-weight-entropy}.
1416
Default: @value{src::default-weight-entropy}.
1418
See @ref{Local Entropy Weighting} and @ref{Expert Options, Options
1419
entropy-window-size and entropy-cutoff}.
1421
@item --exposure-weight=@var{WEIGHT}
1422
@opindex --exposure-weight
1423
@cindex weight, exposure
1425
Sets the relative @var{WEIGHT} of the well-exposedness criterion.
1426
Increasing this weight relative to the others will make well-exposed
1427
pixels contribute more to the final output.
1429
Valid range: @value{src::minimum-weight-exposure} @leq{} @var{WEIGHT}
1430
@leq{} @value{src::maximum-weight-exposure}.
1432
Default: @value{src::default-weight-exposure}.
1434
@xref{Exposure Weighting}.
1436
@item --exposure-mu=@var{MEAN}
1437
@opindex --exposure-mu
1439
Set the @var{MEAN} (this is, the center) of the Gaussian exposure
1442
Valid range: @value{src::minimum-exposure-mu} @leq{} @var{MEAN}
1443
@leq{} @value{src::maximum-exposure-mu}.
1445
Default: @value{src::default-exposure-mu}.
1447
Use this option to fine-tune exposure weighting (@pxref{Exposure
1450
@item --exposure-sigma=@var{STD-DEV}
1451
@opindex --exposure-sigma
1453
Standard deviation @var{STD-DEV} of the Gaussian exposure weight
1454
curve. Low numbers give less weight to pixels that are far from
1455
@option{--wMu} and vice versa.
1457
Valid range: @var{STD-DEV} @geq{} @value{src::minimum-exposure-sigma}.
1459
Default: @value{src::default-exposure-sigma}.
1461
Use this option to fine-tune exposure weighting (@pxref{Exposure
1464
@item --saturation-weight=@var{WEIGHT}
1465
@opindex --saturation-weight
1467
Sets the relative @var{WEIGHT} of high-saturation pixels. Increasing
1468
this weight makes pixels with high saturation contribute more to the
1471
Valid range: @value{src::minimum-weight-saturation}
1472
@leq{} @var{WEIGHT} @leq{} @value{src::maximum-weight-saturation}.
1474
Default: @value{src::default-weight-saturation}.
1476
Saturation weighting is only defined for color images.
1477
@xref{Saturation Weighting}.
1481
@node Expert Options
1482
@section Expert Options
1483
@cindex options, expert
1485
Expert options influence the workings of Enfuse that require the user
1486
to read the manual before applying them successfully.
1489
@item --contrast-edge-scale=@var{EDGE-SCALE}
1490
@itemx --contrast-edge-scale=@var{EDGE-SCALE}:@var{LCE-SCALE}:@var{LCE-FACTOR}
1491
@opindex --contrast-edge-scale
1493
@cindex Laplacian-of-Gaussian
1494
A non-zero value for @var{EDGE-SCALE} switches on the
1495
Laplacian-of-Gaussian (@acronym{LoG}) edge detection algorithm.
1496
@var{EDGE-SCALE} is the radius of the Gaussian used in the search for
1497
edges. Default: @value{src::default-edge-scale}@dmn{pixels}.
1499
A positive @var{LCE-SCALE} turns on local contrast enhancement
1500
(@acronym{LCE}) before the @acronym{LoG} edge detection.
1501
@var{LCE-SCALE} is the radius of the Gaussian used in the enhancement
1502
step, @var{LCE-FACTOR} is the weight factor (``strength'').
1504
@var{enhanced} = (1 + @var{LCE-FACTOR}) @classictimes{} @var{original}
1505
@minus{} @var{LCE-FACTOR} @classictimes{} Gaussian@/Smooth(@var{original},
1508
@var{LCE-SCALE} defaults to @value{src::default-lce-scale} pixels and
1509
@var{LCE-FACTOR} defaults to @value{src::default-lce-factor}. Append
1510
@samp{%} to @var{LCE-SCALE} to specify the radius as a percentage of
1511
@var{EDGE-SCALE}. Append @samp{%} to @var{LCE-FACTOR} to specify the
1512
weight as a percentage.
1514
@item --contrast-min-curvature=@var{CURVATURE}
1515
@opindex --contrast-min-curvature
1517
Define the minimum @var{CURVATURE} for the @acronym{LoG} edge
1518
detection. Default: @value{src::default-minimum-curvature}. Append a
1519
@samp{%} to specify the minimum curvature relative to maximum pixel
1520
value in the source image (for example 255 or 65535).
1522
A positive value makes Enfuse use the local contrast data (controlled
1523
with @option{--contrast-window-size}) for curvatures less than
1524
@var{CURVATURE} and @acronym{LoG} data for values above it.
1526
A negative value truncates all curvatures less than
1527
@minus{}@var{CURVATURE} to zero. Values above @var{CURVATURE} are
1528
left unchanged. This effectively suppresses weak edges.
1530
@item --contrast-window-size=@var{SIZE}
1531
@opindex --contrast-window-size
1533
Set the window @var{SIZE} for local contrast analysis. The window
1534
will be a square of @var{SIZE}@classictimes{}@/@var{SIZE} pixels. If
1535
given an even @var{SIZE}, Enfuse will automatically use the next odd
1538
For contrast analysis @var{SIZE} values larger than 5 might result in
1539
a blurry composite image. Values of 3 and 5 have given good results
1542
Valid range: @var{SIZE} @geq{} @value{src::minimum-contrast-window-size}.
1544
Default: @value{src::default-contrast-window-size}@dmn{pixels}.
1546
See also @ref{Fusion Options, Option --contrast-weight} and
1547
@option{--hard-mask} below.
1549
@item --entropy-cutoff=@var{LOWER-CUTOFF}
1550
@itemx --entropy-cutoff=@var{LOWER-CUTOFF}:@var{UPPER-CUTOFF}
1551
@opindex --entropy-cutoff
1553
The first form defines the lower cutoff value below which pixels are
1554
treated as pure black when calculating the local entropy. The second
1555
form also defines the upper cutoff value above which pixels are
1556
treated as pure white.
1558
For color images @var{LOWER-CUTOFF} and @var{UPPER-CUTOFF} are applied
1559
separately and independently to each channel.
1561
Defaults: @value{src::default-entropy-lower-cutoff} for
1562
@var{LOWER-CUTOFF} and @value{src::default-entropy-upper-cutoff} for
1563
@var{UPPER-CUTOFF}, that is, all pixels' values are taken into
1564
account. Append a @samp{%} to specify the cutoff relative to maximum
1565
pixel value in the source image (for example 255 or 65535).
1566
@ref{Figure:entropy-cutoff} shows an example.
1568
@float Figure,Figure:entropy-cutoff
1569
@vimage{entropy-cutoff}
1571
@caption{Linear lightness@tie{}@var{Y} in comparison with an entropy-cutoff function for @var{LOWER-CUTOFF} = 5% and @var{UPPER-CUTOFF} = 90%, which are rather extreme values. Please note that we have shifted the original lightness curve up and the cut-off curve down by a very small @var{Offset} to emphasize that the proportional part of @var{Y} remains unaltered under the cut-off operation.}
1573
@shortcaption{Entropy cutoff function}
1576
Note that a high @var{LOWER-CUTOFF} value lightens the resulting
1577
image, as dark (and presumably noisy) pixels are averaged with
1578
@emph{equal} weights. With @samp{--entropy-cutoff=0}, the default, on
1579
the other hand, ``noise'' might be interpreted as high entropy and the
1580
noisy pixels get a high weight, which in turn renders the resulting
1581
image darker. Analogously, a low @var{UPPER-CUTOFF} darkens the
1584
@item --entropy-window-size=@var{SIZE}
1585
@opindex --entropy-window-size
1587
Window @var{SIZE} for local entropy analysis. The window will be a
1588
square of @var{SIZE}@classictimes{}@/@var{SIZE} pixels.
1590
In the entropy calculation @var{SIZE} values of 3 to 7 yield an
1591
acceptable compromise of the locality of the information and the
1592
significance of the local entropy value itself.
1594
Valid range: @var{SIZE} @geq{} @value{src::minimum-entropy-window-size}.
1596
Default: @value{src::default-entropy-window-size}@dmn{pixels}.
1598
If given an even @var{SIZE} Enfuse will automatically use the next odd
1601
@item --exposure-cutoff=@var{LOWER-CUTOFF}
1602
@itemx --exposure-cutoff=@var{LOWER-CUTOFF}:@var{UPPER-CUTOFF}
1603
@itemx --exposure-cutoff=@var{LOWER-CUTOFF}:@var{UPPER-CUTOFF}:@var{LOWER-PROJECTOR}:@var{UPPER-PROJECTOR}
1604
@opindex --exposure-cutoff
1606
The first form sets the weight for all pixels below the lower cutoff
1607
to zero. The second form sets the lower cutoff and the upper cutoff
1608
at the same time. For color images the values of @var{LOWER-CUTOFF}
1609
and @var{UPPER-CUTOFF} refer to the gray-scale projection as selected
1610
with the option @option{--gray-projector}.
1612
The impact of this option is similar, but not identical to
1613
transforming @emph{all} input images with
1614
@uref{http://@/www.imagemagick.org/, ImageMagick's} @command{convert}
1615
(@pxref{Helpful Programs}) prior to fusing with the following
1622
\( +clone -threshold LOWER-CUTOFF \) \
1623
-compose copy_opacity -composite \
1631
\( IMAGE -threshold LOWER-CUTOFF \) \
1632
\( IMAGE -threshold UPPER-CUTOFF -negate \) \
1633
-compose multiply -composite \
1635
-compose copy_opacity -composite \
1640
(Transforming some or all input images as shown in the above examples
1641
gives the user more flexibility because the thresholds can be chosen
1642
for each image individually.)
1644
The third form specifies projection operators as in
1645
option@tie{}@option{--gray-projector} for the @var{LOWER-CUTOFF} and
1646
@var{UPPER-CUTOFF} thresholds.
1648
This option can be helpful if the user wants to exclude underexposed
1649
or overexposed pixels from the fusing process in @emph{all} of the
1650
input images. The values of @var{LOWER-CUTOFF} and @var{UPPER-CUTOFF}
1651
as well as the gray-scale projector determine which pixels are
1652
considered ``underexposed'' or ``overexposed''. As any change of the
1653
exposure-weight curve this option changes the brightness of the
1654
resulting image: increasing @var{LOWER-CUTOFF} lightens the final
1655
image and lowering @var{UPPER-CUTOFF} darkens it.
1657
Defaults: @value{src::default-exposure-lower-cutoff} for
1658
@var{LOWER-CUTOFF} and @value{src::default-exposure-upper-cutoff} for
1659
@var{UPPER-CUTOFF}, that is, all pixels' values are weighted according
1660
to the ``uncut'' exposure-weight curve.
1662
Append a @samp{%} to specify the cutoff relative to the maximum pixel
1663
value in the source image (for example 255 or 65535).
1665
@ref{Figure:exposure-cutoff} shows an example.
1667
The gray-scale projectors @var{LOWER-PROJECTOR} and
1668
@var{UPPER-PROJECTOR} default to
1669
@samp{@value{src::default-exposure-lower-cutoff-projector}} and
1670
@samp{@value{src::default-exposure-upper-cutoff-projector}}, which are
1671
usually the best choices for effective cutoff operations on the
1674
@float Figure,Figure:exposure-cutoff
1675
@vimage{exposure-cutoff}
1677
@caption{Exposure weight, a Gaussian with @var{Mu} = 0.5 and @var{Sigma} = 0.2 submitted to an exposure-cutoff of @var{LOWER-CUTOFF} = 5% and @var{UPPER-CUTOFF} = 97%.}
1679
@shortcaption{Exposure cutoff function}
1682
Note that the application of the respective cutoffs is completely
1683
independent of the actual shape of the exposure weight function.
1685
If a set of images stubbornly refuses to ``react'' to this option,
1686
look at their histograms to verify the cutoff actually falls into
1687
populated ranges of the histograms. In the absence of an image
1688
manipulation program like @uref{http://@/www.gimp.org/, The Gimp},
1689
@uref{http://@/www.imagemagick.org/, ImageMagick} (@pxref{Helpful
1690
Programs}) can be used to generate
1691
@uref{http://@/www.imagemagick.org/@/Usage/@/files/@/#histogram,
1692
histograms}, like, for example,
1696
convert -define histogram:unique-colors=false \
1697
IMAGE histogram:- | \
1702
@item --gray-projector=@var{PROJECTOR}
1703
@opindex --gray-projector
1704
@cindex gray projector
1706
Use gray projector@tie{}@var{PROJECTOR} for conversion of
1707
@acronym{RGB} images to grayscale:
1709
@math{(R, G, B) --> Y.}
1712
<mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline">
1719
<mo>→</mo>
1726
$(R, G, B) \rightarrow Y.$
1745
In version@tie{}@value{VERSION} of Enfuse, the option is effective for
1746
exposure weighting and local contrast weighting. Default:
1749
Valid values for @var{PROJECTOR} are:
1753
@cindex gray projector, @samp{anti-value}
1754
@cindex @samp{anti-value} gray projector
1755
Do the opposite of the @samp{value} projector: take the minimum of all
1759
@math{Y = min(R, G, B)}
1763
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
1769
<mo>⁡</mo>
1801
This projector can be useful when exposure weighing while employing a
1802
lower cutoff (see option@tie{}@option{--exposure-cutoff}) to reduce
1803
the noise in the fused image.
1806
@cindex gray projector, @samp{average}
1807
@cindex @samp{average} gray projector
1808
Average red, green, and blue channel with equal weights. This is the
1809
default, and it often is a good projector for @math{gamma = 1} data.
1812
@math{Y = (R + G + B) / 3}
1816
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
1835
Y = {R + G + B \over 3}
1844
<mml:apply other='display="scriptstyle"'>
1859
@item channel-mixer:@var{RED-WEIGHT}:@var{GREEN-WEIGHT}:@var{BLUE-WEIGHT}
1860
@cindex gray projector, @samp{channel-mixer}
1861
@cindex @samp{channel-mixer} gray projector
1862
Weight the channels as given.
1865
@math{Y = RED-WEIGHT * R + GREEN-WEIGHT * G + BLUE-WEIGHT * B}
1869
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
1874
<mi mathvariant="italic">RED-WEIGHT</mi>
1880
<mi mathvariant="italic">GREEN-WEIGHT</mi>
1886
<mi mathvariant="italic">BLUE-WEIGHT</mi>
1895
\eqalign{Y \quad = \quad
1896
& \mathit{RED-WEIGHT} \times R \; + \cr
1897
& \mathit{GREEN-WEIGHT} \times G \; + \cr
1898
& \mathit{BLUE-WEIGHT} \times B \cr}
1912
<mml:mi mathvariant="italic">RED-WEIGHT</mml:mi>
1919
<mml:mi mathvariant="italic">GREEN-WEIGHT</mml:mi>
1926
<mml:mi mathvariant="italic">BLUE-WEIGHT</mml:mi>
1936
The weights are automatically normalized to one, so
1939
--gray-projector=channel-mixer:0.25:0.5:0.25
1940
--gray-projector=channel-mixer:1:2:1
1941
--gray-projector=channel-mixer:25:50:25
1944
all define the same mixer configuration.
1946
The three weights @var{RED-WEIGHT}, @var{GREEN-WEIGHT}, and
1947
@var{BLUE-WEIGHT} define the relative weight of the respective color
1948
channel. The sum of all weights is normalized to one.
1951
@cindex gray projector, @samp{l-star}
1952
@cindex @samp{l-star} gray projector
1953
@cindex RGB-L*a*b* conversion
1954
@cindex conversion, RGB-L*a*b*
1955
Use the L-channel of the L*a*b*-conversion of the image as its
1956
grayscale representation. This is a useful projector for gamma = 1
1957
data. It reveals minute contrast variations even in the shadows and
1958
the highlights. This projector is computationally expensive. Compare
1959
with @samp{pl-star}, which is intended for gamma-corrected images.
1961
See @uref{http://@/en.wikipedia.org/@/wiki/@/Lab_@/color_@/space,
1962
Wikipedia} for a detailed description of the @acronym{Lab}@tie{}color
1966
@cindex gray projector, @samp{lightness}
1967
@cindex @samp{lightness} gray projector
1968
Compute the lightness of each @acronym{RGB} pixel as in an
1969
Hue-Saturation-Lightness (@acronym{HSL}) conversion of the image.
1972
@math{Y = (max(R, G, B) + min(R, G, B)) / 2}
1976
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
1984
<mo>⁡</mo>
1994
<mo>⁡</mo>
2009
Y = {\max(R, G, B) + \min(R, G, B) \over 2}
2043
@cindex gray projector, @samp{luminance}
2044
@cindex @samp{luminance} gray projector
2045
Use the weighted average of the @acronym{RGB} pixel's channels as
2046
defined by @acronym{CIE} (``Commission Internationale de
2047
l'@'Eclairage'') and the @acronym{JPEG} standard.
2050
@math{Y = 0.30 * R + 0.59 * G + 0.11 * B}
2054
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
2080
Y = 0.30 \times R + 0.59 \times G + 0.11 \times B
2093
<mml:cn type="real">0.30</mml:cn>
2098
<mml:cn type="real">0.59</mml:cn>
2103
<mml:cn type="real">0.11</mml:cn>
2113
@cindex gray projector, @samp{pl-star}
2114
@cindex @samp{pl-star} gray projector
2115
@cindex RGB'-L*a*b* conversion
2116
@cindex conversion, RGB'-L*a*b*
2117
Use the L-channel of the L*a*b*-conversion of the image as its
2118
grayscale representation. This is a useful projector for
2119
gamma-corrected data. It reveals minute contrast variations even in
2120
the shadows and the highlights. This projector is computationally
2121
expensive. Compare with @samp{l-star}, which is intended for gamma =
2124
See @uref{http://@/en.wikipedia.org/@/wiki/@/Lab_@/color_@/space,
2125
Wikipedia} for a detailed description of the @acronym{Lab}@tie{}color
2129
@cindex gray projector, @samp{value}
2130
@cindex @samp{value} gray projector
2131
Take the Value-channel of the Hue-Saturation-Value (@acronym{HSV})
2132
conversion of the image.
2135
@math{Y = max(R, G, B)}
2139
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
2145
<mo>⁡</mo>
2179
@opindex --hard-mask
2181
Force hard blend masks on the finest scale. This is the opposite flag
2182
of @option{--soft-mask}.
2184
This blending mode avoids averaging of fine details (only) at the
2185
expense of increasing the noise. However it considerably improves the
2186
sharpness of focus stacks. Blending with hard masks has only proven
2187
useful with focus stacks.
2189
See also @ref{Fusion Options, Option --contrast-weight} and
2190
@option{--contrast-window-size} above.
2193
@itemx --load-masks=@var{SOFT-MASK-TEMPLATE}
2194
@itemx --load-masks=@var{SOFT-MASK-TEMPLATE}:@var{HARD-MASK-TEMPLATE}
2195
@opindex --load-masks
2197
Load masks from images instead of computing them.
2199
The masks have to be a grayscale images.
2201
@cindex mask, loading
2202
First form: Load all soft-weight masks from files that were previously
2203
saved with option@tie{}@option{--save-masks}. If
2204
option@tie{}@option{--hard-mask} is effective only load hard masks.
2205
The defaults are @file{@value{src::default-soft-mask-template}} and
2206
@file{@value{src::default-hard-mask-template}}.
2207
@cindex filename template
2208
@cindex mask, filename template
2209
In the second form, @var{SOFT-MASK-TEMPLATE} defines the names of the
2210
soft-mask files. In the third form, @var{HARD-MASK-TEMPLATE}
2211
additionally defines the names of the hard-mask files. See
2212
option@tie{}@option{--save-masks} below for the description of mask
2215
Options@tie{}@option{--load-masks} and @option{--save-masks} are
2219
@itemx --save-masks=@var{SOFT-MASK-TEMPLATE}
2220
@itemx --save-masks=@var{SOFT-MASK-TEMPLATE}:@var{HARD-MASK-TEMPLATE}
2221
@opindex --save-masks
2224
Save the generated weight masks to image files.
2226
First form: Save all soft-weight masks in files. If
2227
option@tie{}@option{--hard-mask} is effective also save the hard masks.
2228
The defaults are @file{@value{src::default-soft-mask-template}} and
2229
@file{@value{src::default-hard-mask-template}}.
2230
@cindex filename template
2231
@cindex mask, filename template
2232
In the second form, @var{SOFT-MASK-TEMPLATE} defines the names of the
2233
soft-mask files. In the third form, @var{HARD-MASK-TEMPLATE}
2234
additionally defines the names of the hard-mask files.
2236
@cindex save mask, only
2237
@cindex only save mask
2238
Enfuse will stop after saving all masks unless
2239
option@tie{}@option{--output} is given, too. With both options given,
2240
this is, @option{--save-masks} and @option{--output}, Enfuse saves all
2241
masks and then proceeds to fuse the output image.
2243
Both @var{SOFT-MASK-TEMPLATE} and @var{HARD-MASK-TEMPLATE} define
2244
templates that are expanded for each mask file. In a template a
2245
percent sign (@samp{%}) introduces a variable part. All other
2246
characters are copied literally. Lowercase letters refer to the name
2247
of the respective input file, whereas uppercase ones refer to the name
2248
of the output file (@pxref{Common Options}).
2249
@ref{Table:mask-template-characters} lists all variables.
2251
A fancy mask filename template could look like this:
2254
%D/soft-mask-%02n-%f.viff
2257
It puts the mask files into the same directory as the output file
2258
(@samp{%D}), generates a two-digit index (@samp{%02n}) to keep the
2259
mask files nicely sorted, and decorates the mask filename with the
2260
name of the associated input file (@samp{%f}) for easy recognition.
2263
@opindex --soft-mask
2265
Consider all masks when fusing. This is the default.
2268
@c The extra <para>s fix another stupid Texinfo problem with DocBook.
2272
Options@tie{}@option{--save-masks} and @option{--load-masks} are
2280
@include mask-template-characters.texi
2282
@node Option Delimiters
2283
@section Option Delimiters
2284
@cindex option delimiters
2285
@cindex delimiters, option
2287
Enfuse allows the arguments supplied to the program's options to be
2288
separated by different separators. The online documentation and this
2289
manual, however, exclusively use the colon @samp{:} in every syntax
2290
definition and in all examples.
2294
@strong{Numeric Arguments}
2296
Valid delimiters are the the semicolon @samp{;}, the colon @samp{:},
2297
and the slash @samp{/}. All delimiters may be mixed within any
2298
option that takes numeric arguments.
2304
@item --contrast-edge-scale=0.667:6.67:3.5
2305
Separate all arguments with colons.
2307
@item --contrast-edge-scale=0.667;6.67;3.5
2310
@item --contrast-edge-scale=0.667;6.67/3.5
2311
Mix semicolon and slash in weird ways.
2313
@item --entropy-cutoff=3%/99%
2314
All delimiters also work in conjunction with percentages.
2316
@item --gray-projector=channel-mixer:3/6/1
2317
Separate arguments with a colon and two slashes.
2319
@item --gray-projector=channel-mixer/30;60:10
2320
Go wild and Enfuse will understand.
2325
@strong{Filename Arguments}
2327
Here, the accepted delimiters are @samp{,}, @samp{;}, and @samp{:}.
2328
Again, all delimiters may be mixed within any option that has filename
2335
@item --save-masks=soft-mask-%03i.tif:hard-mask-03%i.tif
2336
Separate all arguments with colons.
2338
@item --save-masks=%d/soft-%n.tif,%d/hard-%n.tif
2343
@node Color Profiles
2344
@chapter Color Profiles
2345
@cindex profile, @acronym{ICC}
2346
@cindex @acronym{ICC} profile
2347
@cindex color profile
2349
@include color-profiles.texi
2352
@node Weighting Functions
2353
@chapter Weighting Functions
2354
@cindex weighting functions
2356
As has been noted in the Overview (@pxref{Overview}), Enfuse supports
2357
four different types of weighting. The following subsections describe
2358
the concept of weighting and all weighting functions in detail.
2361
* Weighting Pixels:: General concept of weighting pixels
2362
* Exposure Weighting:: Weighting by exposure
2363
* Saturation Weighting:: Weighting by saturation
2364
* Local Contrast Weighting:: Weighting by local contrast
2365
* Local Entropy Weighting:: Weighting by local entropy
2369
@node Weighting Pixels
2370
@section Weighting Pixels
2371
@cindex weighting, general concept of
2373
Image fusion maps each pixel@tie{}@math{P(i, x, y)} of every input
2374
image @math{i} to a single pixel@tie{}@math{Q(x, y)} in the output
2378
@math{P(i, x, y) --> Q(x, y),}
2382
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
2392
<mo>→</mo>
2406
P(i, x, y) \rightarrow Q(x, y),
2432
where @math{x} runs from 1 to the common width of the images, @math{y}
2433
from 1 to the common height, and @math{i} from 1 to the number of
2434
input images@tie{}@math{n}.
2446
<xref linkend="equ:pixel-weighting-function"/>
2450
Enfuse allows for weighting the contribution of each @math{P(i, x, y)}
2451
to the final @math{Q(x, y)}:
2454
@math{w(P(1, x, y)) * P(1, x, y) +
2456
w(P(n, x, y)) * P(n, x, y)
2457
--> Q(x, y),}@w{ }@equationW{}
2461
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
2465
<mo>⁡</mo>
2491
<mo>⁡</mo>
2514
<mo>→</mo>
2524
<mspace width="4em"/>
2525
<mtext>@equationW{}</mtext>
2531
w(P(1, x, y)) P(1, x, y) + \ldots + w(P(n, x, y)) P(n, x, y)
2533
Q(x, y),\hskip4em\hbox{@equationW{}}
2537
<equation id="equ:pixel-weighting-function">
2538
<title>Pixel Weighting Function</title>
2562
<mml:mo>...</mml:mo>
2598
each @math{w} is non-negative to yield a physical intensity and
2601
the sum of all @math{w} is one to leave the total intensity unchanged.
2605
The pixel weights@tie{}@math{w} themselves are weighted sums with the
2609
@math{w(P) = w_exp * f_exp(P) +
2611
w_cont * f_cont(P, r_cont) +
2612
w_ent * f_ent(P, r_ent),}
2616
where we have abbreviated @math{P(i, x, y)} to @math{P} for
2617
simplicity. The user defines the constants@tie{}@math{w_exp},
2618
@math{w_sat}, @math{w_cont}, and @math{w_ent} with the options
2619
@option{--exposure-weight}, @option{--saturation-weight},
2620
@option{--contrast-weight}, and @option{--entropy-weight}. The
2621
functions@tie{}@math{f_exp}, @math{f_sat}, @math{f_cont}, and
2622
@math{f_ent} along with the window sizes@tie{}@math{r_cont} and
2623
@math{r_ent} are explained in the next sections.
2627
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
2632
<mo>⁡</mo>
2653
<mo>⁡</mo>
2677
<mo>⁡</mo>
2701
<mo>⁡</mo>
2727
<mo>⁡</mo>
2741
<p>where we have abbreviated
2742
<mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline">
2743
<mi>P</mi> <mrowinline> <mo>(</mo> <mi>i</mi> <mo>,</mo> <mi>x</mi> <mo>,</mo>
2744
<mi>y</mi> <mo>)</mo> </mrowinline> </mathinline> to
2745
<mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline">
2746
<mi>P</mi> </mathinline> for simplicity. The user defines the
2747
constants <mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline">
2748
<msubinline> <mi>w</mi> <mtext>exp</mtext> </msubinline> </mathinline>,
2749
<mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline">
2750
<msubinline> <mi>w</mi> <mtext>sat</mtext> </msubinline> </mathinline>,
2751
<mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline">
2752
<msubinline> <mi>w</mi> <mtext>cont</mtext> </msubinline> </mathinline>, and
2753
<mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline">
2754
<msubinline> <mi>w</mi> <mtext>ent</mtext> </msubinline> </mathinline> with the options
2755
`<tt>--exposure-weight</tt>', `<tt>--saturation-weight</tt>',
2756
`<tt>--contrast-weight</tt>', and `<tt>--entropy-weight</tt>'
2758
functions <mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline">
2759
<msubinline> <mi>f</mi> <mtext>exp</mtext> </msubinline> </mathinline>,
2760
<mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline">
2761
<msubinline> <mi>f</mi> <mtext>sat</mtext> </msubinline> </mathinline>,
2762
<mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline">
2763
<msubinline> <mi>f</mi> <mtext>cont</mtext> </msubinline> </mathinline>, and
2764
<mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline">
2765
<msubinline> <mi>f</mi> <mtext>ent</mtext> </msubinline> </mathinline> along with the window
2766
sizes <mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline">
2767
<msubinline> <mi>r</mi> <mtext>cont</mtext> </msubinline> </mathinline> and
2768
<mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline">
2769
<msubinline> <mi>r</mi> <mtext>ent</mtext> </msubinline> </mathinline> are explained in
2770
the next sections.</p><p>
2774
\eqalign{w(P) \quad = \quad
2775
& w_{\mathrm{exp}} \; f_{\mathrm{exp}}(P) + \cr
2776
& w_{\mathrm{sat}} \; f_{\mathrm{sat}}(P) + \cr
2777
& w_{\mathrm{cont}} \; f_{\mathrm{cont}}(P, r_{\mathrm{cont}}) + \cr
2778
& w_{\mathrm{ent}} \; f_{\mathrm{ent}}(P, r_{\mathrm{ent}}), \cr}
2781
\noindent where we have abbreviated $P(i, x, y)$ to $P$ for
2782
simplicity. The user defines the constants~$w_{\mathrm{exp}}$,
2783
$w_{\mathrm{sat}}$, $w_{\mathrm{cont}}$, and $w_{\mathrm{ent}}$ with
2784
the options `{\tt --exposure-weight}', `{\tt --saturation-weight}', `{\tt
2785
--contrast-weight}', and `{\tt --entropy-weight}' respectively. The
2786
functions~$f_{\mathrm{exp}}$, $f_{\mathrm{sat}}$, $f_{\mathrm{cont}}$,
2787
and $f_{\mathrm{ent}}$ along with the window sizes~$r_{\mathrm{cont}}$
2788
and $r_{\mathrm{ent}}$ are explained in the next sections.
2806
<mml:mi mathvariant="normal">exp</mml:mi>
2813
<mml:mi mathvariant="normal">exp</mml:mi>
2824
<mml:mi mathvariant="normal">sat</mml:mi>
2831
<mml:mi mathvariant="normal">sat</mml:mi>
2842
<mml:mi mathvariant="normal">cont</mml:mi>
2849
<mml:mi mathvariant="normal">cont</mml:mi>
2856
<mml:mi mathvariant="normal">cont</mml:mi>
2867
<mml:mi mathvariant="normal">ent</mml:mi>
2874
<mml:mi mathvariant="normal">ent</mml:mi>
2881
<mml:mi mathvariant="normal">ent</mml:mi>
2892
where we have abbreviated <inlineequation> <mml:math> <mml:apply>
2893
<mml:ci>P</mml:ci> <mml:ci>i</mml:ci> <mml:ci>x</mml:ci>
2894
<mml:ci>y</mml:ci> </mml:apply> </mml:math> </inlineequation> to
2895
<inlineequation> <mml:math> <mml:ci>P</mml:ci> </mml:math>
2896
</inlineequation> for simplicity. The user defines the
2897
constants <inlineequation> <mml:math> <mml:csymbol> <mml:msub>
2898
<mml:mi>w</mml:mi> <mml:mi mathvariant="normal">exp</mml:mi>
2899
</mml:msub> </mml:csymbol> </mml:math> </inlineequation>,
2900
<inlineequation> <mml:math> <mml:csymbol> <mml:msub>
2901
<mml:mi>w</mml:mi> <mml:mi mathvariant="normal">sat</mml:mi>
2902
</mml:msub> </mml:csymbol> </mml:math> </inlineequation>,
2903
<inlineequation> <mml:math> <mml:csymbol> <mml:msub>
2904
<mml:mi>w</mml:mi> <mml:mi mathvariant="normal">cont</mml:mi>
2905
</mml:msub> </mml:csymbol> </mml:math> </inlineequation>, and
2906
<inlineequation> <mml:math> <mml:csymbol> <mml:msub>
2907
<mml:mi>w</mml:mi> <mml:mi mathvariant="normal">ent</mml:mi>
2908
</mml:msub> </mml:csymbol> </mml:math> </inlineequation>, with the
2909
options <literal>--exposure-weight</literal>,
2910
<literal>--saturation-weight</literal>,
2911
<literal>--contrast-weight</literal>, and
2912
<literal>--entropy-weight</literal> respectively. The
2913
functions <inlineequation> <mml:math> <mml:csymbol> <mml:msub>
2914
<mml:mi>f</mml:mi> <mml:mi mathvariant="normal">exp</mml:mi>
2915
</mml:msub> </mml:csymbol> </mml:math> </inlineequation>,
2916
<inlineequation> <mml:math> <mml:csymbol> <mml:msub>
2917
<mml:mi>f</mml:mi> <mml:mi mathvariant="normal">sat</mml:mi>
2918
</mml:msub> </mml:csymbol> </mml:math> </inlineequation>,
2919
<inlineequation> <mml:math> <mml:csymbol> <mml:msub>
2920
<mml:mi>f</mml:mi> <mml:mi mathvariant="normal">cont</mml:mi>
2921
</mml:msub> </mml:csymbol> </mml:math> </inlineequation>, and
2922
<inlineequation> <mml:math> <mml:csymbol> <mml:msub>
2923
<mml:mi>f</mml:mi> <mml:mi mathvariant="normal">ent</mml:mi>
2924
</mml:msub> </mml:csymbol> </mml:math> </inlineequation> along with
2925
the window sizes <inlineequation> <mml:math> <mml:csymbol>
2926
<mml:msub> <mml:mi>r</mml:mi> <mml:mi
2927
mathvariant="normal">cont</mml:mi> </mml:msub>
2928
</mml:csymbol></mml:math> </inlineequation> and <inlineequation>
2929
<mml:math> <mml:csymbol> <mml:msub> <mml:mi>r</mml:mi> <mml:mi
2930
mathvariant="normal">ent</mml:mi> </mml:msub> </mml:csymbol>
2931
</mml:math> </inlineequation> are explained in the next sections.
2935
* Weighted Average:: Enfuse's default weighting algorithm
2936
* Disabling Averaging:: ``Super Trouper'' weighting for focus stacks
2937
* Single Criterion Fusing:: Fusing with only one of the criteria
2941
@node Weighted Average
2942
@subsection Weighted Average
2943
@cindex weighted average
2944
@cindex average, weighted
2946
By default, Enfuse uses a weighted average, where @emph{each} pixel
2947
contributes as much as its weight demands. Of course the weights can
2948
be extreme, favoring only a few pixels or even only one pixel in the
2949
input stack. Extremes are not typical, however.
2951
Equal weights are another extreme that turns @equationW{} into an
2952
arithmetic average. This is why we sometimes speak of the ``averaging
2953
property'' of this weighting algorithm, like smoothing out noise.
2956
@node Disabling Averaging
2957
@subsection Disabling Averaging: Option@tie{}@option{--hard-mask}
2958
@cindex disabling average
2959
@cindex average, disabling
2960
@opindex --hard-mask
2962
The weighted average computation as described above has proven to be
2963
widely successful with the exception of one special case: focus
2964
stacking (@pxref{Focus Stacks}), where the averaging noticeably
2965
softens the final image.
2967
Use @option{--hard-mask} to switch Enfuse into a different (``Super
2968
Trouper'') weighting mode, where the pixel with the highest weight
2969
wins, this is, gets weight@tie{}one, and all other pixels get the
2971
(@uref{http://@/en.wikipedia.org/@/wiki/@/The_@/Winner_@/Takes_@/It_@/All,,``The
2972
Winner Takes It All.''}). With @option{--hard-mask} Equation@tie{}@equationW{}
2976
@math{P(i, x, y) --> Q(x, y),}
2982
@math{w(P(i, x, y)) >= w(P(j, x, y))} for all @math{1 <= j <= n}.
2986
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
2997
<mo>→</mo>
3007
<mtext>  where  </mtext>
3010
<mo>⁡</mo>
3023
<mo>⁡</mo>
3035
<mtext>  for all  </mtext>
3049
P(i, x, y) \rightarrow Q(x, y),
3050
\hbox{ where } w(P(i, x, y)) \ge w(P(j, x, y))
3051
\hbox{ for all } 1 \le j \le n.
3116
Note that this ``averaging'' scheme lacks the nice noise-reduction
3117
property of the weighted average@tie{}@equationW{}, because only a
3118
single input pixel contributes to the output.
3121
@node Single Criterion Fusing
3122
@subsection Single Criterion Fusing
3123
@cindex single criterion fusing
3124
@cindex fusing, single criterion
3126
Enfuse allows the user to weight each pixel of an input image by up to
3127
four different criteria (@pxref{Overview}). However, it does not
3128
force the user to do so. For some applications and more often simply
3129
to gain further insight into the weighting and fusing process, looking
3130
at only a single criterion is the preferred way to work.
3132
@cindex active criterion
3133
@cindex criterion, active
3134
The version of Enfuse for which this documentation was prepared, uses
3135
the default weights as stated in @ref{Table:default-weights}. Notice
3136
that by default @emph{more than one} weight is larger than zero, which
3137
means they are @emph{active}.
3139
@float Table,Table:default-weights
3140
@multitable {Local Contrast} {0.0}
3141
@headitem Criterion @tab Weight
3142
@item Exposure @tab @value{src::default-weight-exposure}
3143
@item Saturation @tab @value{src::default-weight-saturation}
3144
@item Local Contrast @tab @value{src::default-weight-contrast}
3145
@item Local Entropy @tab @value{src::default-weight-entropy}
3148
@caption{Enfuse's default weights as compiled into version@tie{}@value{VERSION}.}
3150
@shortcaption{Default weights}
3152
@cindex default weights
3153
@cindex weights, default
3156
To disable a particular criterion set its weight to zero as for
3160
--exposure-weight=1 --saturation-weight=0 \
3161
--contrast-weight=0 --entropy-weight=0 \
3164
instructs Enfuse to consider only the exposure weight. Combine this
3165
with option@tie{}@option{--save-masks} and it will become clearer how
3166
Enfuse computes the exposure weight for the set of images.
3168
@cindex overpowering criteria
3169
@cindex criteria, overpowering one another
3170
Another problem that can be inspected by fusing with just a single
3171
active criterion and saving the masks is if the weights of one
3172
criterion completely overpower all others.
3175
@node Exposure Weighting
3176
@section Exposure Weighting
3177
@cindex weighting, exposure
3179
Exposure weighting prefers pixels with a luminance@tie{}@math{Y} close
3180
to the center of the normalized, real-valued luminance
3181
interval@tie{}@math{[0, 1]}.
3183
@acronym{RGB}-pixels get converted to luminance using the grayscale
3184
projector given by @option{--gray-@/projector}, which defaults to
3185
@code{average}. Grayscale pixels are identified with luminance.
3187
In the normalized luminance interval 0.0 represents pure black and 1.0
3188
represents pure white independently of the data type of the input
3189
image. This is, for a @acronym{JPEG} image the luminance@tie{}255
3190
maps to 1.0 in the normalized interval and for a 32@dmn{bit}
3191
@acronym{TIFF} picture the highest luminance value@tie{}4294967295
3192
also maps to 1.0. The middle of the luminance interval, 0.5, is where
3193
a neutral gray tone ends up with every camera that had no exposure
3194
correction dialed in, for example the image of a gray- or white-card.
3196
The exposure weighting algorithm only looks at a single pixel at a
3197
time; the pixel's neighborhood is not taken into account.
3199
The weighting function is the Gaussian
3202
@math{w_exp(Y) = exp(-0.5 * ((Y - Mu) / Sigma)^2),}
3206
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
3213
<mo>⁡</mo>
3223
<mo>⁡</mo>
3231
<mo>⁢</mo>
3239
<mi mathvariant="italic">Mu</mi>
3241
<mi mathvariant="italic">Sigma</mi>
3255
w_{\mathrm{exp}}(Y) =
3256
\exp\left(-{1 \over 2}
3257
\left(Y - \mathit{Mu} \over \mathit{Sigma} \right)^2\right),
3269
<mml:mi mathvariant="normal">exp</mml:mi>
3295
<mml:ci>Sigma</mml:ci>
3307
whose center@tie{}@math{Mu} and width@tie{}@math{Sigma} are controlled
3308
by the command line options@tie{}@option{--exposure-mu} and @option{--exposure-sigma}
3309
respectively. @math{Mu} defaults to @value{src::default-exposure-mu}
3310
and @math{Sigma} defaults to @value{src::default-exposure-sigma}.
3311
@ref{Figure:gaussian} shows a Gaussian.
3313
@float Figure,Figure:gaussian
3316
@caption{Gaussian function with the parameters @var{Mu} = 0.5 and @var{Sigma} = 0.2.}
3318
@shortcaption{Gaussian function}
3321
The options@tie{}@option{--exposure-mu} and @option{--exposure-sigma} are for
3322
fine-tuning the final result without changing the set of input images.
3323
Option@tie{}@option{--exposure-mu} sets the point @var{Mu} of optimum
3324
exposure. Increasing @var{Mu} makes Enfuse prefer lighter pixels,
3325
rendering the final image lighter, and vice versa.
3326
Option@tie{}@option{--exposure-sigma} defines the range @var{Sigma} of
3327
acceptable exposures. Small values of @var{Sigma} penalize exposures
3328
that deviate from @var{Mu} more, and vice versa.
3330
@optionsummaryheading{}
3333
@item --exposure-weight
3334
@ref{Fusion Options}
3337
@ref{Fusion Options}
3339
@item --exposure-sigma
3340
@ref{Fusion Options}
3342
@item --gray-projector
3343
@ref{Expert Options}
3347
@node Saturation Weighting
3348
@section Saturation Weighting
3349
@cindex weighting, saturation
3351
Saturation weighting prefers pixels with a high saturation.
3353
Enfuse computes the saturation of a pixel according to the following
3358
@var{max} := maximum(@var{R}, @var{G}, @var{B})
3359
@var{min} := minimum(@var{R}, @var{G}, @var{B})
3360
@b{if} @var{max} = @var{min} @b{then}
3361
@var{saturation} := 0
3363
@var{sum} := @var{max} + @var{min}
3364
@var{difference} := @var{max} - @var{min}
3365
@b{if} @var{sum} @leq{} 1 @b{then}
3366
@var{saturation} := @var{difference} / @var{sum}
3368
@var{saturation} := @var{difference} / (2 - @var{sum})
3375
Obviously, saturation weighting can only be defined for @acronym{RGB}
3376
images, not for grayscale ones! If you need something similar, check
3377
out @ref{Local Entropy Weighting}; entropy weighting works for both
3378
@acronym{RGB} and grayscale pictures.
3380
The saturation weighting algorithm only looks at a single pixel at a
3381
time; the pixel's neighborhood is not taken into account.
3383
@optionsummaryheading{}
3386
@item --saturation-weight
3387
@ref{Fusion Options}
3391
@node Local Contrast Weighting
3392
@section Local Contrast Weighting
3393
@cindex weighting, local contrast
3395
Local contrast weighting favors pixels inside a high contrast
3396
neighborhood. The notion of ``high contrast'' is defined either by
3397
two different criteria or by a blend of both:
3401
The standard deviation (@acronym{SDev}) of all the pixels in the local
3402
analysis window is large. @xref{Standard Deviation}.
3405
The Laplacian-of-Gaussian (@acronym{LoG}) has a large magnitude.
3406
@xref{Laplacian of Gaussian}.
3409
If the @acronym{LoG} magnitude is below a given threshold, use
3410
@acronym{SDev} data, otherwise stick with @acronym{LoG}.
3411
@xref{Blend SDev and LoG}.
3414
Enfuse converts every @acronym{RGB} image to grayscale before it
3415
determines its contrast. Option@tie{}@option{--gray-projector}
3416
(@pxref{Expert Options}) controls the projector function. Depending
3417
on the subject, one of several grayscale projectors may yield the best
3418
black-and-white contrast for image fusion.
3420
In the following sections we describe each algorithm in detail.
3423
* Standard Deviation:: Standard deviation (@acronym{SDev})
3424
* Laplacian of Gaussian:: @acronym{LoG}, a second derivative method
3425
* Blend SDev and LoG:: Mix and match @acronym{SDev} and @acronym{LoG}
3426
* Scaling and Choice of Mode:: How parameters do not scale; neither does mode
3430
@node Standard Deviation
3431
@subsection Standard Deviation
3432
@cindex weighting, contrast using standard deviation
3433
@cindex contrast weighting using standard deviation
3435
@cindex local analysis window
3436
@cindex window, local-analysis
3437
The pixel under consideration@tie{}C sits exactly in the center of a
3438
square, the so-called @dfn{local analysis window}. It always has an
3439
uneven edge length. The user sets the size with
3440
option@tie{}@option{--contrast-window-size}.
3441
@ref{Figure:local-analysis-window} shows two windows with different
3444
@float Figure,Figure:local-analysis-window
3445
@vimage{local-analysis-window}
3447
@caption{Examples of local analysis windows for the sizes 3 and 5. ``C'' marks the center where the pixel gets the weight. ``N'' are neighboring pixels, which all contribute equally to the weight.}
3449
@shortcaption{Local analysis window}
3452
During the analysis, Enfuse scans the local analysis window across all
3453
rows and all columns@footnote{In the current implementation a
3454
@code{floor(contrast-window-size / 2)} wide border around the images
3455
remains unprocessed and gets a weight of zero.} of each of the input
3456
images to compute the contrast weight of every pixel.
3458
@optionsummaryheading{}
3461
@item --contrast-weight
3462
@ref{Fusion Options}
3465
@ref{Fusion Options}
3467
@item --contrast-window-size
3468
@ref{Expert Options}
3470
@item --gray-projector
3471
@ref{Expert Options}
3475
@subsubsection Statistical Moments
3476
@cindex statistical moments
3478
@cindex probability function
3479
We start with the @dfn{probability function} @math{w} of the random
3480
variable@tie{}@math{X}:
3483
@math{w: x --> p(@{omega: X(omega) = x@})}.
3487
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
3493
<mo>→</mo>
3495
<mo>⁡</mo>
3504
<mo>⁡</mo>
3524
w: x \rightarrow p(\{\omega: X(\omega) = x\}).
3543
<mml:ci>ω</mml:ci>
3550
<mml:ci>ω</mml:ci>
3564
It associates a probability@tie{}@math{p} with each of the @math{n}
3565
different possible outcomes@tie{}@inlineomega{} of the random
3566
variable@tie{}@math{X}.
3567
@cindex expectation value
3568
Based on @math{w}, we define the @dfn{expectation value} or ``First
3569
Moment'' of the random variable@tie{}@math{X}:
3572
@math{Ex X := sum(x_i * w(x_i), i = 1..n).}
3576
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
3579
<mo mathvariant="sans-serif">Ex</mo>
3580
<mo>⁡</mo>
3600
<mo>⁡</mo>
3616
\hbox{\sf Ex } X := \sum_{i = 1}^n x_i w(x_i).
3626
<mml:mtext mathvariant="sans-serif">Ex</mml:mtext>
3672
Using the definition of the expectation value, we define the
3673
@dfn{variance}, or ``Second Moment'' as
3676
@math{Var X := Ex((X - Ex X)^2)},
3680
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
3682
<mo mathvariant="sans-serif">Var</mo>
3683
<mo>⁡</mo>
3688
<mo mathvariant="sans-serif">Ex</mo>
3689
<mo>⁡</mo>
3698
<mo mathvariant="sans-serif">Ex</mo>
3699
<mo>⁡</mo>
3713
\hbox{\sf Var } X := \hbox{\sf Ex}\left( (X - \hbox{\sf Ex } X)^2 \right),
3723
<mml:mtext mathvariant="sans-serif">Var</mml:mtext>
3740
<mml:mtext mathvariant="sans-serif">Ex</mml:mtext>
3749
<mml:mtext mathvariant="sans-serif">Ex</mml:mtext>
3762
@cindex standard deviation
3764
and the @dfn{standard deviation} as
3767
@math{Sdev X := sqrt(Var X)}.
3771
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
3775
<mo>⁡</mo>
3780
<mo mathvariant="sans-serif">Var</mo>
3781
<mo>⁡</mo>
3790
\sigma X := \sqrt{\hbox{\sf Var } X}.
3822
<mml:mtext mathvariant="sans-serif">Var</mml:mtext>
3832
Obviously, the variance of @math{X} is the expectation value of the
3833
squared deviation from the expectation value of @math{X} itself. Note
3834
that the variance's dimension is @math{X}'s dimension squared; the
3835
standard deviation rectifies the dimension to make it comparable with
3836
@math{X} itself again.
3839
@subsubsection Estimators
3842
In Enfuse, we assume that @math{X} follows a uniform probability
3843
function@tie{}@math{w(x)} = const. That is, all pixel values in the
3844
local analysis window are considered to be equally probable. Thus,
3845
the expectation value and the variance can be estimated from the pixel
3849
@math{Ex X = sum(x_i, i = 1..n) / n.}
3853
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
3856
<mo mathvariant="sans-serif">Ex</mo>
3857
<mo>⁡</mo>
3866
<mo>⁢</mo>
3889
\hbox{\sf Ex } X := {1 \over n} \sum_{i = 1}^n x_i.
3899
<mml:mtext mathvariant="sans-serif">Ex</mml:mtext>
3934
In other words: the expectation value is the arithmetic mean of the
3935
lightness of all pixels in the local analysis window. Analogously,
3936
the variance becomes
3939
@math{Var X = sum((x_i - Ex x)^2, i = 1..n) / (n - 1).}
3943
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
3946
<mo mathvariant="sans-serif">Var</mo>
3947
<mo>⁡</mo>
3959
<mo>⁢</mo>
3961
<mo mathvariant="sans-serif">Ex</mo>
3962
<mo>⁡</mo>
3971
<mo mathvariant="sans-serif">Ex</mo>
3972
<mo>⁡</mo>
3988
\hbox{\sf Var } X :=
3989
{1 \over {n - 1}} \, \hbox{\sf Ex}\left( (X - \hbox{\sf Ex } X)^2 \right).
3999
<mml:mtext mathvariant="sans-serif">Var</mml:mtext>
4016
<mml:mtext mathvariant="sans-serif">Ex</mml:mtext>
4025
<mml:mtext mathvariant="sans-serif">Ex</mml:mtext>
4040
@node Laplacian of Gaussian
4041
@subsection Laplacian of Gaussian
4042
@cindex weighting, contrast using laplacian-of--gaussian
4043
@cindex contrast weighting using laplacian-of--gaussian
4045
@cindex Laplacian of Gaussian (@acronym{LoG})
4046
The @dfn{Laplacian of Gaussian} (@acronym{LoG}) is an operator to
4047
detect edges in an image. Sometimes the @acronym{LoG}-operator is
4048
also called @sc{Marr}-@sc{Hildreth} operator. A Laplacian-of-Gaussian
4050
@uref{http://@/hci.iwr.uni-@/heidelberg.de/@/vigra/@/doc/@/vigra/@/group__@/Common@/Convolution@/Filters.html,
4051
@code{vigra::@/laplacian@/Of@/Gaussian}} is part of the
4052
package@tie{}@uref{http://@/hci.iwr.uni-@/heidelberg.de/@/vigra/,
4053
@acronym{VIGRA}} that Enfuse is built upon and is used for edge
4054
detection if option@tie{}@option{--contrast-edge-scale} is non-zero and
4055
@option{--contrast-min-curvature} equal to or less than zero.
4057
Let the Gaussian function be
4060
@math{g(x, y) = 1/pi * exp((x^2 + y^2) / (2 * sigma^2))/(2 * sigma^2)}
4064
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
4079
<mo>⁢</mo>
4081
<mo>⁢</mo>
4088
<mo>⁢</mo>
4090
<mo>⁡</mo>
4108
<mo>⁢</mo>
4124
{1 \over {2 \pi \sigma^2}} \,
4125
{\exp\left(-{{x^2 + y^2} \over {2 \sigma^2}}\right)}
4146
<mml:csymbol>π</mml:csymbol>
4149
<mml:ci>σ</mml:ci>
4178
<mml:ci>σ</mml:ci>
4192
The parameter@tie{}@inlinesigma{}, the argument of
4193
option@tie{}@option{--contrast-edge-scale}, is the length scale on which edges
4194
are detected by @math{g(x, y)}. We apply the Laplacian operator in
4195
Cartesian coordinates
4198
@math{Delta := Nabla o Nabla = (d^2/dx^2 + d^2/dy^2)}
4202
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
4210
<mo>·</mo>
4248
\bigtriangleup \equiv \nabla \cdot \nabla =
4249
{\partial^2 \over \partial x^2} + {\partial^2 \over \partial y^2}
4261
<mml:scalarproduct/>
4295
to @math{g(x, y)}, to arrive at a continuous representation of the
4296
two-dimensional filter kernel
4299
@math{k(x, y) = (xi^2 - 1) * exp(-xi^2) / (pi * sigma^4),}
4303
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
4325
<mo>⁢</mo>
4332
<mo>⁢</mo>
4334
<mo>⁡</mo>
4351
k(x, y) = {{\xi^2 - 1} \over {\pi \sigma^4}} \exp(-\xi^2),
4372
<mml:ci>ξ</mml:ci>
4379
<mml:csymbol>π</mml:csymbol>
4382
<mml:ci>σ</mml:ci>
4393
<mml:ci>ξ</mml:ci>
4404
where we have used the dimensionless distance@tie{}@inlinexi{} from
4408
@math{xi^2 = (x^2 + y^2) / (2 * sigma^2).}
4412
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
4436
<mo>⁢</mo>
4450
\xi^2 = {{x^2 + y^2} \over {2 \sigma^2}}.
4460
<mml:ci>ξ</mml:ci>
4483
<mml:ci>σ</mml:ci>
4494
Enfuse uses a discrete approximation of @math{k} in the convolution
4495
with the image. The operator is radially symmetric with respect to
4496
the origin, which is why we can easily plot it in
4497
@ref{Figure:laplacian-of-gaussian}, setting
4499
@math{R = sqrt(x^2 + y^2)}.
4502
<mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline">
4524
$R = \sqrt{x^2 + y^2}$.
4556
@float Figure,Figure:laplacian-of-gaussian
4557
@vimage{laplacian-of-gaussian}
4559
@caption{Laplacian-of-Gaussian function for @inlinesigma{} = 0.5.}
4561
@shortcaption{Laplacian-of-Gaussian}
4566
@uref{http://@/homepages.inf.ed.ac.uk/@/rbf/@/HIPR2/@/log.htm,
4567
@acronym{HIPR2}: Laplacian of Gaussian}.
4569
Sometimes the @acronym{LoG} is plagued by noise in the input images.
4570
After all, it is a numerical approximation of the second derivative
4571
and deriving always ``roughens'' a function. The (normalized) mask
4572
files relentlessly disclose such problems. Use
4573
option@tie{}@option{--contrast-min-curvature} with a @emph{negative}
4574
argument@tie{}@var{CURVATURE} to suppress all edges with a curvature
4575
below @minus{}@var{CURVATURE} (which is a positive value). Check the
4576
effects with the mask files and particularly the hard-mask files
4577
(@file{@value{src::default-hard-mask-template}}) if using
4578
option@tie{}@option{--hard-mask}.
4580
To indicate the @var{CURVATURE} in relative terms, which is
4581
particularly comprehensible for humans, append a percent sign
4582
(@samp{%}). Try minimum curvatures starting from @minus{}0.5% to
4585
@optionsummaryheading{}
4588
@item --contrast-weight
4589
@ref{Fusion Options}
4592
@ref{Fusion Options}
4594
@item --contrast-edge-scale
4595
@ref{Expert Options}
4597
@item --contrast-min-curvature
4598
@ref{Expert Options}
4601
@node Blend SDev and LoG
4602
@subsection Blend Standard Deviation and Laplacian of Gaussian
4603
@cindex weighting, contrast using a blend of methods
4604
@cindex contrast weighting using a blend of methods
4606
Enfuse can team the standard deviation computation and Laplacian of
4607
Gaussian to deliver the best of both methods. Use a @emph{positive}
4608
argument@tie{}@var{CURVATURE} with option@tie{}@option{--contrast-min-curvature}
4609
to combine both algorithms. In this mode of operation Enfuse computes
4610
the @acronym{SDev}-weight and the @acronym{LoG}-weight, then uses the
4611
@acronym{LoG} to decide whether to go with that value or prefer the
4612
@acronym{SDev} data. If the @acronym{LoG} is greater than
4613
@var{CURVATURE} Enfuse uses the weight delivered by the @acronym{LoG},
4614
otherwise the @acronym{SDev}-weight is rescaled such that its maximum
4615
is equal to @var{CURVATURE}, and the scaled @acronym{SDev} is used as
4618
This technique merges the two edge detection methods where they are
4619
best. The @acronym{LoG} excels with clear edges and cannot be fooled
4620
by strong but smooth gradients. However, it is bad at detecting faint
4621
edges and it is susceptible to noise. The @acronym{SDev} on the other
4622
hand shines with even the most marginal edges, and resists noise quite
4623
well. Its weakness is that is is easily deceived by strong and smooth
4624
gradients. Tuning @var{CURVATURE} the user can pick the best
4625
threshold for a given set of images.
4627
@optionsummaryheading{}
4630
@item --contrast-weight
4631
@ref{Fusion Options}
4634
@ref{Fusion Options}
4636
@item --contrast-window-size
4637
@ref{Expert Options}
4639
@item --gray-projector
4640
@ref{Expert Options}
4642
@item --contrast-edge-scale
4643
@ref{Expert Options}
4645
@item --contrast-min-curvature
4646
@ref{Expert Options}
4650
@node Scaling and Choice of Mode
4651
@subsection Scaling and Choice of Mode
4652
@cindex scaling of parameters
4653
@cindex mode of operation (@acronym{SDev}, @acronym{LoG}, @dots{})
4655
Experience has shown that neither the parameters @var{EDGESCALE} and
4656
@var{CURVATURE} nor the mode of operation (@acronym{SDev}-only,
4657
@acronym{LoG}-only, or a blend of both) scales to different image
4658
sizes. In practice, this means that if you start with a set of
4659
reduced size images, say 2808@classictimes{}1872 pixels, carefully
4660
optimize @var{EDGESCALE}, @var{CURVATURE} and so on, and find
4661
@acronym{LoG}-only the best mode, and then switch to the original
4662
resolution of 5616@classictimes{}3744 pixels, multiplying (or
4663
dividing) the parameters by four and sticking to @acronym{LoG}-only
4664
might @emph{not} result in the best fused image. For best quality,
4665
perform the parameter optimization and the search for the most
4666
appropriate mode at the final resolution.
4669
@node Local Entropy Weighting
4670
@section Local Entropy Weighting
4671
@cindex weighting, local entropy
4673
Entropy weighting prefers pixels inside a high entropy neighborhood.
4675
@cindex entropy, definition
4676
Let @math{S} be an @math{n}-ary source. Watching the output of
4677
@math{S} an observer on average gains the information
4680
@math{H_a(n) := sum(p(x) * log_a(1 / p(x)), x in S)}
4684
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
4691
<mo>⁡</mo>
4710
<mo>⁡</mo>
4722
<mo>⁡</mo>
4729
<mo>⁡</mo>
4746
H_a(n) := \sum_{x \in S} p(x) \log_a(1 / p(x))
4785
<mml:apply other='display="scriptstyle"'>
4803
per emitted message, where we assume the knowledge of the probability
4804
function@tie{}@math{p(S)}. The expectation value@tie{}@math{H_a(n)}
4805
is called @dfn{entropy} of the source@tie{}@math{S}. Entropy measures
4806
our uncertainty if we are to guess which message gets chosen by the
4807
source in the future. The unit of the entropy depends on the choice
4808
of the constant@tie{}@math{a > 1}. Obviously
4811
@math{H_b(n) = H_a(n) / log_a(b)}
4815
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
4822
<mo>⁡</mo>
4836
<mo>⁡</mo>
4849
<mo>⁡</mo>
4862
H_b(n) = H_a(n) / \log_a(b)
4902
holds for all @math{b > 1}. We use @math{a = 2} for entropy weighting
4903
and set the entropy of the ``impossible message'' to zero according to
4906
@math{lim(p * log_a(1 / p), p -> 0) = 0.}
4910
<math xmlns="http://www.w3.org/1998/Math/MathML" display="separate">
4917
<mo>→</mo>
4929
<mo>⁡</mo>
4948
\lim_{p \rightarrow 0} \, p \, \log_a(1 / p) = 0.
4991
@ref{Figure:entropy} shows an entropy function.
4993
@float Figure,Figure:entropy
4996
@caption{Entropy function@tie{}H for an experiment with exactly two outcomes.}
4998
@shortcaption{Entropy function}
5001
For more on (information) entropy visit
5002
@uref{http://@/en.wikipedia.org/@/wiki/@/Information_@/entropy,
5005
Enfuse computes a pixel's entropy by considering the pixel itself and
5006
its surrounding pixels quite similar to @ref{Local Contrast
5007
Weighting}. The size of the window is set by
5008
@option{--entropy-window-size}. Choosing the right size is difficult,
5009
because there is a serious tradeoff between the locality of the data
5010
and the size of the sample used to compute @math{H}. A large window
5011
results in a large sample size and therefore in a reliable entropy,
5012
but considering pixels far away from the center degrades @math{H} into
5013
a non-local measure. For small windows the opposite holds true.
5015
Another difficulty arises from the use of entropy as a weighting
5016
function in dark parts of an image, that is, in areas where the
5017
signal-to-noise ratio is low. Without any precautions, high noise is
5018
taken to be high entropy, which might not be desired. Use
5019
option@tie{}@option{--entropy-cutoff} to control the black level when
5020
computing the entropy.
5022
On the other extreme side of lightness, very light parts of an image,
5023
the sensor might already have overflown without the signal reaching
5024
1.0 in the normalized luminance interval. For these pixels the
5025
entropy is zero and Enfuse can be told of the threshold by properly
5026
setting the second argument of @option{--entropy-cutoff}.
5028
@optionsummaryheading{}
5031
@item --entropy-weight
5032
@ref{Fusion Options}
5034
@item --entropy-window-size
5035
@ref{Expert Options}
5037
@item --entropy-cutoff
5038
@ref{Expert Options}
5042
@node Understanding Masks
5043
@chapter Understanding Masks
5044
@cindex understanding masks
5045
@cindex masks, understanding
5047
@include understanding-masks.texi
5050
@node Tuning Memory Usage
5051
@chapter Tuning Memory Usage
5052
@cindex memory, tuning usage of
5056
@include tuning-memory-usage.texi
5060
@chapter Applications of Enfuse
5061
@cindex applications of enfuse
5063
This section describes some of the novel possibilities that Enfuse
5064
offers the photographer. In contrast to the previous chapters, it
5065
centers around the image effects.
5068
* What Images:: What makes images fusable?
5069
* Repetition:: Just taking the same shot multiple times
5070
* Exposure Series:: Varying the exposure time
5071
* Flash Exposure Series:: Varying the flash output
5072
* Polarization Series:: Changing the polarizer angle
5073
* Focus Stacks:: Stacking images with different in-focus distance
5077
@section What Makes Images Fusable?
5078
@cindex images, fusable
5080
Images should align well to be suitable for fusion. However, there is
5081
no hard mathematical rule what ``well'' means. The alignment
5082
requirements for 16@dmn{MPixel} images to yield a sharp
5083
4"@classictimes{}6" print at 300@dmn{dpi} (``dpi'' means dots per
5084
inch) or even for web presentation are relatively low, whereas the
5085
alignment of 8@dmn{MPixel} images for a 12"@classictimes{}18" print
5089
If the input images need to be aligned, Hugin (@pxref{Helpful
5090
Programs}) is the tool of choice. It produces images exactly in the
5091
format that Enfuse expects.
5093
Sometimes images naturally align extremely well so that no
5094
re-alignment is required. An image series with preprogrammed exposure
5095
steps taken in rapid succession where the camera is mounted on a heavy
5096
tripod and a humongous ball head, mirror lockup, and a cable release
5097
are used, comes to mind.
5099
When in doubt about what will work, try it, and judge for yourself.
5102
Useful ideas for a good alignment:
5106
Fix all camera parameters that are not explicitly varied.
5110
Engage full manual (@key{M}) or aperture-priority (@key{A}) mode.
5113
Disable ``Auto Focus''. Be aware that the auto-focus function could
5114
be linked to shutter-release button position ``half pressed'' or to
5115
the shutter release in insidious ways.
5117
@item Closed eyepiece
5118
(This applies only to single lens reflex cameras.) Close the eyepiece
5119
when using a cable release to suppress variations in stray light.
5121
@item Exposure time/Shutter speed
5122
Use the shortest possible exposure time or, in other words, use the
5123
fastest shutter speed to avoid blur caused by camera shake or motion
5127
Explicitly control the flash power of @emph{all} flashes. This is
5128
sometimes called ``flash exposure lock''.
5131
Disable ``Auto @acronym{ISO}''.
5134
Disable ``Auto White Balance''. Instead, use the most suitable fixed
5135
white balance or take the white balance off a white card. When in
5136
doubt, use the setting ``Daylight'' or equivalent.
5140
Steady the camera by any means.
5144
Apply your best camera bracing technique combined with controlled
5148
Prefer a monopod, or better, a rigid tripod with a heavy head.
5151
Use a cable release if possible.
5154
(This applies to cameras with a moving mirror only.) Engage ``mirror
5158
Consider automatic bracketing when applicable.
5161
Activate camera- or lens-based image stabilization if you are sure
5162
that it improves the image quality in your particular case; otherwise
5163
disengage the feature.
5165
For some lens-based image stabilization systems, it is known that they
5166
``lock'' into different positions every time they are activated.
5167
Moreover, some stabilization systems decrease the image quality when
5168
the lens is mounted on a tripod.
5172
Fire in rapid succession.
5175
@c http://www.usa.canon.com/dlc/controller?act=GetArticleAct&articleID=1786
5179
@section Repetition -- Noise Reduction
5180
@cindex simple series
5181
@cindex series, simple
5182
@cindex noise reduction
5184
@mainpurpose Reduce noise
5187
With the default settings, Enfuse computes a weighted average of the
5188
input pixels. For a series of images, repeated with identical
5189
settings, this results in a reduction of (photon shot) noise. In
5190
other words, the dynamic range increases slightly, because the higher
5191
signal-to-noise ratio makes darker shades usable. Furthermore, smooth
5192
or glossy surfaces get a ``cleaner'' look, and edges become visually
5193
sharper. The nitty-gritty reportage look that sometimes stems from a
5194
high sensitivity setting disappears.
5196
Averaged images, and therefore low-noise images, are the base for a
5197
multitude of techniques like, for example, differences. The most
5198
prominent method in this class is dark-frame subtraction.
5201
@samp{--exposure-weight=@value{src::default-weight-exposure}} and
5202
@samp{--saturation-weight=@value{src::default-weight-saturation}}.
5203
Eliminating the saturation component with @samp{--saturation-weight=0.0} can
5204
be worth an extra run.
5207
@node Exposure Series
5208
@section Exposure Series -- Dynamic Range Increase
5209
@cindex exposure series
5210
@cindex series, exposure
5211
@cindex dynamic range increase
5213
@mainpurpose Increase manageable dynamic range
5216
An exposure series is a set of images taken with identical parameters
5217
except for the exposure time. Some cameras even provide special
5218
functions to automate recording exposure series. See the instruction
5219
manual of your model for details.
5222
@samp{--exposure-weight=@value{src::default-weight-exposure}} and
5223
@samp{--saturation-weight=@value{src::default-weight-saturation}} are
5224
well suited for fusion of @emph{color} images. Remember that
5225
saturation weighting only works for @acronym{RGB} data.
5226
Option@tie{}@option{--saturation-weight} helps to control burnt-out
5227
highlights, as these are heavily desaturated. Alternatively, use
5228
option@tie{}@option{--exposure-cutoff} to suppress noise or blown-out
5229
highlights without altering the overall brightness too much. If no
5230
image suffers from troublesome highlights, the relative saturation
5231
weight can be reduced and even be set to zero.
5233
For black and white images @option{--entropy-weight} can be an
5234
alternative to @option{--saturation-weight} because it suppresses
5235
overexposed pixels, as these contain little information. However,
5236
entropy weighting is not limited to gray-scale data; it has been
5237
successfully applied to @acronym{RGB} images, too. Note that entropy
5238
weighting considers @emph{each} color channel of an @acronym{RGB}
5239
image separately and chooses the channel with the minimum entropy as
5240
representative for the whole pixel.
5242
Enfuse offers the photographer tremendous flexibility in fusing
5243
differently exposed images. Whether you combine only two pictures or
5244
a series of 21, Enfuse imposes no limits on you. Accordingly, the
5245
photographic effects achieved range from subtle to surreal, like the
5246
late 1980s ``Max Headroom'' @acronym{TV}-Series, to really unreal.
5247
Like some time ago in the chemical days of photography, when a new
5248
developer opened unseen possibilities for artists, exposure fusion
5249
extends a photographer's expressive space in the digital age. Whether
5250
the results look good or bad, whether the images are dull or exciting,
5251
is entirely up the artist.
5253
In the next sections we give assistance to starters, and rectify
5254
several misconceptions about Enfuse.
5257
* Exposure Series Tips:: Some hints for beginners
5258
* Exposure Series Misconceptions:: What works despite the hype
5262
@node Exposure Series Tips
5263
@subsection Tips For Beginners
5264
@cindex exposure series, tips for beginners
5266
Here are some tips to get you in business quickly.
5269
@item Include the best single exposure.
5270
Include the exposure you would have taken if you did not use Enfuse in
5271
your series. It gives you a solid starting point. Think of the other
5272
images as augmenting this best single exposure to bring out the light
5273
and dark features you would like to see.
5275
@item Begin with as small a number of images as possible.
5276
Pre-visualizing the results of Enfuse is difficult. The more images
5277
put into the fusion process and the wider their @acronym{EV}-spacing
5278
is, the more challenging visualizing the output image becomes.
5279
Therefore, start off with as few images as possible.
5281
You can take a larger series of images and only use part of it.
5283
@item Start with a moderate @acronym{EV}-spacing.
5284
As has been pointed out in the previous item, a wide
5285
@acronym{EV}-spacing makes pre-visualization harder. So start out
5286
with a spacing of 2/3@dmn{EV} to 1+1/3@dmn{EV}.
5290
@node Exposure Series Misconceptions
5291
@subsection Common Misconceptions
5292
@cindex exposure series, common misconceptions
5294
Here are some surprisingly common misconceptions about exposure
5298
@item A single image cannot be the source of an exposure series.
5299
@cindex digital blending
5300
@cindex blending exposures
5301
Raw-files in particular lend themselves to be converted multiple times
5302
and the results being fused together. The technique is simpler,
5303
faster, and usually even looks better than
5304
@uref{http://@/luminous-@/landscape.com/@/tutorials/@/digital-@/blending.shtml,
5305
digital blending} (as opposed to using a graduated neutral density
5307
@uref{http://@/www.gimpguru.org/@/Tutorials/@/Blending@/Exposures/,
5308
blending exposures} in an image manipulation program. Moreover,
5309
perfect alignment comes free of charge!
5311
@item An exposure series must feature symmetrically-spaced exposures.
5312
Twice wrong! Neither do the exposures have to be ``symmetric'' like
5313
@{0@dmn{EV}, @minus{}2/3@dmn{EV}, +2/3@dmn{EV}@}, nor does the number
5314
of exposures have to be odd. Series like
5315
@{@minus{}1@minus{}1/3@dmn{EV}, @minus{}1/3@dmn{EV}, +1/3@dmn{EV}@} or
5316
@{@minus{}1@dmn{EV}, 1@dmn{EV}@} might be just right. By the way, the
5317
order in which the images were taken does not matter either.
5319
@item An exposure series must cover the whole dynamic range of the scene.
5321
If you do not want to cover the whole range, you do not have to. Some
5322
@acronym{HDR} programs require the user to take a light
5323
probe,@footnote{@uref{http://@/www.debevec.org/, Paul E.@tie{}Debevec}
5324
defines: ``A @dfn{light probe} image is an omnidirectional, high
5325
dynamic range image that records the incident illumination conditions
5326
at a particular point in space.''} whereas Enfuse offers the user
5327
complete freedom of exposure.
5329
@item All exposure values must be different.
5330
You can repeat any exposure as often as you like. That way you
5331
combine an exposure series with parts of @ref{Repetition}, emphasizing
5332
the multiply occuring exposures and reducing noise.
5336
@node Flash Exposure Series
5337
@section Flash Exposure Series -- Directed Lighting
5338
@cindex flash exposure series
5339
@cindex series, flash exposure
5340
@cindex dynamic range increase
5347
@node Polarization Series
5348
@section Polarization Series -- Saturation Enhancement
5349
@cindex polarization series
5350
@cindex series, polarization
5351
@cindex saturation enhancement
5353
@mainpurpose Reflection suppression, saturation enhancement
5355
In the current implementation of Enfuse, it is not possible in general
5356
to fuse a polarization series. Naively abusing
5357
@option{--saturation-weight} will not work.
5361
@section Focus Stacks -- Depth-of-Field Increase
5362
@cindex focus stacks
5363
@cindex depth-of-focus increase
5365
@mainpurpose Synthetic Depth-of-Field Increase
5367
A @dfn{focus stack} is a series of images where the distance of the
5368
focal plane from the sensor varies. Sloppily speaking, the images
5369
were focussed at different distances. Fusing such a stack increases
5370
the depth-of-field (@acronym{DOF}) beyond the physical limits of
5374
* Why Focus Stacks:: Why take the hassle?
5375
* Preparing Focus Stacks:: How to get suitable input images
5376
* Local Contrast Based Fusing:: Fundamental command line options
5377
* Basic Focus Stacking:: Simple, standard deviation method
5378
* Advanced Focus Stacking:: Advanced, Laplacian technique
5379
* Expert Stacking:: Tips for focus stacking experts
5383
@node Why Focus Stacks
5384
@subsection Why create focus stacks?
5385
@cindex focus stacks, why create them
5391
a fixed sensor or film size,
5393
a lens' particular focal length, and
5395
@cindex circle-of-confusion
5396
a notion about ``sharpness'', technically speaking the size of the
5397
circle-of-confusion (@acronym{CoC})
5400
@cindex depth-of-field
5402
the photographer controls the depth-of-field with the aperture.
5403
Smaller apertures -- this is larger aperture numbers -- increase the
5404
@acronym{DOF} and vice versa. However, smaller apertures increase
5405
diffraction which in turn renders the image unsharp. So, there is an
5406
optimum aperture where the photographer gets maximum @acronym{DOF}.
5407
Sadly, for some purposes like macro shots it is not enough. One way
5408
out is to combine the sharp parts of images focused at different
5409
distances, thereby artificially increasing the total @acronym{DOF}.
5410
This is exactly what Enfuse can do.
5412
@cindex sweet spot aperture
5413
@cindex aperture, sweet spot
5414
All lenses have a so called ``sweet spot'' aperture, where their
5415
resolution is best. Taking pictures at this aperture, the
5416
photographer squeezes the maximum quality out of the lens. But: the
5417
``sweet spot'' aperture often is only one or two stops away from wide
5418
open. Wouldn't it be great to be able combine these best-possible
5419
images to form one high-quality, sufficient-@acronym{DOF} image?
5420
Welcome to Enfuse's local-contrast selection abilities.
5423
@node Preparing Focus Stacks
5424
@subsection Preparing Focus Stacks
5425
@cindex focus stacks, preparation
5427
We are going to combine images with limited @acronym{DOF} to increase
5428
their in-focus parts. The whole process is about image sharpness.
5429
Therefore, the input images must align very well, not just well, but
5430
very well. For optimum results the maximum control point distance in
5431
Hugin (@pxref{Helpful Programs}) should not exceed
5432
0.3--0.5@dmn{pixels} to ensure perfect blending.
5434
As in all image fusion operations it is preferable to use 16@dmn{bit}
5435
linear (gamma = 1) images throughout, but 8@dmn{bit} gamma encoded
5436
images will do. Naturally, high @acronym{SNR} input data always is
5440
@node Local Contrast Based Fusing
5441
@subsection Local Contrast Based Fusing
5442
@cindex local-contrast-based fusing
5443
@cindex fusing, local-contrast-based
5444
@cindex focus stacks, fusing
5446
A bare bones call to Enfuse for focus stacking could look like this.
5450
--exposure-weight=0 \
5451
--saturation-weight=0 \
5452
--contrast-weight=1 \
5455
--output=output.tif \
5456
input-<0000-9999>.tif
5460
Here is what each option causes:
5463
@item --exposure-weight=0
5464
Switch @strong{off} exposure based pixel selection. The default
5465
weight is @value{src::default-weight-exposure}.
5467
@item --saturation-weight=0
5468
Switch @strong{off} saturation based pixel selection. The default
5469
weight is @value{src::default-weight-saturation}.
5471
@item --contrast-weight=1
5472
Switch @strong{on} pixel selection based on local contrast.
5475
Select the best pixel from the image stack and ignore all others.
5476
Without this option, Enfuse uses all pixels in the stack and weights
5477
them according to their respective quality, which in our case is local
5478
contrast. Without @option{--hard-mask}, the result will always look a
5479
bit soft. @xref{Local Contrast Weighting}.
5483
If you want to see some entertaining progress messages --
5484
local-contrast weighting takes a while --, also pass the
5485
@option{--verbose}@tie{}option for a verbose progress report.
5488
@node Basic Focus Stacking
5489
@subsection Basic Focus Stacking
5490
@cindex basic focus stacking
5491
@cindex focus stacking, basic
5493
For a large class of image stacks Enfuse's default algorithm, as
5494
selected in @ref{Local Contrast Based Fusing}, to determine the
5495
sharpness produces nice results. The algorithm uses a moving square
5496
window, the so-called contrast window. It computes the standard
5497
deviation of the pixels inside of the window. The program then
5498
selects the window's center pixel of the image in the stack where the
5499
standard deviation is largest, that is, the local contrast reaches the
5502
However, the algorithm fails to deliver good masks for images which
5503
exhibit high contrast edges on the scale of the contrast window size.
5504
The typical artifacts that show up are
5508
faint dark seams on the light side of the high contrast edges and
5511
extremely soft, slightly lighter seams on the dark side of the high
5516
where the distance of the seams from the middle of the edge is
5517
comparable to the contrast window size.
5519
If your results do not show any of these artifacts, stick with the
5520
basic algorithm. Advanced focus stacking, as described in the next
5521
sections, delivers superior results in case of artifacts, though
5522
requires manually tuning several parameters.
5525
@node Advanced Focus Stacking
5526
@subsection Advanced Focus Stacking
5527
@cindex advanced focus stacking
5528
@cindex focus stacking, advanced
5530
If your fused image shows any of the defects described in the previous
5531
section, you can try a more difficult-to-use algorithm that
5532
effectively works around the seam artifacts. It is described in the
5536
* Local Contrast Problem:: What is the problem Kenneth?
5537
* Laplacian Edge Detection:: Using a Laplacian-of-Gaussian to detect edges
5538
* Local Contrast Enhancement:: Boosting local contrast before weighting
5539
* Suppressing Noise or Recognizing Faint Edges:: The best of both worlds
5540
* Focus Stacking Decision Tree:: What to do and how to fuse
5544
@node Local Contrast Problem
5545
@subsubsection A Detailed Look at the Problem
5546
@cindex local contrast problem
5547
@cindex problem, local contrast
5549
Let us use an example to illustrate the problem of relating the
5550
sharpness with the local contrast variations. Say we use a
5551
5@classictimes{}5 contrast window. Moreover, let @code{sharp_edge}
5552
and @code{smooth_edge} be two specific configurations:
5555
sharp_edge = [ 0, 0, 200, 0, 0;
5563
smooth_edge = [ 0, 62, 125, 187, 250;
5564
1, 63, 126, 188, 251;
5565
2, 65, 127, 190, 252;
5566
3, 66, 128, 191, 253;
5567
5, 67, 130, 192, 255]
5570
where @samp{;} separates the rows and @samp{,} separates the columns.
5571
This is in fact @uref{http://@/www.gnu.org/@/software/@/octave/,
5574
@ref{Figure:sharp-edge} and @ref{Figure:smooth-edge} show plots of the
5575
matrices @code{sharp_edge} and @code{smooth_edge}.
5577
@float Figure,Figure:sharp-edge
5580
@caption{3D plot augmented by contour plot of the matrix@tie{}@code{sharp_edge}.}
5582
@shortcaption{Sharp edge}
5585
@float Figure,Figure:smooth-edge
5586
@vimage{smooth-edge}
5588
@caption{3D plot augmented by contour plot of the matrix@tie{}@code{smooth_edge}.}
5590
@shortcaption{Smooth edge}
5594
Our intuition lets us ``see'' an extremely sharp edge in the first
5595
matrix, whereas the second one describes an extraordinarily smooth
5596
diagonal intensity ramp. Which one will be selected? Well,
5597
@code{sharp_edge} has a standard deviation of 88.07 and
5598
@code{smooth_edge} has 88.41. Thus, @code{smooth_edge} wins,
5599
contradicting our intuition, and even worse, our intention!
5601
Sadly, configurations like @code{smooth_edge} occur more often with
5603
@uref{http://@/www.luminous-@/landscape.com/@/essays/@/bokeh.shtml,
5604
bokeh} lenses. In fact, they are the very manifestation of ``good
5605
bokeh''. Therefore, Laplacian edge detection plays an important role
5606
when working with high-quality lenses.
5609
@node Laplacian Edge Detection
5610
@subsubsection Laplacian Edge Detection
5611
@cindex laplacian edge detection
5612
@cindex edge detection, laplacian
5614
Enfuse provides a Laplacian-based algorithm that can help in
5615
situations where weighting based on the standard deviation fails. It
5616
is activated with a positive value for @var{SCALE} in
5617
@code{--contrast-edge-scale}=@/@var{SCALE}. The Laplacian will detect
5618
two-dimensional @emph{curvature} on the scale of @var{SCALE}. Here
5619
and in the following we simply speak of ``curvature'' where we mean
5620
``magnitude of curvature''. That is, we shall not distinguish between
5621
convex and concave edges. Enfuse always use the magnitude of
5622
curvature for weighting.
5624
Typically, @var{SCALE} ranges between 0.1@dmn{pixels} and
5625
0.5@dmn{pixels}, where 0.3@dmn{pixels} is a good starting point. To
5626
find the best value for @var{SCALE} though, usually some
5627
experimentation will be necessary. Use @option{--save-masks} to get
5628
all soft-mask (default:
5629
@file{@value{src::default-soft-mask-template}}) and hard-mask files
5630
(default: @file{@value{src::default-hard-mask-template}}). Check how
5631
different scales affect the artifacts. Also @pxref{Understanding
5635
@node Local Contrast Enhancement
5636
@subsubsection Local Contrast Enhancement
5637
@cindex local contrast enhancement
5638
@cindex contrast enhancement, local
5640
Sometimes Enfuse misses smoother edges with
5641
@option{--contrast-edge-scale} and a little local contrast enhancement
5642
(@acronym{LCE}) helps. Set
5643
@code{--contrast-edge-scale}=@/@var{SCALE}:@/@var{LCE-SCALE}:@/@var{LCE-FACTOR}.
5644
where @var{LCE-SCALE} and @var{LCE-FACTOR} work like the
5645
@uref{http://@/www.cambridgeincolour.com/@/tutorials/@/unsharp-@/mask.htm,
5646
unsharp mask} filters in various image manipulation programs. Start
5647
with @var{LCE-SCALE} ten times the value of @var{SCALE} and a
5648
@var{LCE-FACTOR} of 2--5.
5650
@var{LCE-SCALE} can be specified as a percentage of @var{SCALE}.
5651
@var{LCE-FACTOR} also can be specified as a percentage. Examples:
5654
--contrast-edge-scale=0.3:3.0:3
5655
--contrast-edge-scale=0.3:1000%:3.0
5656
--contrast-edge-scale=0.3:3:300%
5657
--contrast-edge-scale=0.3:1000%:300%
5661
By default @acronym{LCE} is turned off.
5664
@node Suppressing Noise or Recognizing Faint Edges
5665
@subsubsection Suppressing Noise or Recognizing Faint Edges
5666
@cindex advanced focus stacking, suppressing noise
5667
@cindex advanced focus stacking, recognizing faint edges
5669
The Laplacian-based algorithm is much better at resisting the seam
5670
problem than the local-contrast algorithm, but it has two
5675
The Laplacian is very susceptible to noise and
5677
it fails to recognize faint edges.
5681
The @option{--contrast-min-curvature} option helps to mitigate both
5684
The argument to @code{--contrast-min-curvature}=@var{CURVATURE} either
5685
is an absolute lightness value, for example 0..255 for 8@dmn{bit} data
5686
and 0..65535 for 16@dmn{bit} data, or, when given with a @samp{%}-sign
5687
it is a relative lightness value ranging from 0% to 100%.
5689
To suppress unreal edges or counter excessive noise, use the
5690
@option{--contrast-min-curvature} option with a @emph{negative}
5691
curvature measure @var{CURVATURE}. This forces all curvatures less
5692
than @minus{}@var{CURVATURE} to zero.
5694
A @emph{positive} curvature measure @var{CURVATURE} makes Enfuse merge
5695
the @acronym{LoG} data with the local-contrast data. Every curvature
5696
larger than or equal to @var{CURVATURE} is left unchanged, and every
5697
curvature less than @var{CURVATURE} gets replaced with the rescaled
5698
local-contrast data, such that the largest local contrast is just
5699
below @var{CURVATURE}. This combines the best parts of both
5700
techniques and ensures a precise edge detection over the whole range
5707
@item -@/-contrast-edge-scale=0.3
5708
Use @acronym{LoG} to detect edges on a scale of 0.3@dmn{pixels}.
5709
Apply the default grayscale projector: @code{average}.
5711
@item -@/-contrast-edge-scale=0.3 -@/-gray-projector=l-star
5712
Use @acronym{LoG} to detect edges on a scale of 0.3@dmn{pixels}.
5713
Apply the L*-grayscale projector.
5715
@item -@/-contrast-edge-scale=0.3:3:300%
5716
Use @acronym{LoG} to detect edges on a scale of 0.3@dmn{pixels},
5717
pre-sharpen the input images by 300% on a scale of 3@dmn{pixels}.
5718
Apply the default grayscale projector: @code{average}.
5720
@item -@/-contrast-edge-scale=0.3 -@/-contrast-min-curvature=@minus{}0.5%
5721
Use @acronym{LoG} to detect edges on a scale of 0.3@dmn{pixels}.
5722
Apply the default grayscale projector: @code{average} and throw away
5723
all edges with a curvature of less than 0.5%.
5725
@item -@/-contrast-edge-scale=0.3 -@/-contrast-min-curvature=0.5% -@/-contrast-window-size=7
5726
Use @acronym{LoG} to detect edges on a scale of 0.3@dmn{pixels}.
5727
Apply the default grayscale projector: @code{average} and throw away
5728
all edges with a curvature of less than 0.5% and replace the
5729
@acronym{LoG} data between 0% and 0.5% with @acronym{SDev} data. Use
5730
a window of 7@classictimes{}7@dmn{pixel} window to compute the
5736
@node Focus Stacking Decision Tree
5737
@subsubsection Focus Stacking Decision Tree
5738
@cindex focus stacking decision tree
5739
@cindex decision tree, focus stacking
5741
@ref{Figure:focus-stacking-decision-tree} helps the user to arrive at
5742
a well-fused focus stack with as few steps as possible.
5744
@float Figure,Figure:focus-stacking-decision-tree
5745
@vimage{focus-stack-decision-tree}
5747
@caption{Focus stacking decision tree.}
5749
@shortcaption{Focus stacking decision tree}
5752
Always start with the default, contrast weighting with a local
5753
contrast window. Only if seams appear as described in @ref{Advanced
5754
Focus Stacking} switch to Laplacian-of-Gaussian contrast detection.
5756
If some seams remain even in @acronym{LoG}-mode, decrease the
5757
sensitivity of the edge detection with a positive
5758
@option{--contrast-min-curvature}. A too high value of
5759
@option{--contrast-min-curvature} suppresses fine detail though. Part
5760
of the detail can be brought back with pre-sharpening, that is,
5761
@ref{Local Contrast Enhancement} or combining @acronym{LoG} with
5762
local-contrast-window mode by using a negative
5763
@option{--contrast-min-curvature}.
5765
Carefully examining the masks (option@tie{}@option{--save-masks}) that
5766
Enfuse uses helps to judge the effects of the parameters.
5769
@node Expert Stacking
5770
@subsection Tips For Focus Stacking Experts
5771
@cindex expert focus stacking tips
5772
@cindex tips, focus stacking experts
5774
We have collected some advice with which even focus-stacking adepts
5779
@cindex sensor, use of clean
5780
Ensure that the sensor is clean.
5782
Aligning focus stacks requires varying the viewing angle, which
5783
corresponds to a changing focal length. Hence, the same pixel on the
5784
sensor gets mapped onto different positions in the final image. Dirt
5785
spots will occur not only once but as many times as there are images
5786
in the stack -- something that is no fun to correct in postprocessing.
5789
@cindex subtraction of dark frame
5792
Along the same lines, the photographer may want to consider to prepare
5793
dark frames before, and possibly also after, the shoot of the focus
5794
stack, to subtract hot pixels before fusion.
5797
@opindex --hard-mask
5798
Prefer a low-sensitivity setting (``@acronym{ISO}'') on the camera to
5799
get low-noise images.
5801
Fusing with @option{--hard-mask} does not average, and thus does not
5802
suppress any noise in the input images.
5805
If the transition of in-focus to out-of-focus areas is too abrupt,
5806
record the images with closest and farthest focusing distances twice:
5807
first with the intended working aperture, and a second time with a
5808
small aperture (large aperture number).
5810
@cindex natural sharp-unsharp transition
5811
@cindex transition, natural sharp-unsharp
5812
The small aperture will give the fused image a more natural in-focus
5813
to out-of-focus transition and the working-aperture shots supply the
5814
detail in the in-focus regions.
5818
@node Helpful Programs
5819
@chapter Helpful Additional Programs
5820
@cindex helpful programs
5821
@cindex programs, helpful additional
5823
@include helpful-programs.texi
5827
@appendix Bug Reports
5830
@include bug-reports.texi
5835
@cindex authors, list of
5837
@include authors.texi
5841
@appendix @acronym{GNU} Free Documentation License
5842
@cindex free documentation license (@acronym{FDL})
5843
@cindex @acronym{GNU} free documentation license
5852
@c The List-of-Tables and List-of-Figures go right before the indices
5853
@c in all formats but TeX. For the TeX output they appear right after
5854
@c the Table-of-Contents.
5857
@node List of Tables
5858
@unnumbered List of Tables
5862
@node List of Figures
5863
@unnumbered List of Figures
5864
@listoffloats Figure
5869
@unnumbered Program Index
5870
@cindex program index
5871
@cindex index, program
5876
@node Syntactic-Comment Index
5877
@unnumbered Syntactic-Comment Index
5878
@cindex syntactic-comment index
5879
@cindex index, syntactic-comment
5885
@unnumbered Option Index
5886
@cindex option index
5887
@cindex index, option
5893
@unnumbered General Index
5894
@cindex general index
5895
@cindex index, general