C_DisparityGenerator

The C_DisparityGenerator node is used to create disparity maps for stereo images. A disparity map describes the location of a pixel in one view in relation 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.

Note:  C_DisparityGenerator differs from the Ocula version in that it can also map in latlong space, meaning disparity vectors are mapped as they pass the edge of the frame when the image wraps around.

Inputs and Controls

Connection Type

Connection Name

Function

Input

 

Source The stereo sequence you want to calculate disparity vectors from.

Mask

An optional mask that specifies areas to exclude from the disparity calculation. You can use this input to prevent distortions at occlusions or to calculate disparity for a background layer by ignoring foreground elements.

Control (UI)

Knob (Scripting)

Default Value

Function

C_ColourMatcher Tab

Local GPU

gpuName

N/A

Displays the GPU used for rendering when Use GPU if available is enabled. Local GPU displays Not available when:

Use CPU is selected as the GPU device in the Preferences.

no suitable GPU was found on your system.

it was not possible to create a context for processing on the selected GPU, such as when there is not enough free memory available on the GPU.

You can select a different GPU device, if available, by navigating to the Preferences and selecting an alternative from the GPU Device dropdown.

Note:  Selecting a different GPU requires you to restart Nuke before the change takes effect.

Use GPU if available

useGPUIfAvailable

enabled

When enabled, rendering occurs on the Local GPU specified, if available, rather than the CPU. The output between the GPU and CPU is identical on NVIDIA GPUs, but using the GPU can significantly improve processing performance.

CaraVR supports AMD GPUs on late 2013 Mac Pro 6,1, mid 2015 Mac Pro 11,5, and and late 2016 MacBook Pro 13,3, running OS X 10.9.3 'Mavericks', or later. While, in some cases the bit-wise equality between GPU and CPU holds, for some operations there are limitations to the accuracy possible with this configuration.

Note:  Enabling this option with no local GPU allows the script to run on the GPU whenever the script is opened on a machine that does have a GPU available.
You should also select this if you wish to render from the command line with the --gpu option.

GPU processing also requires certain NVIDIA and AMD drivers. For more information on the minimum requirements, please refer to the Nuke Release Notes available in Help > Release Notes.

Input

Left View

letfView

main

Sets the view to use for the left eye when calculating disparity.

Right View

rightView

main

Sets the view to use for the right eye when calculating disparity.

Projection

inputProjectionType

Default

Sets the projection type to use when calculating disparity:

Default - uses standard rectilinear projection when calculating disparity.

Latlong - uses latlong projection when calculating disparity, allowing for vector continuity across the frame edges.

Note:  Setting Projection to Latlong enables the Output > Vectorspace control, described below.

Mask

maskWith

None

An optional mask that specifies areas to exclude from the disparity calculation. You can use this input to prevent distortions at occlusions or to calculate disparity for a background layer by ignoring all foreground elements.

Note that masks should exist in both views, and C_DisparityGenerator treats the alpha values of 1 as foreground and blurs to the 0 value using nearby disparity to recreate object boundaries, rather than image data. When you create a mask using Roto or RotoPaint, you can use the feather control to extend the calculation. For example, the disparity map may have a sharper transition at depth edges with a binary mask, but applying feather on the mask can help smooth the resulting image.

None - use the entire image area.

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 Mask input as an ignore mask.

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

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

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

Vector Generation

Vector Detail

vectorDetail

0.3

Adjusts the density of the calculated disparity vectors. Higher detail picks up finer disparity changes, but takes longer to calculate.

Strength

strength

1.5

Sets the strength applied when 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 map is jagged. Lower values may miss local detail, but are less likely to provide you with the odd spurious vector, producing smoother results.

Often, it is necessary to trade one of these qualities off against the other. You may want to increase Strength to force the views to match where fine details are missed, or decrease it to smooth out the disparity map.

Consistency

consistency

1

Sets how accurately the same points in the left and right views are mapped to each other. Increase the value to encourage the left and right disparity vectors to match.

Smoothness

smoothness

1

Controls depth changes at image edges. In high contrast images, increase the smoothness to reduce depth separation at image edges. In low contrast images, decrease the smoothness to pick up depth changes on image edges.

Output

Vectorspace

vectorSpace

Default (wrapped)

Controls how disparity vectors behave at the left and right edges of the image:

Note:  The Vectorspace control is only enabled when Projection is set to Latlong.

Default (wrapped) - the vectors are simply wrapped around from left to right and right to left. This method can produce discontinuity at edges, but it's the format required by regular Nuke nodes, such as IDistort.

Continuous - this method calculates vectors across the left and right edges to produce a more sensible result for use with CaraVR nodes, such as C_NewView.

Note:  If you intend to use the disparity vectors with regular Nuke nodes, such as IDistort, set Vectorspace to Default (wrapped).

Occlusion Tab

Gradient Threshold

gradientThreshold

1

Defines where occlusions occur at depth changes. The lower the Gradient Threshold, the greater the number of occluded regions.

Consistency Threshold

consistencyThreshold

1

Defines occlusions where the left and right disparities are not consistent. A low Consistency Threshold value detects more inconsistencies.

Dilate Occlusions

dilationSize

5

Expands or contracts the occluded regions by a specified number of pixels. The maximum you can dilate occlusions by is 20 pixels.