From: Enblend <enb...@li...> - 2013-02-22 14:59:49
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/298e8ec9349a changeset: 905:298e8ec9349a user: Chris <cs...@us...> date: Fri Feb 22 15:58:47 2013 +0100 description: Add some more exposure weighting functions to Enfuse. diffstat: NEWS | 19 + VERSION | 2 +- configure.in | 3 +- doc/Makefile.am | 24 +- doc/auxmac.texi | 57 ++ doc/enblend.info | Bin doc/enblend.texi | 59 ++- doc/enfuse.info | Bin doc/enfuse.texi | 911 ++++++++++++++++++++++++++++++++++++++++---- doc/exposure-weights.gp.in | 65 +++ doc/fullsine.gp.in | 47 ++ doc/gaussian.gp.in | 12 +- doc/halfsine.gp.in | 47 ++ doc/lorentzian.gp.in | 43 ++ doc/power.gp.in | 46 ++ doc/versenblend.texi | 4 +- doc/versenfuse.texi | 4 +- src/Makefile.am | 1 + src/enblend.1 | 4 +- src/enfuse.1 | 19 +- src/enfuse.cc | 150 +++++- src/enfuse.h | 123 +++-- src/exposure_weight.h | 122 ++++++ src/exposure_weight_base.h | 61 +++ 24 files changed, 1604 insertions(+), 219 deletions(-) diffs (truncated from 2434 to 500 lines): diff -r 5cb8b0d11926 -r 298e8ec9349a NEWS --- a/NEWS Sat Feb 16 17:32:05 2013 +0100 +++ b/NEWS Fri Feb 22 15:58:47 2013 +0100 @@ -16,6 +16,25 @@ - The OpenMP enabled versions of Enblend and Enfuse benefit from Google's TCMalloc library. +- Several exposure weight functions were added to Enfuse. The choice + is now up to the user. The default still is the Gauss function as + in all Enfuse versions before. + + +** New Commandline Options + +- Option `--exposure-weight-function' makes Enfuse's exposure weight + function user selectable. Previously weight function "gauss" was + the only one (and hard-coded). + +- The old Enfuse options `--exposure-mu' and `--exposure-sigma' got + siblings called `--exposure-optimum' and `--exposure-width' + respectively. With exposure weight functions other than Gauss the + restricted naming does not make sense anymore. + + Options `--exposure-mu' and `--exposure-sigma' are scheduled for + withdrawal in a later version of Enfuse. + ** Developer Stuff diff -r 5cb8b0d11926 -r 298e8ec9349a VERSION --- a/VERSION Sat Feb 16 17:32:05 2013 +0100 +++ b/VERSION Fri Feb 22 15:58:47 2013 +0100 @@ -1,1 +1,1 @@ -4.2-48b6e48b0995+ +4.2-0db9e48b98c7 diff -r 5cb8b0d11926 -r 298e8ec9349a configure.in --- a/configure.in Sat Feb 16 17:32:05 2013 +0100 +++ b/configure.in Fri Feb 22 15:58:47 2013 +0100 @@ -553,7 +553,8 @@ AC_CONFIG_FILES([doc/entropy.gp doc/entropy-cutoff.gp doc/exposure-cutoff.gp - doc/gaussian.gp + doc/gaussian.gp doc/lorentzian.gp doc/halfsine.gp doc/fullsine.gp doc/power.gp + doc/exposure-weights.gp doc/laplacian-of-gaussian.gp doc/sharp-edge.gp doc/smooth-edge.gp]) diff -r 5cb8b0d11926 -r 298e8ec9349a doc/Makefile.am --- a/doc/Makefile.am Sat Feb 16 17:32:05 2013 +0100 +++ b/doc/Makefile.am Fri Feb 22 15:58:47 2013 +0100 @@ -30,7 +30,9 @@ config-edge.gp config.gp \ entropy-cutoff.gp.in \ exposure-cutoff.gp.in \ - entropy.gp.in gaussian.gp.in \ + entropy.gp.in \ + gaussian.gp.in lorentzian.gp.in halfsine.gp.in fullsine.gp.in power.gp.in \ + exposure-weights.gp.in \ laplacian-of-gaussian.gp.in \ sharp-edge.gp.in sharp-edge.data \ smooth-edge.gp.in smooth-edge.data \ @@ -65,7 +67,9 @@ entropy-cutoff.{txt,eps,svg,pdf} \ exposure-cutoff.{txt,eps,svg,pdf} \ external-mask-workflow.{txt,eps,svg,pdf} \ - gaussian.{txt,eps,svg,pdf} \ + gaussian.{txt,eps,svg,pdf} lorentzian.{txt,eps,svg,pdf} \ + halfsine.{txt,eps,svg,pdf} fullsine.{txt,eps,svg,pdf} power.{txt,eps,svg,pdf} \ + exposure-weights.{txt,eps,svg,pdf} \ laplacian-of-gaussian.{txt,eps,svg,pdf} \ local-analysis-window.{txt,eps,svg,pdf} \ photographic-workflow.{txt,eps,svg,pdf} \ @@ -305,7 +309,8 @@ entropy.txt \ entropy-cutoff.txt \ exposure-cutoff.txt \ - gaussian.txt \ + gaussian.txt lorentzian.txt halfsine.txt fullsine.txt power.txt \ + exposure-weights.txt \ laplacian-of-gaussian.txt \ local-analysis-window.txt \ sharp-edge.txt \ @@ -319,7 +324,8 @@ entropy.eps \ entropy-cutoff.eps \ exposure-cutoff.eps \ - gaussian.eps \ + gaussian.eps lorentzian.eps halfsine.eps fullsine.eps power.eps \ + exposure-weights.eps \ laplacian-of-gaussian.eps \ local-analysis-window.eps \ sharp-edge.eps \ @@ -333,7 +339,9 @@ entropy.svg $(RASTER_DIR)/entropy.png \ entropy-cutoff.svg $(RASTER_DIR)/entropy-cutoff.png \ exposure-cutoff.svg $(RASTER_DIR)/exposure-cutoff.png \ - gaussian.svg $(RASTER_DIR)/gaussian.png \ + gaussian.svg $(RASTER_DIR)/gaussian.png lorentzian.svg $(RASTER_DIR)/lorentzian.png \ + halfsine.svg $(RASTER_DIR)/halfsine.png fullsine.svg $(RASTER_DIR)/fullsine.png \ + power.svg $(RASTER_DIR)/power.png exposure-weights.svg $(RASTER_DIR)/exposure-weights.png \ laplacian-of-gaussian.svg $(RASTER_DIR)/laplacian-of-gaussian.png \ local-analysis-window.svg $(RASTER_DIR)/local-analysis-window.png \ sharp-edge.svg $(RASTER_DIR)/sharp-edge.png \ @@ -347,7 +355,8 @@ entropy.pdf \ entropy-cutoff.pdf \ exposure-cutoff.pdf \ - gaussian.pdf \ + gaussian.pdf lorentzian.pdf halfsine.pdf fullsine.pdf power.pdf \ + exposure-weights.pdf \ laplacian-of-gaussian.pdf \ local-analysis-window.pdf \ sharp-edge.pdf \ @@ -363,7 +372,8 @@ entropy.svg \ entropy-cutoff.svg \ exposure-cutoff.svg \ - gaussian.svg \ + gaussian.svg lorentzian.svg halfsine.svg fullsine.svg power.svg \ + exposure-weights.svg \ laplacian-of-gaussian.svg \ local-analysis-window.svg \ sharp-edge.svg \ diff -r 5cb8b0d11926 -r 298e8ec9349a doc/auxmac.texi --- a/doc/auxmac.texi Sat Feb 16 17:32:05 2013 +0100 +++ b/doc/auxmac.texi Fri Feb 22 15:58:47 2013 +0100 @@ -22,6 +22,63 @@ @end macro +@c Mathematical id, or variable. +@macro mathid{id} +@ifinfo +@math{\id\}@c +@end ifinfo +@html +<mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline"> + <mrowinline> + <mi>\id\</mi> + </mrowinline> +</mathinline> +@end html +@tex +$\id\$% +@end tex +@docbook +<inlineequation> + <mml:math> + <mml:ci>\id\</mml:ci> + </mml:math> +</inlineequation> +@end docbook +@end macro + + +@c Variable subscripted with some text, like e.g. Y_opt. +@macro subscripted{base, subscript} +@ifinfo +@math{\base\_\subscript\}@c +@end ifinfo +@html +<mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline"> + <mrowinline> + <msubinline> + <mi>\base\</mi> + <mtext>\subscript\</mtext> + </msubinline> + </mrowinline> +</mathinline> +@end html +@tex +$\base\_{\\mathrm{\subscript\}}$% +@end tex +@docbook +<inlineequation> + <mml:math> + <mml:apply> + <mml:selector/> + <mml:ci>\base\</mml:ci> + <mml:mtext mathvariant="sans-serif">\subscript\</mml:mtext> + </mml:apply> + </mml:math> +</inlineequation> +@end docbook +@end macro + + @c Include a raster image. @macro rimage{filename, width} @ifinfo diff -r 5cb8b0d11926 -r 298e8ec9349a doc/enblend.info Binary file doc/enblend.info has changed diff -r 5cb8b0d11926 -r 298e8ec9349a doc/enblend.texi --- a/doc/enblend.texi Sat Feb 16 17:32:05 2013 +0100 +++ b/doc/enblend.texi Fri Feb 22 15:58:47 2013 +0100 @@ -439,8 +439,9 @@ Other formats do not accept a @var{COMPRESSION} setting. However, @uref{http://@/hci.iwr.uni-@/heidelberg.de/@/vigra/, -@acronym{VIGRA}} automatically compresses @file{png}-files with the -@sc{Deflate} method. +@acronym{VIGRA}@footnote{@acronym{VIGRA} is the image manipulaton +library on which Enblend is based.}} automatically compresses +@file{png}-files with the @sc{Deflate} method. @end table @item --layer-selector=@var{ALGORITHM} @@ -595,7 +596,7 @@ @itemx --output=@var{FILE} @opindex -o @opindex --output -Place output in @var{FILE}. +Place blended output image in @var{FILE}. @cindex @file{@value{src::default-output-filename}} @cindex default output filename @@ -694,10 +695,38 @@ Otherwise, always avoid this option! -With this option Enblend treats the panorama of width@tie{}@math{w} -and height@tie{}@math{h} as an infinite data structure, where each -pixel@tie{}@math{P(x, y)} of the input images represents the set of -pixels +With this option Enblend treats the set of input images (panorama) of +width@tie{}@math{w} and height@tie{}@math{h} as an infinite data +structure, where each pixel +@ifinfo +@math{P(x, y)} +@end ifinfo +@html +<mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline"> + <mrowinline> + <mi>P</mi> + <mfencedinline> + <mi>x</mi> + <mi>y</mi> + </mfencedinline> + </mrowinline> +</mathinline> +@end html +@tex +$P(x, y)$ +@end tex +@docbook +<inlineequation> + <mml:math> + <mml:apply> + <mml:ci>P</mml:ci> + <mml:ci>x</mml:ci> + <mml:ci>y</mml:ci> + </mml:apply> + </mml:math> +</inlineequation> +@end docbook +of the input images represents the set of pixels @ifinfo @math{S_P(x, y)} @end ifinfo @@ -1139,7 +1168,8 @@ @cindex bits per channel @cindex channel width Force the number of bits per channel and the numeric format of the -output image. +output image.@footnote{``Channel depth'' sometimes is also called +``channel width''.} Enblend always uses a smart way to change the channel depth to assure highest image quality (at the expense of memory), whether @@ -1148,18 +1178,19 @@ @itemize @item -If the output-channel width is larger than the input-channel width of +If the output-channel depth is larger than the input-channel depth of the input images, the input images' channels are widened to the output -channel width immediately after loading, that is, as soon as possible. +channel depth immediately after loading, that is, as soon as possible. Enblend then performs all blending operations at the output-channel -width, thereby preserving minute color details which can appear in the +depth, thereby preserving minute color details which can appear in the blending areas. @item -If the output-channel width is smaller than the input-channel width of +If the output-channel depth is smaller than the input-channel depth of the input images, the output image's channels are narrowed only right -before it is written to disk, that is, as late as possible. Thus the -data benefits from the wider input channels for the longest time. +before it is written to the output @var{FILE}, that is, as late as +possible. Thus the data benefits from the wider input channels for +the longest time. @end itemize All @var{DEPTH} specifications are valid in lowercase as well as diff -r 5cb8b0d11926 -r 298e8ec9349a doc/enfuse.info Binary file doc/enfuse.info has changed diff -r 5cb8b0d11926 -r 298e8ec9349a doc/enfuse.texi --- a/doc/enfuse.texi Sat Feb 16 17:32:05 2013 +0100 +++ b/doc/enfuse.texi Fri Feb 22 15:58:47 2013 +0100 @@ -354,7 +354,7 @@ @chapter Workflow @cindex workflow -Enfuse is a part of a chain of tools to assemble images. It merges +Enfuse is part of a chain of tools to assemble images. It merges photos of the same subject at the same location and same direction, but taken with varying exposure parameters. @@ -552,8 +552,9 @@ Other formats do not accept a @var{COMPRESSION} setting. However, @uref{http://@/hci.iwr.uni-@/heidelberg.de/@/vigra/, -@acronym{VIGRA}} automatically compresses @file{png}-files with the -@sc{Deflate} method. +@acronym{VIGRA}@footnote{@acronym{VIGRA} is the image manipulaton +library on which Enfuse is based.}} automatically compresses +@file{png}-files with the @sc{Deflate} method. @end table @item --layer-selector=@var{ALGORITHM} @@ -637,7 +638,7 @@ <mrowinline> <msubinline> <mo>log</mo> - <mn>2</mo> + <mn>2</mn> </msubinline> <mo>⁡</mo> <mo>(</mo> @@ -645,8 +646,8 @@ <mo>min</mo> <mo>⁡</mo> <mfencedinline> - <mi mathvariant="italic">width</mi> - <mi mathvariant="italic">height</mi> + <mi>width</mi> + <mi>height</mi> </mfencedinline> </mrowinline> <mo>)</mo> @@ -708,7 +709,7 @@ @itemx --output=@var{FILE} @opindex -o @opindex --output -Place output in @var{FILE}. +Place fused output image in @var{FILE}. @cindex @file{@value{src::default-output-filename}} @cindex default output filename @@ -806,10 +807,38 @@ Otherwise, always avoid this option! -With this option, Enfuse treats the panorama of width@tie{}@math{w} -and height@tie{}@math{h} as an infinite data structure, where each -pixel@tie{}@math{P(x, y)} of the input images represents the set of -pixels +With this option Enfuse treats the set of input images (panorama?) of +width@tie{}@math{w} and height@tie{}@math{h} as an infinite data +structure, where each pixel +@ifinfo +@math{P(x, y)} +@end ifinfo +@html +<mathinline xmlns="http://www.w3.org/1998/Math/MathML" display="inline"> + <mrowinline> + <mi>P</mi> + <mfencedinline> + <mi>x</mi> + <mi>y</mi> + </mfencedinline> + </mrowinline> +</mathinline> +@end html +@tex +$P(x, y)$ +@end tex +@docbook +<inlineequation> + <mml:math> + <mml:apply> + <mml:ci>P</mml:ci> + <mml:ci>x</mml:ci> + <mml:ci>y</mml:ci> + </mml:apply> + </mml:math> +</inlineequation> +@end docbook +of the input images represents the set of pixels @ifinfo @math{S_P(x, y)} @end ifinfo @@ -1200,7 +1229,8 @@ @cindex bits per channel @cindex channel width Force the number of bits per channel and the numeric format of the -output image. +output image.@footnote{``Channel depth'' sometimes is also called +``channel width''.} Enfuse always uses a smart way to change the channel depth, to assure highest image quality (at the expense of memory), whether @@ -1209,18 +1239,19 @@ @itemize @item -If the output-channel width is larger than the input-channel width of +If the output-channel depth is larger than the input-channel depth of the input images, the input images' channels are widened to the output -channel width immediately after loading, that is, as soon as possible. +channel depth immediately after loading, that is, as soon as possible. Enfuse then performs all blending operations at the output-channel -width, thereby preserving minute color details which can appear in the +depth, thereby preserving minute color details which can appear in the blending areas. @item -If the output-channel width is smaller than the input-channel width of +If the output-channel depth is smaller than the input-channel depth of the input images, the output image's channels are narrowed only right -before it is written to disk, that is, as late as possible. Thus the -data benefits from the wider input channels for the longest time. +before it is written to the output @var{FILE}, that is, as late as +possible. Thus the data benefits from the wider input channels for +the longest time. @end itemize All @var{DEPTH} specifications are valid in lowercase as well as @@ -1418,13 +1449,29 @@ See @ref{Local Entropy Weighting} and @ref{Expert Options, Options entropy-window-size and entropy-cutoff}. +@item --exposure-optimum=@var{OPTIMUM} +@itemx --exposure-mu=@var{MEAN} @emph{(obsolete)} +@opindex --exposure-optimum + +Determine at what normalized exposure value the @var{OPTIMUM} exposure +of the input images is. This is, set the position of the maximum of +the exposure weight curve. Use this option to fine-tune exposure +weighting (@pxref{Exposure Weighting}). + +Valid range: @value{src::minimum-exposure-optimum} @leq{} @var{OPTIMUM} +@leq{} @value{src::maximum-exposure-optimum}. + +Default: @value{src::default-exposure-optimum}. + @item --exposure-weight=@var{WEIGHT} @opindex --exposure-weight @cindex weight, exposure -Sets the relative @var{WEIGHT} of the well-exposedness criterion. -Increasing this weight relative to the others will make well-exposed -pixels contribute more to the final output. +Set the relative @var{WEIGHT} of the ``well-exposedness'' criterion as +defined by the chosen exposure weight function (see +voption@tie{}@option{--exposure-weight-function} below). Increasing +this weight relative to the others will make well-exposed pixels +contribute more to the final output. Valid range: @value{src::minimum-weight-exposure} @leq{} @var{WEIGHT} @leq{} @value{src::maximum-weight-exposure}. @@ -1433,38 +1480,587 @@ @xref{Exposure Weighting}. -@item --exposure-mu=@var{MEAN} -@opindex --exposure-mu - -Set the @var{MEAN} (this is, the center) of the Gaussian exposure -weight curve. - -Valid range: @value{src::minimum-exposure-mu} @leq{} @var{MEAN} -@leq{} @value{src::maximum-exposure-mu}. - -Default: @value{src::default-exposure-mu}. - -Use this option to fine-tune exposure weighting (@pxref{Exposure -Weighting}). - -@item --exposure-sigma=@var{STD-DEV} -@opindex --exposure-sigma - -Standard deviation @var{STD-DEV} of the Gaussian exposure weight -curve. Low numbers give less weight to pixels that are far from -@option{--wMu} and vice versa. - -Valid range: @var{STD-DEV} @geq{} @value{src::minimum-exposure-sigma}. - -Default: @value{src::default-exposure-sigma}. - -Use this option to fine-tune exposure weighting (@pxref{Exposure -Weighting}). +@item --exposure-weight-function=@var{NAME} +@opindex --exposure-weight-function + +Override the default exposure weight function +@samp{@value{src::exposure-weight-function}}. Use one of the +@var{NAME}s in @ref{Table:exposure-weight-functions} to select a |