This manual is for Enfuse (version 4.0-753b534c819d, 4 December 2009), a program to merge different exposures of the same scene to produce an image that looks much like a tonemapped image.
Enfuse merges overlapping images using the Mertens-Kautz-Van Reeth exposure fusion algorithm.1 This is a quick way for example to blend differently exposed images into a nice output image, without producing intermediate high-dynamic range (HDR) images that are then tonemapped to a viewable image. This simplified process often works much better than tonemapping algorithms.
Enfuse can also be used to build extended depth-of-field (DOF) images by blending a focus stack.
The idea is that pixels in the input images are weighted according to qualities such as, for example, proper exposure, good local contrast, or high saturation. These weights determine how much a given pixel will contribute to the final image.
A Burt-Adelson multiresolution spline blender2 is used to combine the images according to the weights. The multiresolution blending ensures that transitions between regions where different images contribute are difficult to spot.
Enfuse uses up to four criteria to judge the quality of a pixel, which Table:weighting-criteria briefly describes.
Table 1.1: Enfuse's four weighting criteria.
For the concept of pixel weighting, and details on the different weighting functions, see Weighting Functions.
Adjust how much importance is given to each criterion by setting the weight parameters on the command line. For example, if you set ‘--exposure-weight=1.0’ and ‘--saturation-weight=0.5’, Enfuse will favor well-exposed pixels over highly-saturated pixels when blending the source images. The effect of these parameters on the final result will not always be clear in advance. The quality of the result is subject to your artistic interpretation. Playing with the weights may or may not give a more pleasing result. The authors encourage you to experiment, perhaps using down-sized3 or cropped images for speed.
Enfuse expects but does not require each input image to have an alpha channel. By setting the alpha values of pixels to zero, users can manually remove those pixels from consideration when blending. If an input image lacks an alpha channel, Enfuse will issue a warning and continue assuming all pixels should contribute to the final output. Any alpha value other than zero is interpreted as “this pixel should contribute to the final image”.
Enfuse reads all layers of multi-layer images, like, for example, multi-directory TIFF images4. The input images are processed in the order they appear on the command line. Multi-layer images are processed from the first layer to the last before Enfuse considers the next image on the command line.
Find out more about Enfuse on its SourceForge web page.
Enblend and Enfuse are parts of a chain of tools to assemble images.
Figure:photographic-workflow shows where Enblend and Enfuse sit in this tool chain.
There is one exception with Enfuse when a single raw image is
converted multiple times to get several – typically differently
“exposed” – images.
Exemplary Benefits
Remaining Problem: The “overlayed” images may not fit together, that is the overlay regions may not match exactly.
Again there is one exception and this is when images naturally align.
For example, a series of images taken from a rock solid tripod with a
cable release without touching the camera, or images taken with a
shift lens, can align without further user intervention.
This step submits the images to affine transformations. If necessary, it rectifies the lens' distortions (e.g. barrel or pincushion), too. Sometimes even luminance or color differences between pairs of overlaying images are corrected (“photometric alignment”).
Benefit: The overlay areas of images match as closely as possible given the quality if the input images and the lens model used in the transformation.
Remaining Problem: The images may still not align perfectly, for example, because of parallax errors, or blur produced by camera shake.
Benefit: The overlay areas become imperceptible for all but the most mal-aligned images.
Remaining Problem: Enblend and Enfuse write images with an alpha channel. (For more information on alpha channels see Understanding Masks.) Furthermore, the final image rarely is rectangular.
View
Enjoy
enfuse [OPTIONS] [--output=IMAGE] INPUT...
Fuse the sequence of images INPUT... into a single IMAGE.
Input images are either specified literally or via so-called response files (see below). The latter are an alternative to specifying image filenames on the command line.
A response file contains names of images or other response filenames. Introduce response file names with an at-character (‘@’).
Enblend and Enfuse process the list INPUT strictly from left to right, expanding response files in depth-first order. (Multi-layer files are processed from first layer to the last.) The following examples only show Enblend, but Enfuse works exactly the same.
enblend image-1.tif image-2.tif image-3.tif
The ultimate order in which the images are processed is: image-1.tif, image-2.tif, image-3.tif.
enblend @list
where file list contains
img1.exr
img2.exr
img3.exr
img4.exr
Ultimate order: img1.exr, img2.exr, img3.exr, img4.exr.
enblend @master.list image-09.png image-10.png
where file master.list comprises of
image-01.png
@first.list
image-04.png
@second.list
image-08.png
first.list is
image-02.png
image-03.png
and second.list contains
image-05.png
image-06.png
image-07.png
Ultimate order: image-01.png, image-02.png, image-03.png, image-04.png, image-05.png, image-06.png, image-07.png, image-08.png, image-09.png, image-10.png,
Response files contain one filename per line. Blank lines or lines beginning with a sharp sign (‘#’) are ignored; the latter can serve as comments. Filenames that begin with an at-character (‘@’) denote other response files. Table:response-file-format states a formal grammar of response files in EBNF.
| response-file | ::= | line* |
| line | ::= | (comment | file-spec) [‘\r’] ‘\n’ |
| comment | ::= | space* ‘#’ text |
| file-spec | ::= | space* ‘@’ filename space* |
| space | ::= | ‘ ’ | ‘\t’ |
where text is an arbitrary string and filename is any filename.
Table 3.1: EBNF definition of the grammar of response files.
In a response file relative filenames are used relative the response file itself, not relative to the current-working directory of the application.
The above grammar might unpleasantly surprise the user in the some ways.
# exposure series
img-0.33ev.tif # "middle" EV
img-1.33ev.tif
img+0.67ev.tif
only the first line contains a comment, whereas the second line includes none. Rather, it refers to a file called ‘img-0.33ev.tif # "middle" EV’.
If Enblend or Enfuse do not recognize a response file, they will skip the file and issue a warning. To force a file being recognized as a response file add one of the following syntactic comments to the first line of the file.
response-file: true
enblend-response-file: true
enfuse-response-file: true
Finally, here is an example of a valid response file.
# 4\pi panorama!
# These pictures were taken with the panorama head.
@round-shots.list
# Freehand sky shot.
zenith.tif
# "Legs, will you go away?" images.
nadir-2.tif
nadir-5.tif
nadir.tif
Comments that follow the format described in Table:response-file-syntactic-comment are treated as instructions how to interpret the rest of the response file. A syntactic comment is effective immediately and its effect persists to the end of the response file, unless another syntactic comment undoes it.
| syntactic-comment | ::= | space* ‘#’ space* key space* ‘:’ space* value |
| key | ::= | (‘A’ .. ‘Z’ | ‘a’ .. ‘z’ | ‘-’)+ |
where value is an arbitrary string.
Table 3.2: EBNF definition of the grammar of syntactic comments in response files.
Unknown syntactic comments are silently ignored.
The three equivalent syntactic keys
control the algorithm that Enblend or Enfuse use to glob filenames in response files.
All versions of Enblend and Enfuse support at least two algorithms: literal, which is the default, and wildcard. See Table:globbing-algorithms for a list of all possible globbing algorithms. To find out about the algorithms in your version of Enblend or Enfuse team up the options --version and --verbose.
literalPlease keep in mind that whitespace at both ends of a line in a response file always gets discarded.
wildcardThe W*N32 implementation only globs the filename part of a path, whereas all other implementations perform wildcard expansion in all path components. Also see glob(7).
noneliteral.shellshell globbing algorithm works as literal does. In addition, it interprets the wildcard characters ‘{’, ‘}’, and ‘~’. This makes the expansion process behave more like common UN*X shells.shshell.Table 3.3: Globbing algorithms for the use in response files
Example:
# Horizontal panorama
# 15 images
# filename-globbing: wildcard
image_000[0-9].tif
image_001[0-4].tif
Common options control some overall features of Enfuse.
--compression=COMPRESSIONDepending on the output file format, Enfuse accepts different values for COMPRESSION.
However, VIGRA automatically compresses png-files with the Deflate method.
-h--help-l LEVELS--levels=LEVELSThe number of levels used in a pyramid controls the balance between local and global image features (contrast, saturation, ...) in the blended region. Fewer levels emphasize local features and suppress global ones. The more levels a pyramid has, the more global features will be taken into account.
As a guideline, remember that each new level works on a linear scale twice as large as the previous one. So, the zeroth layer, the original image, obviously defines the image at single-pixel scale, the first level works at two-pixel scale, and generally, the n-th level contains image data at 2^n-pixel scale. This is the reason why an image of width×height pixels cannot be deconstructed into a pyramid of more than
levels.
If too few levels are used, “halos” around regions of strong local feature variation can show up. On the other hand, if too many levels are used, the image might contain too much global features. Usually, the latter is not a problem, but is highly desired. This is the reason, why the default is to use as many levels as is possible given the size of the overlap regions. Enfuse may still use a smaller number of levels if the geometry of the overlap region demands.
Positive values of LEVELS limit the maximum number of pyramid levels. Depending on the size and geometry of the overlap regions this may or may not influence any pyramid. Negative values of LEVELS reduce the number of pyramid levels below the maximum no matter what the actual maximum is and thus always influence all pyramids.
The valid range of the absolute value of LEVELS is 1 to 29.
-o--output=FILEIf --output is not specified, the default is to put the resulting image in a.tif.
-v--verbose[=LEVEL]Each level includes all messages of the lower levels.
The default verbosity level of Enfuse is 1.
-V--versionTeam this option with --verbose to show configuration details, like the extra features that have been compiled in.
-w--wrap=MODEWith this option, Enfuse treats the panorama of width w and height h as an infinite data structure, where each pixel P(x, y) of the input images represents the set of pixels S_P(x, y)6.
MODE takes the following values:
This is useful for 360° horizontal panoramas as it eliminates the left and right borders.
This is useful for 360° vertical panoramas, as it eliminates the top and bottom borders.
In this mode, both left and right borders, as well as top and bottom borders, are eliminated.
Specifying --wrap without MODE selects horizontal wrapping.
Extended options control the image cache, the color model, and the cropping of the output image.
-b BLOCKSIZEThis is the amount of data that Enfuse will move to and from the disk at one time. The default is 2048KB, which should be ok for most systems. See Tuning Memory Usage for details.
Note that Enfuse must have been compiled with the image-cache feature for this option to be effective. Find out about extra features with enfuse --version --verbose.
-cThe input files should have embedded ICC profiles when this option is specified. If no ICC profile is present, Enfuse will assume that the image uses the sRGB color space. The difference between this option and Enfuse's default color blending algorithm is slight, and will only be noticeable when areas of different primary colors are blended together.
-d--depth=DEPTHEnfuse always uses a smart way to change the channel depth, to assure highest image quality (at the expense of memory), whether requantization is implicit because of the output format or explicit with option --depth.
All DEPTH specifications are valid in lowercase as well as uppercase letters. For integer format use
8, uint8int1616, uint16int3232, uint32For floating-point format use
r32, real32, floatr64, real64, doubleIf the requested DEPTH is not supported by the output file format, Enfuse warns and chooses the DEPTH that matches best.
The OpenEXR data format is treated as IEEE754 float internally. Externally, on disk, OpenEXR data is represented by “half” precision floating-point numbers.
OpenEXR half precision floating-point, 16bit wide, 10bit significant
-f WIDTHxHEIGHT-f WIDTHxHEIGHT+xX-OFFSET+yY-OFFSETThis option is useful when the input images are cropped TIFF files, such as those produced by nona. The stitcher nona is part of Hugin. See Helpful Programs.
-gGimp (before version 2.0) and CinePaint (see Helpful Programs) exhibit unusual behavior when loading images with unassociated alpha channels. Use option -g to work around this problem. With this flag Enfuse will create the output image with the associated alpha tag set, even though the image is really unassociated alpha.
-m CACHESIZEThis is the amount of memory Enfuse will use for storing image data before swapping to disk. The default is 1024MB, which is good for systems with 3–4gigabytes (GB) of RAM. See Tuning Memory Usage for details.
Note that Enfuse must have been compiled with the image-cache feature for this option to be effective. Find out about extra features with enfuse --version --verbose.
Fusion options define the proportion to which each input image's pixel contributes to the output image.
--contrast-weight=WEIGHTSets the relative WEIGHT of high local-contrast pixels. Default: 0.0. Valid range:
See Local Contrast Weighting and Option contrast-window-size.
--entropy-weight=WEIGHTSets the relative WEIGHT of high local entropy pixels. Default: 0.0. Valid range:
See Local Entropy Weighting and Options entropy-window-size and entropy-cutoff.
--exposure-weight=WEIGHTSets the relative WEIGHT of the well-exposedness criterion. Increasing this weight relative to the others will make well-exposed pixels contribute more to the final output. Default: 1.0. Valid range:
See Exposure Weighting.
--exposure-mu=MEANSet the MEAN (this is, the center) of the Gaussian exposure weight curve. Default: 0.5. Valid range:
Use this option to fine-tune exposure weighting (see Exposure Weighting).
--exposure-sigma=STD-DEVStandard deviation STD-DEV of the Gaussian exposure weight curve. Default: 0.2. Low numbers give less weight to pixels that are far from --wMu and vice versa. Valid range:
Use this option to fine-tune exposure weighting (see Exposure Weighting).
--saturation-weight=WEIGHTSets the relative WEIGHT of high-saturation pixels. Increasing this weight makes pixels with high saturation contribute more to the final output. Default: 0.2. Valid range:
Saturation weighting is only defined for color images. See Saturation Weighting.
Expert options influence the workings of Enfuse that require the user to read the manual before applying them successfully.
--contrast-window-size=SIZESet the window SIZE for local contrast analysis. The window will be a square of SIZE×SIZE pixels.
For contrast analysis SIZE values larger than 5 might result in a blurry composite image. Values of 3 and 5 have given good results on focus stacks.
Valid range:
If given an even SIZE, Enfuse will automatically use the next odd number.
See also Option –contrast-weight and --hard-mask below.
--contrast-edge-scale=EDGE-SCALE--contrast-edge-scale=EDGE-SCALE:LCE-SCALE:LCE-FACTORA non-zero value for EDGE-SCALE switches on the Laplacian-of-Gaussian (LoG) edge detection algorithm. EDGE-SCALE is the radius of the Gaussian used in the search for edges. Default: 0.0pixels.
A positive LCE-SCALE turns on local contrast enhancement (LCE) before the LoG edge detection. LCE-SCALE is the radius of the Gaussian used in the enhancement step, LCE-FACTOR is the weight factor (“strength”).
LCE-SCALE defaults to 0.0 pixels and LCE-FACTOR defaults to 0.0. Append ‘%’ to LCE-SCALE to specify the radius as a percentage of EDGE-SCALE. Append ‘%’ to LCE-FACTOR to specify the weight as a percentage.
--entropy-cutoff=LOWER-CUTOFF--entropy-cutoff=LOWER-CUTOFF:UPPER-CUTOFFThe first form defines the lower cutoff value below which pixels are treated as pure black when calculating the local entropy. The second form also defines the upper cutoff value above which pixels are treated as pure white.
For color images LOWER-CUTOFF and UPPER-CUTOFF are applied separately and independently to each channel.
Defaults: 0% for LOWER-CUTOFF and 100% for UPPER-CUTOFF, that is, all pixels' values are taken into account. Append a ‘%’ to specify the cutoff relative to maximum pixel value in the source image (for example 255 or 65535). Figure:entropy-cutoff shows an example.
Figure 3.1: Linear lightness Y in comparison with an entropy-cutoff function for LOWER-CUTOFF = 5% and UPPER-CUTOFF = 90% which are rather extreme values.
Note that a high LOWER-CUTOFF value lightens the resulting image, as dark (and presumably noisy) pixels are averaged with equal weights. With ‘--entropy-cutoff=0’, the default, on the other hand, “noise” might be interpreted as high entropy and the noisy pixels get a high weight, which in turn renders the resulting image darker. Analogously, a low UPPER-CUTOFF darkens the output image.
--entropy-window-size=SIZEWindow SIZE for local entropy analysis. The window will be a square of SIZE×SIZE pixels.
In the entropy calculation SIZE values of 3 to 7 yield an acceptable compromise of the locality of the information and the significance of the local entropy value itself.
Valid range:
If given an even SIZE Enfuse will automatically use the next odd number.
--gray-projector=PROJECTORUse gray projector PROJECTOR for conversion of RGB images to grayscale masks:
In version 4.0-753b534c819d of Enfuse, the option is effective for exposure weighting and local contrast weighting. Default: ‘average’.
Valid values for PROJECTOR are:
averagechannel-mixer:RED-WEIGHT:GREEN-WEIGHT:BLUE-WEIGHTThe weights are automatically normalized to one, so
--gray-projector=channel-mixer:0.25:0.5:0.25
--gray-projector=channel-mixer:1:2:1
--gray-projector=channel-mixer:25:50:25
all define the same mixer configuration.
The three weights RED-WEIGHT, GREEN-WEIGHT, and BLUE-WEIGHT define the relative weight of the respective color channel. The sum of all weights is normalized to one.
l-starSee Wikipedia for a detailed description of the Lab color space.
lightnessluminancevalue--hard-maskForce hard blend masks on the finest scale. This is the opposite flag of --soft-mask.
This blending mode avoids averaging of fine details (only) at the expense of increasing the noise. However it considerably improves the sharpness of focus stacks. Blending with hard masks has only proven useful with focus stacks.
See also Option –contrast-weight and --contrast-window-size above.
--contrast-min-curvature=CURVATUREDefine the minimum CURVATURE for the LoG edge detection. Default: 0. Append a ‘%’ to specify the minimum curvature relative to maximum pixel value in the source image (for example 255 or 65535).
A positive value makes Enfuse use the local contrast data (controlled with --contrast-window-size) for curvatures less than CURVATURE and LoG data for values above it.
A negative value truncates all curvatures less than −CURVATURE to zero. Values above CURVATURE are left unchanged. This effectively suppresses weak edges.
--save-masks--save-masks=SOFT-MASK-TEMPLATE--save-masks=SOFT-MASK-TEMPLATE:HARD-MASK-TEMPLATESave all weight files as TIFF images. First form: Save all soft weight masks in files. If option --hard-mask is effective also save the hard masks. The defaults are softmask-%n.tif and hardmask-%n.tif. In the second form, SOFT-MASK-TEMPLATE defines the names of the soft-mask files. In the third form, HARD-MASK-TEMPLATE additionally defines the names of the hard-mask files.
Both SOFT-MASK-TEMPLATE and HARD-MASK-TEMPLATE define templates that are expanded for each mask file. In a template a percent sign (‘%’) introduces a variable part. All other characters are copied literally. Lowercase letters refer to the name of the respective input file, whereas uppercase ones refer to the name of the output file (see Common Options). Table:mask-template-characters lists all variables.
A fancy mask filename template could look like this:
%D/soft-mask-%02n-%f.viff
It puts the mask files into the same directory as the output file (‘%D’), generates a two-digit index (‘%02n’) to keep the mask files nicely sorted, and decorates the mask filename with the name of the associated input file (‘%f’) for easy recognition.
--soft-maskConsider all masks when fusing. This is the default.
%%%i‘%i’ supports setting a pad character or a width specification:
% PAD WIDTH i
PAD is either ‘0’ or any punctuation character; the default pad character is ‘0’. WIDTH is an integer specifying the minimum width of the number. The default is the smallest width given the number of input images, this is 1 for 2–9 images, 2 for 10–99 images, 3 for 100–999 images, and so on.
Examples: ‘%i’, ‘%02i’, or ‘%_4i’.
%n%pExample: If the input file is called /home/luser/snap/img.jpg, ‘%p’ expands to /home/luser/snap/img.jpg, or shorter: ‘%p’ ⇒ /home/luser/snap/img.jpg.
%P%dExample (cont.): ‘%d’ ⇒ /home/luser/snap.
%D%bExample (cont.): ‘%b’ ⇒ img.jpg.
%B%fExample (cont.): ‘%f’ ⇒ img.
%F%eExample (cont.): ‘%e’ ⇒ .jpg.
%ETable 3.4: Special characters to control the generation of mask filenames.
Enfuse allows the arguments supplied to the program's options to be separated by different separators. The online documentation and this manual, however, exclusively use the colon ‘:’ in every syntax definition and in all examples.
Numeric Arguments
Valid delimiters are the the semicolon ‘;’, the colon ‘:’, and the slash ‘/’. All delimiters may be mixed within any option that takes numeric arguments.
Examples:
Filename Arguments
Here, the accepted delimiters are ‘,’, ‘;’, and ‘:’. Again, all delimiters may be mixed within any option that has filename arguments.
Examples:
As has been noted in the Overview (see Overview), Enfuse supports four different types of weighting. The following subsections describe the concept of weighting and all weighting functions in detail.
Image fusion maps each pixel P(i, x, y) of every input image i to a single pixel Q(x, y) in the output image:
where x runs from 1 to the common width of the images, y from 1 to the common height, and i from 1 to the number of input images n.
Enfuse allows for weighting the contribution of each P(i, x, y) to the final Q(x, y):
where
The pixel weights w themselves are weighted sums with the same constraints
where we have abbreviated to for simplicity. The user defines the constants , , , and with the options `--exposure-weight', `--saturation-weight', `--contrast-weight', and `--entropy-weight' respectively. The functions , , , and along with the window sizes and are explained in the next sections.
By default, Enfuse uses a weighted average, where each pixel contributes as much as its weight demands. Of course the weights can be extreme, favoring only a few pixels or even only one pixel in the input stack. Extremes are not typical, however.
Equal weights are another extreme that turns (W) into an arithmetic average. This is why we sometimes speak of the “averaging property” of this weighting algorithm, like smoothing out noise.
The weighted average computation as described above has proven to be widely successful with the exception of one special case: focus stacking (see Focus Stacks), where the averaging noticeably softens the final image.
Use --hard-mask to switch Enfuse into a different (“Super Trouper”) weighting mode, where the pixel with the highest weight wins, this is, gets weight one, and all other pixels get the weight of zero (“The Winner Takes It All.”). With --hard-mask Equation (W) becomes
Note that this “averaging” scheme lacks the nice noise-reduction property of the weighted average (W), because only a single input pixel contributes to the output.
Exposure weighting prefers pixels with a luminance Y close to the center of the normalized, real-valued luminance interval [0, 1].
RGB-pixels get converted to luminance using the grayscale projector given by --gray-projector, which defaults to average. Grayscale pixels are identified with luminance.
In the normalized luminance interval 0.0 represents pure black and 1.0 represents pure white independently of the data type of the input image. This is, for a JPEG image the luminance 255 maps to 1.0 in the normalized interval and for a 32bit TIFF picture the highest luminance value 4294967295 also maps to 1.0. The middle of the luminance interval, 0.5, is where a neutral gray tone ends up with every camera that had no exposure correction dialed in, for example the image of a gray- or white-card.
The exposure weighting algorithm only looks at a single pixel at a time; the pixel's neighborhood is not taken into account.
The weighting function is the Gaussian
whose center Mu and width Sigma are controlled by the command line options --exposure-mu and --exposure-sigma respectively. Mu defaults to 0.5 and Sigma defaults to 0.2. Figure:gaussian shows a Gaussian.
The options --exposure-mu and --exposure-sigma are for fine-tuning the final result without changing the set of input images. Option --exposure-mu sets the point Mu of optimum exposure. Increasing Mu makes Enfuse prefer lighter pixels, rendering the final image lighter, and vice versa. Option --exposure-sigma defines the range Sigma of acceptable exposures. Small values of Sigma penalize exposures that deviate from Mu more, and vice versa.
Summary of influential options
Saturation weighting prefers pixels with a high saturation.
Enfuse computes the saturation of a pixel according to the following algorithm.
max := maximum(R, G, B)
min := minimum(R, G, B)
if max = min then
saturation := 0
else
sum := max + min
difference := max - min
if sum ≤
1 then
saturation := difference / sum
else
saturation := difference / (2 - sum)
end if
end if
Obviously, saturation weighting can only be defined for RGB images, not for grayscale ones! If you need something similar, check out Local Entropy Weighting; entropy weighting works for both RGB and grayscale pictures.
The saturation weighting algorithm only looks at a single pixel at a time; the pixel's neighborhood is not taken into account.
Summary of influential options
Local contrast weighting favors pixels inside a high contrast neighborhood. The notion of “high contrast” is defined either by two different criteria or by a blend of both:
Enfuse converts every RGB image to grayscale before it determines its contrast. Option --gray-projector (see Expert Options) controls the projector function. Depending on the subject, one of several grayscale projectors may yield the best black-and-white contrast for image fusion.
In the following sections we describe each algorithm in detail.
The pixel under consideration C sits exactly in the center of a square, the so-called local analysis window. It always has an uneven edge length. The user sets the size with option --contrast-window-size. Figure:local-analysis-window shows two windows with different sizes.
Figure 4.2: 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.
During the analysis, Enfuse scans the local analysis window across all rows and all columns7 of each of the input images to compute the contrast weight of every pixel.
Summary of influential options
We start with the probability function w of the random variable X:
It associates a probability p with each of the n different possible outcomes of the random variable X. Based on w, we define the expectation value or “First Moment” of the random variable X:
Using the definition of the expectation value, we define the variance, or “Second Moment” as
Obviously, the variance of X is the expectation value of the squared deviation from the expectation value of X itself. Note that the variance's dimension is X's dimension squared; the standard deviation rectifies the dimension to make it comparable with X itself again.
In Enfuse, we assume that X follows a uniform probability function w(x) = const. That is, all pixel values in the local analysis window are considered to be equally probable. Thus, the expectation value and the variance can be estimated from the pixel values like this
In other words: the expectation value is the arithmetic mean of the lightness of all pixels in the local analysis window. Analogously, the variance becomes
The Laplacian of Gaussian (LoG) is an operator to detect edges in an image. Sometimes the LoG-operator is also called Marr-Hildreth operator. A Laplacian-of-Gaussian operator, vigra::laplacianOfGaussian is part of the package VIGRA that Enfuse is built upon and is used for edge detection if option --contrast-edge-scale is non-zero and --contrast-min-curvature equal to or less than zero.
Let the Gaussian function be
The parameter , the argument of option --contrast-edge-scale, is the length scale on which edges are detected by g(x, y). We apply the Laplacian operator in Cartesian coordinates
to g(x, y), to arrive at a continuous representation of the two-dimensional filter kernel
where we have used the dimensionless distance from the origin
Enfuse uses a discrete approximation of k in the convolution with the image. The operator is radially symmetric with respect to the origin, which is why we can easily plot it in Figure:laplacian-of-gaussian, setting
See also HIPR2: Laplacian of Gaussian.
Sometimes the LoG is plagued by noise in the input images. After all, it is a numerical approximation of the second derivative and deriving always “roughens” a function. The (normalized) mask files relentlessly disclose such problems. Use option --contrast-min-curvature with a negative argument CURVATURE to suppress all edges with a curvature below −CURVATURE (which is a positive value). Check the effects with the mask files and particularly the hard-mask files (hardmask-%n.tif) if using option --hard-mask.
To indicate the CURVATURE in relative terms, which is particularly comprehensible for humans, append a percent sign (‘%’). Try minimum curvatures starting from −0.5% to −3%.
Summary of influential options
Enfuse can team the standard deviation computation and Laplacian of Gaussian to deliver the best of both methods. Use a positive argument CURVATURE with option --contrast-min-curvature to combine both algorithms. In this mode of operation Enfuse computes the SDev-weight and the LoG-weight, then uses the LoG to decide whether to go with that value or prefer the SDev data. If the LoG is greater than CURVATURE Enfuse uses the weight delivered by the LoG, otherwise the SDev-weight is rescaled such that its maximum is equal to CURVATURE, and the scaled SDev is used as weight.
This technique merges the two edge detection methods where they are best. The LoG excels with clear edges and cannot be fooled by strong but smooth gradients. However, it is bad at detecting faint edges and it is susceptible to noise. The SDev on the other hand shines with even the most marginal edges, and resists noise quite well. Its weakness is that is is easily deceived by strong and smooth gradients. Tuning CURVATURE the user can pick the best threshold for a given set of images.
Summary of influential options
Experience has shown that neither the parameters EDGESCALE and CURVATURE nor the mode of operation (SDev-only, LoG-only, or a blend of both) scales to different image sizes. In practice, this means that if you start with a set of reduced size images, say 2808×1872 pixels, carefully optimize EDGESCALE, CURVATURE and so on, and find LoG-only the best mode, and then switch to the original resolution of 5616×3744 pixels, multiplying (or dividing) the parameters by four and sticking to LoG-only might not result in the best fused image. For best quality, perform the parameter optimization and the search for the most appropriate mode at the final resolution.
Entropy weighting prefers pixels inside a high entropy neighborhood.
Let S be an n-ary source. Watching the output of S an observer on average gains the information
per emitted message, where we assume the knowledge of the probability function p(S). The expectation value H_a(n) is called entropy of the source S. Entropy measures our uncertainty if we are to guess which message gets chosen by the source in the future. The unit of the entropy depends on the choice of the constant a > 1. Obviously
holds for all b > 1. We use a = 2 for entropy weighting and set the entropy of the “impossible message” to zero according to
Figure:entropy shows an entropy function.
For more on (information) entropy visit Wikipedia.
Enfuse computes a pixel's entropy by considering the pixel itself and its surrounding pixels quite similar to Local Contrast Weighting. The size of the window is set by --entropy-window-size. Choosing the right size is difficult, because there is a serious tradeoff between the locality of the data and the size of the sample used to compute H. A large window results in a large sample size and therefore in a reliable entropy, but considering pixels far away from the center degrades H into a non-local measure. For small windows the opposite holds true.
Another difficulty arises from the use of entropy as a weighting function in dark parts of an image, that is, in areas where the signal-to-noise ratio is low. Without any precautions, high noise is taken to be high entropy, which might not be desired. Use option --entropy-cutoff to control the black level when computing the entropy.
On the other extreme side of lightness, very light parts of an image, the sensor might already have overflown without the signal reaching 1.0 in the normalized luminance interval. For these pixels the entropy is zero and Enfuse can be told of the threshold by properly setting the second argument of --entropy-cutoff.
Summary of influential options
A binary mask indicates for every pixel of an image if this pixel must be considered in further processing, or ignored. For a weight mask, the value of the mask determines how much the pixel contributes, zero again meaning “no contribution”.
Masks arise in two places: as part of the input files and as separate files, showing the actual pixel weights prior to image blendung or fusion. We shall explore both occurrences in the next sections.
Each of the input files for Enfuse and Enblend can contain its own mask. Both applications interpret them as binary masks no matter how many bits per image pixel they contain.
Use ImageMagick's identify or, for TIFF files, tiffinfo to inquire quickly whether a file contains a mask. Helpful Programs shows where to find these programs on the web.
$ identify -format "%f %m %wx%h %r %q-bit" remapped-0000.tif
remapped-0000.tif TIFF 800x533 DirectClassRGBMatte 8-bit
^^^^^ mask
$ tiffinfo remapped-0000.tif
TIFF Directory at offset 0x1a398a (1718666)
Subfile Type: (0 = 0x0)
Image Width: 800 Image Length: 533
Resolution: 150, 150 pixels/inch
Position: 0, 0
Bits/Sample: 8
Sample Format: unsigned integer
Compression Scheme: PackBits
Photometric Interpretation: RGB color
Extra Samples: 1<unassoc-alpha> <<<<< mask
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 4 <<<<< R, G, B, and mask
Rows/Strip: 327
Planar Configuration: single image plane
The “Matte” part of the image class and the “Extra Samples” line tell us that the file features a mask. Also, many interactive image manipulation programs show the mask as a separate channel, sometimes called “Alpha”. There, the white (high mask value) parts of the mask enable pixels and black (low mask value) parts suppress them.
The multitude of terms all describing the concept of a mask is confusing.
Enblend and Enfuse only consider pixels that have an associated mask value other than zero. If an input image does not have an alpha channel, Enblend warns and assumes a mask of all non-zero values, that is, it will use every pixel of the input image for fusion.
Stitchers like nona add a mask to their output images.
Sometimes it is helpful to manually modify a mask before fusion. For example to suppress unwanted objects (insects and cars come into mind) that moved across the scene during the exposures. If the masks of all input images are black at a certain position, the output image will have a hole in that position.
The default configuration of Enblend and Enfuse assumes a system with 3–4GB of RAM.
If Enblend and Enfuse have been compiled with the “image-cache” feature, they do not rely on the operating system's memory management, but use their own image cache in the file system. To find out whether your version uses the image cache say
enblend --verbose --version
or
enfuse --verbose --version
Enblend and Enfuse put the file that holds the image cache either in the directory pointed to by the environment variable TMPDIR, or, if the variable is not set, in directory /tmp. It is prudent to ensure write permissions and enough of free space on the volume with the cache file.
The size of the image cache is user configurable with the option ‘-m CACHE-SIZE’ (see Extended Options). Furthermore, option ‘-b BUFFER-SIZE’ (see Extended Options) allows for fine-tuning the size of a single buffer inside the image cache. Note that CACHE-SIZE is given in megabytes, whereas the unit of BUFFER-SIZE is kilobytes.
Usually the user lets the operating system take care of the memory management of all processes. However, users of Enblend or Enfuse might want to control the balance between the operating systems' Virtual Memory system and the image cache for several reasons.
The CACHE-SIZE should be set in such a way as to reconcile all of the above aspects even for the biggest data sets, that is, projects with many large images.
Table:cache-size-settings suggests some cache- and buffer-sizes for different amounts of available RAM.
| RAM | CACHE-SIZE | BUFFER-SIZE | Comment |
|---|---|---|---|
| MB | MB | KB | |
| 4096 | 1024 | 2048 | default |
| 2048 | 512–1024 | 1024 | |
| 1024 | 256–512 | 256–512 |
Table 6.1: Suggested cache-size settings
On systems with considerably more than 4GB of RAM it is recommended to run Enblend or Enfuse versions without image cache.
This section describes some of the novel possibilities that Enfuse offers the photographer. In contrast to the previous chapters, it centers around the image effects.
Images should align well to be suitable for fusion. However, there is no hard mathematical rule what “well” means. The alignment requirements for 16MPixel images to yield a sharp 4"×6" print at 300dpi (“dpi” means dots per inch) or even for web presentation are relatively low, whereas the alignment of 8MPixel images for a 12"×18" print ought to be tight.
If the input images need to be aligned, Hugin (see Helpful Programs) is the tool of choice. It produces images exactly in the format that Enfuse expects.
Sometimes images naturally align extremely well so that no re-alignment is required. An image series with preprogrammed exposure steps taken in rapid succession where the camera is mounted on a heavy tripod and a humongous ball head, mirror lockup, and a cable release are used, comes to mind.
When in doubt about what will work, try it, and judge for yourself.
Useful ideas for a good alignment:
For some lens-based image stabilization systems, it is known that they “lock” into different positions every time they are activated. Moreover, some stabilization systems decrease the image quality when the lens is mounted on a tripod.
With the default settings, Enfuse computes a weighted average of the input pixels. For a series of images, repeated with identical settings, this results in a reduction of (photon shot) noise. In other words, the dynamic range increases slightly, because the higher signal-to-noise ratio makes darker shades usable. Furthermore, smooth or glossy surfaces get a “cleaner” look, and edges become visually sharper. The nitty-gritty reportage look that sometimes stems from a high sensitivity setting disappears.
Averaged images, and therefore low-noise images, are the base for a multitude of techniques like, for example, differences. The most prominent method in this class is dark-frame subtraction.
The defaults set ‘--exposure-weight=1.0’ and ‘--saturation-weight=0.2’. Eliminating the saturation component with ‘--saturation-weight=0.0’ can be worth an extra run.
Main Purpose: Increase manageable dynamic range
An exposure series is a set of images taken with identical parameters except for the exposure time. Some cameras even provide special functions to automate recording exposure series. See the instruction manual of your model for details.
Enfuse's defaults, ‘--exposure-weight=1.0’ and ‘--saturation-weight=0.2’ are well suited for fusion of color images. Remember that saturation weighting only works for RGB data. Option --saturation-weight helps to control burnt-out highlights, as these are heavily desaturated. If no image suffers from troublesome highlights, the relative saturation weight can be reduced and even be set to zero. For black and white images --entropy-weight can be an alternative to --saturation-weight because it suppresses overexposed pixels, as these contain little information. However, entropy weighting is not limited to grayscale data; it has been successfully applied to RGB images, too. Note that saturation weighting considers each color channel of an RGB image separately and chooses the channel with the minimum entropy as representative for the whole pixel.
Enfuse offers the photographer tremendous flexibility in fusing differently exposed images. Whether you combine only two pictures or a series of 21, Enfuse imposes no limits on you. Accordingly, the photographic effects achieved range from subtle to surreal, like the late 1980s “Max Headroom” TV-Series, to really unreal. Like some time ago in the chemical days of photography, when a new developer opened unseen possibilities for artists, exposure fusion extends a photographer's expressive space in the digital age. Whether the results look good or bad, whether the images are dull or exciting, is entirely up the artist.
In the next sections we give assistance to starters, and rectify several misconceptions about Enfuse.
Here are some tips to get you in business quickly.
You can take a larger series of images and only use part of it.
Here are some surprisingly common misconceptions about exposure series.
...
Main Purpose: Reflection suppression, saturation enhancement
In the current implementation of Enfuse, it is not possible in general to fuse a polarization series. Naïvely abusing --saturation-weight will not work.
Main Purpose: Synthetic Depth-of-Field Increase
A focus stack is a series of images where the distance of the focal plane from the sensor varies. Sloppily speaking, the images were focussed at different distances. Fusing such a stack increases the depth-of-field (DOF) beyond the physical limits of diffraction.
the photographer controls the depth-of-field with the aperture. Smaller apertures – this is larger aperture numbers – increase the DOF and vice versa. However, smaller apertures increase diffraction which in turn renders the image unsharp. So, there is an optimum aperture where the photographer gets maximum DOF. Sadly, for some purposes like macro shots it is not enough. One way out is to combine the sharp parts of images focused at different distances, thereby artificially increasing the total DOF. This is exactly what Enfuse can do.
All lenses have a so called “sweet spot” aperture, where their resolution is best. Taking pictures at this aperture, the photographer squeezes the maximum quality out of the lens. But: the “sweet spot” aperture often is only one or two stops away from wide open. Wouldn't it be great to be able combine these best-possible images to form one high-quality, sufficient-DOF image? Welcome to Enfuse's local-contrast selection abilities.
We are going to combine images with limited DOF to increase their in-focus parts. The whole process is about image sharpness. Therefore, the input images must align very well, not just well, but very well. For optimum results the maximum control point distance in Hugin (see Helpful Programs) should not exceed 0.3–0.5pixels to ensure perfect blending.
As in all image fusion operations it is preferable to use 16bit linear (gamma = 1) images throughout, but 8bit gamma encoded images will do. Naturally, high SNR input data always is welcome.
A bare bones call to Enfuse for focus stacking could look like this.
enfuse \
--exposure-weight=0 \
--saturation-weight=0 \
--contrast-weight=1 \
--hard-mask \
... \
--output=output.tif \
input-<0000-9999>.tif
Here is what each option causes:
If you want to see some entertaining progress messages – local-contrast weighting takes a while –, also pass the --verbose option for a verbose progress report.
For a large class of image stacks Enfuse's default algorithm, as selected in Local Contrast Based Fusing, to determine the sharpness produces nice results. The algorithm uses a moving square window, the so-called contrast window. It computes the standard deviation of the pixels inside of the window. The program then selects the window's center pixel of the image in the stack where the standard deviation is largest, that is, the local contrast reaches the maximum.
However, the algorithm fails to deliver good masks for images which exhibit high contrast edges on the scale of the contrast window size. The typical artifacts that show up are
where the distance of the seams from the middle of the edge is comparable to the contrast window size.
If your results do not show any of these artifacts, stick with the basic algorithm. Advanced focus stacking, as described in the next sections, delivers superior results in case of artifacts, though requires manually tuning several parameters.
If your fused image shows any of the defects described in the previous section, you can try a more difficult-to-use algorithm that effectively works around the seam artifacts. It is described in the next section.
Let us use an example to illustrate the problem of relating the sharpness with the local contrast variations. Say we use a 5×5 contrast window. Moreover, let sharp_edge and smooth_edge be two specific configurations:
sharp_edge = [ 0, 0, 200, 0, 0;
0, 225, 0, 0, 0;
0, 255, 0, 0, 0;
215, 0, 0, 0, 0;
200, 0, 0, 0, 0]
smooth_edge = [ 0, 62, 125, 187, 250;
1, 63, 126, 188, 251;
2, 65, 127, 190, 252;
3, 66, 128, 191, 253;
5, 67, 130, 192, 255]
where ‘;’ separates the rows and ‘,’ separates the columns. This is in fact Octave syntax.
Images Figure:sharp-edge and Figure:smooth-edge show plots of the matrices sharp_edge and smooth_edge.
Our intuition lets us “see” an extremely sharp edge in the first matrix, whereas the second one describes an extraordinarily smooth diagonal intensity ramp. Which one will be selected? Well, sharp_edge has a standard deviation of 88.07 and smooth_edge has 88.41. Thus, smooth_edge wins, contradicting our intuition, and even worse, our intention!
Sadly, configurations like smooth_edge occur more often with high-quality, good bokeh lenses. In fact, they are the very manifestation of “good bokeh”. Therefore, Laplacian edge detection plays an important role when working with high-quality lenses.
Enfuse provides a Laplacian-based algorithm that can help in situations where weighting based on the standard deviation fails. It is activated with a positive value for SCALE in --contrast-edge-scale=SCALE. The Laplacian will detect two-dimensional curvature on the scale of SCALE. Here and in the following we simply speak of “curvature” where we mean “magnitude of curvature”. That is, we shall not distinguish between convex and concave edges. Enfuse always use the magnitude of curvature for weighting.
Typically, SCALE ranges between 0.1pixels and 0.5pixels, where 0.3pixels is a good starting point. To find the best value for SCALE though, usually some experimentation will be necessary. Use --save-masks to get all soft-mask (default: softmask-%n.tif) and hard-mask files (default: hardmask-%n.tif). Check how different scales affect the artifacts. Also see Understanding Masks.
Sometimes Enfuse misses smoother edges with --contrast-edge-scale and a little local contrast enhancement (LCE) helps. Set --contrast-edge-scale=SCALE:LCE-SCALE:LCE-FACTOR. where LCE-SCALE and LCE-FACTOR work like the unsharp mask filters in various image manipulation programs. Start with LCE-SCALE ten times the value of SCALE and a LCE-FACTOR of 2–5.
LCE-SCALE can be specified as a percentage of SCALE. LCE-FACTOR also can be specified as a percentage. Examples:
--contrast-edge-scale=0.3:3.0:3
--contrast-edge-scale=0.3:1000%:3.0
--contrast-edge-scale=0.3:3:300%
--contrast-edge-scale=0.3:1000%:300%
By default LCE is turned off.
The Laplacian-based algorithm is much better at resisting the seam problem than the local-contrast algorithm, but it has two shortcomings:
The --contrast-min-curvature option helps to mitigate both flaws.
The argument to --contrast-min-curvature=CURVATURE either is an absolute lightness value, for example 0..255 for 8bit data and 0..65535 for 16bit data, or, when given with a ‘%’-sign it is a relative lightness value ranging from 0% to 100%.
To suppress unreal edges or counter excessive noise, use the --contrast-min-curvature option with a negative curvature measure CURVATURE. This forces all curvatures less than −CURVATURE to zero.
A positive curvature measure CURVATURE makes Enfuse merge the LoG data with the local-contrast data. Every curvature larger than or equal to CURVATURE is left unchanged, and every curvature less than CURVATURE gets replaced with the rescaled local-contrast data, such that the largest local contrast is just below CURVATURE. This combines the best parts of both techniques and ensures a precise edge detection over the whole range of edge curvatures.
Summary
--contrast-edge-scale=0.3average.--contrast-edge-scale=0.3 --gray-projector=l-star--contrast-edge-scale=0.3:3:300%average.--contrast-edge-scale=0.3 --contrast-min-curvature=−0.5%average and throw away all edges with a curvature of less than 0.5%.--contrast-edge-scale=0.3 --contrast-min-curvature=0.5% --contrast-window-size=7average and throw away all edges with a curvature of less than 0.5% and replace the LoG data between 0% and 0.5% with SDev data. Use a window of 7×7pixel window to compute the SDev.Figure Figure:focus-stacking-decision-tree helps the user to arrive at a well-fused focus stack with as few steps as possible.
Always start with the default, contrast weighting with a local contrast window. Only if seams appear as described in Advanced Focus Stacking switch to Laplacian-of-Gaussian contrast detection.
If some seams remain even in LoG-mode, decrease the sensitivity of the edge detection with a positive --contrast-min-curvature. A too high value of --contrast-min-curvature suppresses fine detail though. Part of the detail can be brought back with pre-sharpening, that is, Local Contrast Enhancement or combining LoG with local-contrast-window mode by using a negative --contrast-min-curvature.
Carefully examining the masks (option --save-masks) that Enfuse uses helps to judge the effects of the parameters.
We have collected some advice with which even focus-stacking adepts can benefit.
Aligning focus stacks requires varying the viewing angle, which corresponds to a changing focal length. Hence, the same pixel on the sensor gets mapped onto different positions in the final image. Dirt spots will occur not only once but as many times as there are images in the stack – something that is no fun to correct in postprocessing.
Along the same lines, the photographer may want to consider to prepare dark frames before, and possibly also after, the shoot of the focus stack, to subtract hot pixels before fusion.
Fusing with --hard-mask does not average, and thus does not suppress any noise in the input images.
The small aperture will give the fused image a more natural in-focus to out-of-focus transition and the working-aperture shots supply the detail in the in-focus regions.
Several programs and libraries have proven helpful when working with Enfuse and Enblend.
It comes with several command line tools, like nona to stitch panorama images, align_image_stack to align overlapping images for HDR or create focus stacks, and fulla to correct lens errors.
The nifty tiffinfo command quickly inquires the properties of TIFF files.
Most of this appendix was taken from the
Octave documentation.
Bug reports play an important role in making Enblend and Enfuse reliable and enjoyable.
When you encounter a problem, the first thing to do is to see if it is already known. On the package's SourceForge homepage click “Develop” and on the development page click “Tracker”. Search the trackers for your particular problem. If it is not known, then you should report the problem.
In order for a bug report to serve its purpose, you must include the information that makes it possible to fix the bug.
If you are not sure whether you have found a bug, here are some guidelines:
The fundamental principle of reporting bugs usefully is this: report all the facts. If you are not sure whether to state a fact or leave it out, state it. Often people omit facts because they think they know what causes the problem and they conclude that some details do not matter. Play it safe and give a specific, complete example.
Keep in mind that the purpose of a bug report is to enable someone to fix the bug if it is not known. Always write your bug reports on the assumption that the bug is not known.
Try to make your bug report self-contained. If we have to ask you for more information, it is best if you include all the previous information in your response, as well as the information that was missing.
To enable someone to investigate the bug, you should include all these things:
Examples:
~/local/bin/enblend -v \
--fine-mask \
--optimizer-weights=3:2 --mask-vectorize=12.5% \
image-1.png image-2.png
or:
/local/bin/enfuse \
--verbose \
--exposure-weight=0 --saturation-weight=0 --entropy-weight=1 \
--gray-projector=l-star \
--entropy-cutoff=1.667% \
layer-01.ppm layer-02.ppm layer-03.ppm
If you call Enblend or Enfuse from within a GUI like, for example, Hugin or KImageFuser by Harry van der Wolf, copy&paste or write down the command line that launches Enblend or Enfuse.
Of course, if the bug is that the application gets a fatal signal, then one cannot miss it. But if the bug is incorrect output, we might not notice unless it is glaringly wrong.
If you would like to write bug fixes or improvements for Enblend or Enfuse, that is very helpful. When you send your changes, please follow these guidelines to avoid causing extra work for us in studying the patches. If you do not follow these guidelines, your information might still be useful, but using it will take extra work.
If you make two changes for separate reasons, then we might not want to install them both. We might want to install just one.
hg diff --unified 4.Andrew Mihal (acmihal@users.sourceforge.net) has written Enblend and Enfuse.
Contributors
Thanks to Simon Andriot and Pablo Joubert for suggesting the Mertens-Kautz-Van Reeth technique and the name “Enfuse”.
Version 1.2, November 2002
Copyright İ 2000, 2001, 2002 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
The purpose of this License is to make a manual, textbook, or other functional and useful document free in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.
This License is a kind of “copyleft”, which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.
We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.
This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The “Document”, below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as “you”. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law.
A “Modified Version” of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.
A “Secondary Section” is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.
The “Invariant Sections” are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none.
The “Cover Texts” are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.
A “Transparent” copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not “Transparent” is called “Opaque”.
Examples of suitable formats for Transparent copies include plain ascii without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only.
The “Title Page” means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, “Title Page” means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.
A section “Entitled XYZ” means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” of such a section when you modify the Document means that it remains a section “Entitled XYZ” according to this definition.
The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.
You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and you may publicly display copies.
If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.
If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.
It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.
You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:
If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles.
You may add a section Entitled “Endorsements”, provided it contains nothing but endorsements of your Modified Version by various parties—for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.
You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.
You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled “History” in the various original documents, forming one section Entitled “History”; likewise combine any sections Entitled “Acknowledgements”, and any sections Entitled “Dedications”. You must delete all sections Entitled “Endorsements.”
You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.
A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an “aggregate” if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate.
Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail.
If a section in the Document is Entitled “Acknowledgements”, “Dedications”, or “History”, the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title.
You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License “or any later version” applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.
ale: Helpful Programsalign_image_stack (Hugin): Helpful Programscinepaint: Extended Optionscinepaint: Helpful Programsconvert (ImageMagick): Helpful Programsdcraw: Workflowdcraw: Helpful Programsdisplay (ImageMagick): Helpful Programsexiftool: Helpful Programsexrdisplay (OpenEXR): Helpful Programsfulla (Hugin): Helpful Programsgimp: Workflowgimp: Helpful Programsgimp: Extended Optionsgm (GraphicsMagick): Helpful Programshugin: Extended Optionshugin: What Imageshugin: Workflowhugin: Helpful Programsidentify (ImageMagick): Understanding Masksidentify (ImageMagick): Helpful Programsmontage (ImageMagick): Helpful Programsnona (Hugin): Helpful Programsnona (Hugin): Extended OptionsPanoTools: Workflowpfshdrcalibrate (PFScalibration): Helpful Programspfsin (PFSTools): Helpful Programspfsout (PFSTools): Helpful Programspfstmo_* (PFStmo): Helpful Programspfsview (PFSTools): Helpful ProgramsPTmender (PanoTools): Helpful ProgramsPTOptimizer (PanoTools): Helpful Programstifficc (LittleCMS): Helpful Programstiffinfo (libtiff): Understanding Maskstiffinfo (libtiff): Helpful Programsufraw: Workflowufraw: Helpful Programsufraw-batch: Helpful Programsenblend-response-file: Response Filesenfuse-response-file: Response Filesfilename-globbing: Response Filesglob: Response Filesglobbing: Response Filesresponse-file: Response Files--compression: Common Options--contrast-edge-scale: Expert Options--contrast-min-curvature: Expert Options--contrast-weight: Fusion Options--contrast-window-size: Expert Options--ContrastWindowSize (deprecated): Expert Options--depth: Extended Options--EdgeScale (deprecated): Expert Options--entropy-cutoff: Expert Options--entropy-weight: Fusion Options--entropy-window-size: Expert Options--EntropyCutoff (deprecated): Expert Options--EntropyWindowSize (deprecated): Expert Options--exposure-mu: Fusion Options--exposure-sigma: Fusion Options--exposure-weight: Fusion Options--gray-projector: Expert Options--GrayProjector (deprecated): Expert Options--hard-mask: Expert Stacking--hard-mask: Disabling Averaging--hard-mask: Expert Options--HardMask (deprecated): Expert Options--help: Common Options--levels: Common Options--MinCurvature (deprecated): Expert Options--output: Common Options--saturation-weight: Fusion Options--save-masks: Expert Options--SaveMasks (deprecated): Expert Options--soft-mask: Expert Options--SoftMask (deprecated): Expert Options--verbose: Common Options--version: Common Options--wContrast (deprecated): Fusion Options--wEntropy (deprecated): Fusion Options--wExposureMu (deprecated): Fusion Options--wExposureSigma (deprecated): Fusion Options--wrap: Common Options--wSaturation (deprecated): Fusion Options-b: Tuning Memory Usage-b: Extended Options-c: Extended Options-d: Extended Options-f: Extended Options-g: Extended Options-h: Common Options-l: Common Options-m: Tuning Memory Usage-m: Extended Options-o: Common Options-V: Common Options-v: Common Options-w: Common Options[1] Tom Mertens, Jan Kautz, and Frank van Reeth, “Exposure Fusion”, Proceedings of the 15th Pacific Conference on Computer Graphics and Applications, pages 382–390.
[2] Peter J. Burt and Edward H. Adelson, “A Multiresolution Spline With Application to Image Mosaics”, ACM Transactions on Graphics, Vol. 2, No. 4, October 1983, pages 217–236.
[3] Downsampling with a good interpolator reduces noise, which might not desired to judge the image quality of the original-size image. Cropping might be an alternative, though.
[4] Use utilities like, e.g., tiffcopy and tiffsplit of LibTIFF to manipulate multi-directory TIFF images. See Helpful Programs.
[5] As Dr. Daniel Jackson correctly noted, actually, it is not a pyramid: “Ziggaurat, it's a Ziggaurat.”
[6] Solid-state physicists will be reminded of the http://en.wikipedia.org/wiki/Born-von_Karman_boundary_condition, Born-von Kármán boundary condition.
[7] In the current implementation a floor(contrast-window-size / 2) wide border around the images remains unprocessed and gets a weight of zero.
[8] Paul E. Debevec defines: “A light probe image is an omnidirectional, high dynamic range image that records the incident illumination conditions at a particular point in space.”
[9] Images of a size less than 1500×1000 pixels qualify as small.