C_StereoColourMatcher
The C_StereoColourMatcher node enables you match the colors of one view with those of another. It has been specifically designed to deal with the subtle color differences that are sometimes present between stereo views.
Note: C_StereoColourMatcher requires disparity vectors from an upstream C_DisparityGenerator to reconstruct views.
Inputs and Controls
Connection Type |
Connection Name |
Function |
Input |
Source |
A stereo pair of images. If disparity channels and occlusion masks are not embedded in the images and you are using the Local Matching mode, you need to add a C_DisparityGenerator node after the image sequence. |
Mask |
An optional mask that determines where to take the color distribution from. For example, if you have a clip showing a person in front of a green screen, you might want to use a mask to exclude the green area so the node concentrates on matching the person. In the Basic mode, C_StereoColourMatcher calculates the transform on the masked area of the source view but applies it to the whole of the view it's correcting. In the Local Matching mode, it calculates the transform on the masked area and applies it to that area only. |
Control (UI) |
Knob (Scripting) |
Default Value |
Function |
C_StereoColourMatcher 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.
|
Left View |
leftView |
main |
Select the two views you want to match. These views are mapped for the left and right eye. |
Right View |
rightView |
main |
|
Match |
matchWhat |
Left to Right |
Sets how to match the colors between views: • Left to Right - adjust the colors of the left view to match with those of the right. • Right to Left - adjust the colors of the right view to match with those of the left. |
Mode |
matchingMode |
Local Matching |
Sets the algorithm to use for the color matching: • Basic - This mode takes the color distribution of one entire view and modifies that to match the distribution of the other view. • Local Matching - This mode first divides the two images into square blocks according to the Block Size control. Then, it matches the color distribution from the view that want to modify to a reconstructed version of the same view, which has been constructed using the pixels of the source view. This can be useful if there are local color differences between the views, such as highlights that are brighter in one view than the other. Note: Both modes require a C_DisparityGenerator node upstream of the C_StereoColourMatcher node. |
Mask |
maskWith |
None |
Sets the channel to use as a mask when calculating the color transformation: • None - none of the footage is ignored. • Source Alpha - use the alpha channel of the source clip to define which areas to ignore. • Source Inverted Alpha - use the inverted alpha channel of the source clip to define which areas to ignore. • Mask Luminance - use the luminance of the Mask input to define which areas to ignore. • Mask Inverted Luminance - use the inverted luminance of the Mask input to define which areas to ignore. • Mask Alpha - use the Mask input alpha channel to define which areas to ignore. • Mask Inverted Alpha - use the inverted Mask input alpha channel to define which areas to ignore. |
Local Matching |
|||
Preview color correction |
previewCorrection |
disabled |
When enabled, a difference overlay previews the areas of color correction applied to the original image. |
Block Size |
blockSize |
5 |
Defines the width and height (in pixels) of the square blocks that the images are divided into when calculating the color match. You can set different block sizes for each view. |
Scale |
correctionScale |
0.5 |
Sets the image scale for local color matching. You can increase the Scale to broaden the color update and preserve the image structure, helping to prevent image shift and wobble. Decrease the Scale to pick up highlights and detailed color changes. |
Limit |
correctionLimit |
1 |
Sets a limit on local color matching against the average correction in a region. If you notice excessive color changes in areas of highlight, try reducing the Limit. |
Noise |
noiseLevel |
0.25 |
Sets how much noise to retain from the original image. If the color matching smooths the input noise, increase the Noise value. If the value is too high, color differences at very fine details are retained. |
Occlusions |
|||
Output corrected area to alpha |
outputOcclusions |
disabled |
When enabled, output the corrected area to the alpha channel. The corrected area can consist of the occlusion mask and the disparity edge mask set using the Adjust Edges control, depending on what the Correction control is set to (Occlusions, Occlusionsand Edges, or None). |
Correction |
occlusionCorrection |
Occlusions |
Defines which areas receive the color correction when local color matching is not valid: • Occlusions - fill occluded pixels only, where color is missing from the other view. • Occlusions and Edges - fill occluded pixels, where color is missing from the other view, and compensate for disparity changes at edges where matching and/or reconstruction can fail. • None - apply no occlusion or edge correction. |
Adjust Edges |
adjustEdges |
0 |
Sets the threshold for treating image edges as occlusions to reduce haloing and edge flicker. The higher the value, the more image edges are considered occlusions even if they are not marked as such in the upstream occlusion mask. |
Colour Tolerence |
colourTolerance |
0.1 |
Sets the amount of blurring across edges in the color match at occluded regions. Decrease this to restrict the color correction in occluded regions to similar colors. Increase the value to blur the color correction. |
Support Size |
supportSize |
20 |
Sets the size of the region (in pixels) of unoccluded pixels used to calculate the color correction at an occluded pixel. C_StereoColourMatcher first finds the closest unoccluded pixel and then expands that distance by this number of pixels to determine the amount of unoccluded pixels to use. |
Stabilise Occlusions |
stabiliseOcclusions |
enabled |
When enabled, flicker can be reduced in occluded areas by using data from multiple frames. |