O_DisparityGenerator

The O_DisparityGenerator plug-in is used to create disparity fields for stereo images. A disparity field maps the location of a pixel in one view to the location of its corresponding pixel in the other view. It includes two sets of disparity vectors: one maps the left view to the right, and the other maps the right view to the left.

The following Nuke plug-ins rely on disparity fields to produce their output:

O_OcclusionDetector

O_ColourMatcher (in 3D LUT and Local Matching modes)

O_FocusMatcher

O_VerticalAligner (in Local Alignment mode)

O_NewView

O_InteraxialShifter

O_VectorGenerator

O_DisparityToDepth, and

O_DisparityViewer.

Inputs and Controls

Connection Type

Connection Name

Function

Input

 

 

Fg

An optional mask that specifies the area to calculate disparity. You can use this to create a disparity layer for a foreground element.

Ignore

An optional mask that specifies areas to exclude from the disparity calculation.

Note:  Masks should exist in both views, and O_DisparityGenerator expects alpha values of either 0 (for background) or 1 (for foreground).

Solver

If the Source sequence doesn’t contain features that O_Solver is able to match well, you can use O_Solver on another sequence shot with the same camera setup. If you do so, connect O_Solver to this input.

Source

A stereo pair of images. The images should be followed by an O_Solver node, unless you’re using the Solver input.

Control (UI)

Knob (Scripting) Default Value Description

O_DisparityGenerator

Views to Use

viewPair

Dependent on source

Sets the two views you want to use to create the disparity field. These views will be mapped for the left and right eye.

Ignore Mask

ignoreMask

None

Sets the mask type to exclude areas of the sequence:

Note:  Masks should exist in both views, and O_DisparityGenerator expects alpha values of either 0 (for regions to use) or 1 (for regions to ignore).

None - do not use an ignore mask.

Source Alpha - use the alpha channel of the Source clip as an ignore mask.

Source Inverted Alpha - use the inverted alpha channel of the Source clip as an ignore mask.

Mask Luminance - use the luminance of the Ignore input as an ignore mask.

Mask Inverted Luminance - use the inverted luminance of the Ignore input as an ignore mask.

Mask Alpha - use the alpha channel of the Ignore input as an ignore mask.

Mask Inverted Alpha - use the inverted alpha channel of the Ignore input as an ignore mask.

Foreground Mask

foregroundMask

None

Sets an optional mask that specifies the area to calculate disparity. You can use this to create a disparity layer for a foreground element. You can also use the Ignore mask to exclude elements in the foreground region.

Note:  Masks should exist in both views, and O_DisparityGenerator expects alpha values of either 0 (for background) or 1 (for foreground).

None - do not use a foreground mask.

Source Alpha - use the alpha channel of the Source clip as a foreground mask.

Source Inverted Alpha - use the inverted alpha channel of the Source clip as a foreground mask.

Mask Luminance - use the luminance of the Fg input as a foreground mask.

Mask Inverted Luminance - use the inverted luminance of the Fg input as a foreground mask.

Mask Alpha - use the alpha channel of the Fg input as a foreground mask.

Mask Inverted Alpha - use the inverted alpha channel of the Fg input as a foreground mask.

Noise

noiseLevel

0

Sets the amount of noise O_DisparityGenerator should ignore in the input footage when calculating the disparity field.

The higher the value, the smoother the disparity field. You may want to increase this value if you find that the disparity field is noisy in low-contrast image regions.

Strength

strength

1

Sets the strength in matching pixels between the left and right views.

Higher values allow you to accurately match similar pixels in one image to another, concentrating on detail matching even if the resulting disparity field is jagged. Lower values may miss local detail, but are less likely to provide you with the odd spurious vector, producing smoother results.

Consistency

consistency

0.1

Sets the constrains applied the left and right disparities to be consistent. Increase the value to encourage the left and right disparity vectors to match.

Alignment

alignment

0.1

Sets how much to constrain the disparities to match the horizontal alignment defined by an upstream O_Solver node.

A value of 0 calculates the disparity using unconstrained motion estimation. Increasing the value forces the disparities to be aligned. In most cases, you want this set to 0 or the default value of 0.1.

Sharpness

sharpness

0

Sets how distinct object boundaries should be in the calculated disparity field.

Increase this value to produce distinct borders and separate objects. Decrease the value to blur disparity layers together and minimise occlusions.

For better picture building with O_NewView, O_InteraxialShifter, O_FocusMatcher, and O_Retimer, you can set this value to 0.

Smoothness

smoothness

0

Sets the amount of extra smoothing applied to the disparity field as a post process after image matching.

The higher the value, the smoother the result. You can use this in conjunction with the Sharpness parameter to smooth out the disparity field separately for distinct objects in the shot.

Parallax Limits

Enforce parallax limits

enforceParallax
Limits

disabled

When enabled, O_DisparityGenerator limits the disparity to the specified Negative and Positive values to remove incorrect disparity vectors. You can review the disparity range using the Parallax Histogram display in O_DisparityViewer.

Negative

negativeParallax
LimitInPixels

-100

Sets the maximum negative parallax, in pixels. With negative parallax, pixels in the left image are to the right of pixels in the right and objects appear in front of the screen plane.

Negative parallax is defined by the maximum disparityL.x and minimum disparityR.x values for the aligned images.

Positve

positiveParallax
LimitInPixels

100

Sets the maximum positive parallax, in pixels. With positive parallax, pixels in the left image are to the left of pixels in the right and objects appear behind the screen plane.

Positive parallax is defined by the minimum disparityL.x and maximum disparityR.x values for the aligned images.

Video Tutorials