TEMERITY

us.temerity.pipeline.plugin.NukeMakeHDRAction.v2_4_2
Class NukeMakeHDRAction

java.lang.Object
  extended by us.temerity.pipeline.Named
      extended by us.temerity.pipeline.PluginID
          extended by us.temerity.pipeline.BasePlugin
              extended by us.temerity.pipeline.BaseAction
                  extended by us.temerity.pipeline.plugin.CommonActionUtils
                      extended by us.temerity.pipeline.plugin.CompositeActionUtils
                          extended by us.temerity.pipeline.plugin.NukeActionUtils
                              extended by us.temerity.pipeline.plugin.NukeMakeHDRAction.v2_4_2.NukeMakeHDRAction
All Implemented Interfaces:
Serializable, Cloneable, Comparable<PluginID>, Glueable

public class NukeMakeHDRAction
extends NukeActionUtils

Converts a series of varying exposure raw digital images into a single high dynamic range (HDR) environment map.

The raw input images are supplied as source nodes. Each of these source node's primary image sequence contains the range of exposures in CR2 format for one of (3) views. Each view is assumed to be shot with an 180 degree angular fisheye lense. The views should be oriented at 120 degree intervals in a horizontal plane. For best results, the number of exposure images and exposure settings should be indentical for of the (3) views. All images should have been shot with the same aperature and other camera settings and vary only in exposure time (shutter speed).

For a given view, the raw images are combined using a guassian-like filter which weights the contribution of a pixel from each exposure based on its intensity. Pixels closest to a value of (0.5) will receive higher weights, while pixels closer to (0.0) or (1.0) will receive lower weights. The idea being that the accuracy of the pixel value from the input image is best within the middle range of intensities and therefore its contribution to the output should be higher then from underexposed or overexposed images.

Before computing pixel weights, the pixel intensity from the input images are graded based on the given Black/White Point parameters. Since CCD values typically are never (0.0) even when no photons are hitting the recepter and pixel values close to (1.0) can also be innaccurate. There is a separate Lowest Black Point used for the longest exposure image. This gives finer control over the black point for the image with the most low intensity pixel values.

This action dynamically creates and executes a complex Nuke script based on its parameters and raw input images. This Nuke script can generate one or more HDR images depending on the names of the primary and secondary images sequences associated with the target node. The names of these target images are automatically determined based on the prefix of the node running this action as follows: prefix.hdr

The primary output combined HDR image. The format of this image will either be a latitude longitude cylindrical environment map (LatLon Mode) or a unwrapped cube face environment map in the standard cross layout (EnvCross Mode).

prefix_latlon.hdr
An optional secondary LatLon format combined HDR image.

prefix_cross.hdr
An optional secondary EnvCross format combined HDR image.

The generated Nuke script can also write HDR format diagnostic images for each of the input raw exposure image sequences based on their node name prefix as follows: input-prefix_combo.hdr
An optional secondary LatLon format HDR image containing the final combined exposure image for one of the input raw exposure views. This image will be combined with the corresponding images from the other views to produce the final output HDR image.

input-prefix_wts.hdr
An optional secondary LatLon format HDR image containing the combined pixel coverage weights from each of the raw input exposure images for a view. White pixels indicate good coverage, meaning that there are sufficient pixel values within the middle range in one or more exposures. Black pixels indicate bad coverage, meaning that none of the input exposure images contained middle range values for the pixel. In other words, that the pixel was either underexposed or overexposed in all images. If you see any black in this image, it means that there is not a sufficiently large range of exposures in the input images to fully represent the range of intensities in the scene. Darker areas in this image are also signs of poor coverage and therefore more error.

input-prefix_nofix.hdr
An optional secondary LatLon format HDR image containing the uncorrected combined exposure image for one of the input raw exposure views. This image may contain black pixels where there is no coverage from the input raw exposure images. This is most likely to be caused by a lack of sufficienly short exposure images to capture a very bright source of light in the image.


input-prefix_fix.hdr
An optional secondary LatLon format HDR image containing high intensity pixels which will fill in holes due to no coverage areas in the "nofix" image. The intensity of these pixels is generated based on the duration of the Missing Exposure parameter.

To generate any or all of these images, you simply need to add a secondary sequence with the correct name to the node using this action.

This action defines the following single valued parameters:

Output Format
The format for the primary output HDR image:
LatLon - Generates a latitute longitude cylindrical environment map.
EnvCross - Generates an unwrapped cube face environment map in the standard cross layout.

Output Size
The resolution of the output HDR image data across a 90 degree field of view. For LatLon images, the full output resolution will be (Size*4 x Size*2) since these images cover 360 degrees horizontally and 180 degrees vertically. For EnvCross images, each of the individual cube faces 90 covers degrees making the full output resolution (Size*3 x Size*4).

Exposure Times

The source node which provides a plain text file containing exposure times (in fractions of a second) for each of the raw input images. The exposures should be listed one per line and in the same order as the exposure images in each input image sequence. If specified, there must be exactly the same number of images in each of the (3) view input image sequences and each sequence must be in the same exposure duration order. If not specified, the action will use dcraw(1) to extract exposure times from each input image individually in which case the number and order of exposure images is arbitrary.

Missing Exposure
The exposure time (in fractions of a second) to give to pixels with zero coverage from the input raw images. The pixel values for these missing pixels will be computed by scaling a white (1.0) value by Missing Exposure. The logic being that the missing pixels are overexposed in even the shorted exposure time images.

Black Point
The minimum valid pixel value allowed in the raw exposure images. This value will be considered as black (0.0) and any values below this in the input images will be clamped to (0.0).

White Point
The maximum valid pixel value allowed in the raw exposure images. This value will be considered as white (1.0) and any values above this in the input images will be clamped to (1.0).

This action defines the following per-source parameters:

Order
This parameter determines the order in which the input raw exposure images are combined in the final LatLon format HDR output image. Input images are composited from left-to-right (increasing longitude) based on increasing Order. If this parameter is not set for a source node file sequence, it will be ignored.

By default, this Action executes the "Nuke4.6" binary. This can be overridden by specifying an alternate binary with the NUKE_BINARY environmental variable in the Toolset used to run this Action plugin. On Windows, the Nuke binary name should include the ".exe" extension.

If no Exposure Times file is specified, this action will use the dcraw(1) program (http://www.cybercom.net/~dcoffin/dcraw) to extract exposure information from the CR2 image header.

See Also:
Serialized Form

Field Summary
static String aBlackPoint
           
static String aEnvCross
           
static String aExposureTimes
           
static String aLatLon
           
static String aMissingExposure
           
static String aOrder
           
static String aOutputFormat
           
static String aOutputSize
           
static String aWhitePoint
           
 
Fields inherited from class us.temerity.pipeline.plugin.CompositeActionUtils
aAdd, aAlphaAdd, aAlphaMode, aBlack, aBlendMode, aClassicColorBurn, aClassicColorDodge, aClassicDifference, aColor, aColorBurn, aColorDodge, aCompFrameRate, aCompHeight, aCompPixelRatio, aCompWidth, aDancingDissolve, aDarken, aDifference, aDissolve, aExclusion, aFrameRate, aHardLight, aHue, aIgnore, aLayer, aLighten, aLinearBurn, aLinearDodge, aLinearLight, aLuminescentPremul, aLuminosity, aMultiply, aNormal, aOverlay, aPass, aPinLight, aPixelRatio, aPreMultColor, aPreMultipled, aSaturation, aScreen, aSilhouetteAlpha, aSilhouetteLuma, aSoftLight, aStencilAlpha, aStencilLuma, aStraight, aVividLight, aWhite
 
Fields inherited from class us.temerity.pipeline.plugin.CommonActionUtils
aExtraOptions
 
Fields inherited from class us.temerity.pipeline.BasePlugin
pDescription
 
Fields inherited from class us.temerity.pipeline.PluginID
pVendor, pVersionID
 
Fields inherited from class us.temerity.pipeline.Named
pName
 
Constructor Summary
NukeMakeHDRAction()
           
 
Method Summary
 TreeMap<String,ActionParam> getInitialSourceParams()
          Get an initial set of action parameters associated with an upstream node.
 SubProcessHeavy prep(ActionAgenda agenda, File outFile, File errFile)
          Construct a SubProcessHeavy instance which when executed will fulfill the given action agenda.
 boolean supportsSourceParams()
          Does this action support per-source parameters?
 
Methods inherited from class us.temerity.pipeline.plugin.NukeActionUtils
getNukeExtensions, getNukeProgram, getNukeProgram, getNukeProgramVersion, getNukeProgramVersion, toNukeFilePattern, toNukeFrameRange
 
Methods inherited from class us.temerity.pipeline.plugin.CompositeActionUtils
addCompFrameRateParam, addCompHeightParam, addCompPixelRatioParam, addCompWidthParam, addSourceAlphaModeParam, addSourceFrameRateParam, addSourceLayerParam, addSourceOrderParam, addSourcePassParam, addSourcePixelRatioParam, addSourcePreMultColorParam
 
Methods inherited from class us.temerity.pipeline.plugin.CommonActionUtils
addExtraOptionsParam, addExtraOptionsParamToLayout, createScriptSubProcess, createSubProcess, createSubProcess, createSubProcess, createSubProcess, createTempCopySubProcess, createTempScript, escPath, escPath, getExtraOptionsArgs, getPrimarySourcePath, getPrimarySourcePath, getPrimarySourcePath, getPrimarySourcePaths, getPrimarySourcePaths, getPrimarySourcePaths, getPrimaryTargetPath, getPrimaryTargetPath, getPrimaryTargetPath, getPrimaryTargetPaths, getPrimaryTargetPaths, getPrimaryTargetPaths, getSecondarySourceBooleanParamValue, getSecondarySourceDoubleParamValue, getSecondarySourceDoubleParamValue, getSecondarySourceEnumParamIndex, getSecondarySourceIntegerParamValue, getSecondarySourceIntegerParamValue, getSecondarySourceLongParamValue, getSecondarySourceLongParamValue, getSecondarySourceOptionalBooleanParamValue, getSecondarySourceStringParamValue, getSecondarySourceStringParamValue, getSingleBooleanParamValue, getSingleDoubleParamValue, getSingleDoubleParamValue, getSingleEnumParamIndex, getSingleIntegerParamValue, getSingleIntegerParamValue, getSingleLongParamValue, getSingleLongParamValue, getSingleOptionalBooleanParamValue, getSingleStringParamValue, getSingleStringParamValue, getSingleTuple2dParamValue, getSingleTuple2dParamValue, getSingleTuple2dParamValue, getSingleTuple2iParamValue, getSingleTuple2iParamValue, getSingleTuple2iParamValue, getSingleTuple3dParamValue, getSingleTuple3dParamValue, getSingleTuple3dParamValue, getSingleTuple3iParamValue, getSingleTuple3iParamValue, getSingleTuple3iParamValue, getSingleTuple4dParamValue, getSingleTuple4dParamValue, getSingleTuple4dParamValue, getSourceBooleanParamValue, getSourceDoubleParamValue, getSourceDoubleParamValue, getSourceEnumParamIndex, getSourceIntegerParamValue, getSourceIntegerParamValue, getSourceLongParamValue, getSourceLongParamValue, getSourceOptionalBooleanParamValue, getSourceStringParamValue, getSourceStringParamValue, getWorkingNodeFilePath, getWorkingNodeFilePath, getWorkingNodeFilePath, getWorkingNodeFilePath, getWorkingNodeFilePaths
 
Methods inherited from class us.temerity.pipeline.BaseAction
addPreset, addPresetValues, addSingleParam, chmod, cleanupLater, clearAllLinkParams, clearLinkParams, clone, createTemp, createTemp, equals, equalSingleParams, equalSourceParams, fromGlue, getPluginType, getPresetChoices, getPresetValues, getSecondarySequences, getSecondarySourceNames, getSecondarySourceParam, getSecondarySourceParams, getSecondarySourceParamValue, getSingleLayout, getSingleParam, getSingleParams, getSingleParamValue, getSourceLayout, getSourceNames, getSourceParam, getSourceParams, getSourceParamValue, getTempDir, getTempPath, hasSecondarySourceParams, hasSingleParams, hasSourceParams, initSecondarySourceParams, initSourceParams, removeAllSourceParams, removeSecondarySourceParams, removeSecondarySourceParams, removeSourceParams, setSecondarySourceParamValue, setSingleLayout, setSingleParamValue, setSingleParamValues, setSourceLayout, setSourceParamValue, setSourceParamValues, toGlue
 
Methods inherited from class us.temerity.pipeline.BasePlugin
addSupport, compareTo, getDescription, getFullMessage, getPluginID, getResource, getResources, getResourceSize, getSupports, isUnderDevelopment, removeSupport, setSupports, supports, toString, underDevelopment
 
Methods inherited from class us.temerity.pipeline.PluginID
getVendor, getVersionID
 
Methods inherited from class us.temerity.pipeline.Named
getName
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

aOutputFormat

public static final String aOutputFormat
See Also:
Constant Field Values

aLatLon

public static final String aLatLon
See Also:
Constant Field Values

aEnvCross

public static final String aEnvCross
See Also:
Constant Field Values

aOutputSize

public static final String aOutputSize
See Also:
Constant Field Values

aExposureTimes

public static final String aExposureTimes
See Also:
Constant Field Values

aMissingExposure

public static final String aMissingExposure
See Also:
Constant Field Values

aBlackPoint

public static final String aBlackPoint
See Also:
Constant Field Values

aWhitePoint

public static final String aWhitePoint
See Also:
Constant Field Values

aOrder

public static final String aOrder
See Also:
Constant Field Values
Constructor Detail

NukeMakeHDRAction

public NukeMakeHDRAction()
Method Detail

supportsSourceParams

public boolean supportsSourceParams()
Does this action support per-source parameters?

Overrides:
supportsSourceParams in class BaseAction

getInitialSourceParams

public TreeMap<String,ActionParam> getInitialSourceParams()
Get an initial set of action parameters associated with an upstream node.

Overrides:
getInitialSourceParams in class BaseAction

prep

public SubProcessHeavy prep(ActionAgenda agenda,
                            File outFile,
                            File errFile)
                     throws PipelineException
Construct a SubProcessHeavy instance which when executed will fulfill the given action agenda.

Overrides:
prep in class BaseAction
Parameters:
agenda - The agenda to be accomplished by the action.
outFile - The file to which all STDOUT output is redirected.
errFile - The file to which all STDERR output is redirected.
Returns:
The SubProcess which will fulfill the agenda.
Throws:
PipelineException - If unable to prepare a SubProcess due to illegal, missing or imcompatable information in the action agenda or a general failure of the prep method code.

TEMERITY