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 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. 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.
|
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. |
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. |
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. |