O_ColourMatcher

The O_ColourMatcher plug-in lets you match the colours of one view with those of another. It has been specifically designed to deal with the subtle colour differences that are sometimes present between stereo views.

Inputs and Controls

Connection Type

Connection Name

Function

Input

Mask

An optional mask that determines where to take the colour 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 plug-in concentrates on matching the person.

Source

A stereo pair of images.

If disparity channels and occlusion masks aren’t embedded in the images and you are using the 3D LUT or Local Matching mode, you should use an O_Solver, an O_DisparityGenerator, and an O_OcclusionDetector node after the image sequence.

Control (UI)

Knob (Scripting)

Default Value

Function

O_ColourMatcher Tab

Views to Use

viewPair

Dependent on source

Sets the two views whose colours you want to match. These views will be mapped for the left and right eye.

Match

matchWhat

Left to Right

Sets how to match the colours between views:

Left to Right - adjust the colours of the left view to match with those of the right.

Right to Left - adjust the colours of the right view to match with those of the left.

Mode

matchingMode

Basic

Sets the algorithm to use for the colour matching:

Basic - this mode takes the colour distribution of one entire view and modifies that to match the distribution of the other view.

3D LUT - this mode generates a global look-up table (LUT) from local matches at unoccluded pixels.

Note:  This mode requires that there is a disparity field and an occlusion mask in the input data stream. If these don’t yet exist, you can create them using the O_Solver, O_DisparityGenerator, and OcclusionDetector plug-ins.

Local Matching - this mode first divides the two images into square blocks according to the Block Size control. Then, it matches the colour distributions between corresponding blocks in the two views. This can be useful if there are local colour differences between the views, such as highlights that are brighter in one view than the other. Note that this mode requires that there is a disparity field in the input data stream. If there isn’t, you can create one using the O_Solver and O_DisparityGenerator plug-ins.

Note:  If Occlusion Compensate is enabled, this mode also requires an occlusion mask upstream. If one doesn’t exist, you can use O_OcclusionDetector to create one.

Export 3D LUT

exportLUT

N/A

Click to export the colour change calculated for the current frame as a 3D look-up table (LUT) in .vf format.

This allows you to apply the LUT separately using Nuke’s Vectorfield (Color > 3D LUT > Vectorfield) node. This control is only available in the 3D LUT mode.

Local Matching Options

Block Size

blockSize

20

Defines the width and height (in pixels) of the square blocks that the images are divided into when calculating the colour match.

Note:   This control is only available in the Local Matching mode.

Occlusion Compensate

occlusionCompensate

enabled

When Occlusion Compensate is enabled, O_ColourMatcher looks for similar colours in the nearby unoccluded areas that it has already been able to match and uses the closest colour it finds.

Note:  This requires an occlusion mask upstream (you can create one using O_OcclusionDetector) and is only available in the Local Matching mode.

Edge Occlusion

edgeOcclusion

0.40000001

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 aren’t marked as such in the upstream occlusion mask.

Note:  This control is only available when Occlusion Compensate is enabled.

Colour Sigma

colourSigma

2

Sets the amount of blurring across edges in the colour match at occluded regions.

Decrease this to restrict the colour correction in occluded regions to similar colours. Increase the value to blur the colour correction.

Note:  This control is only available when Occlusion Compensate is enabled.

Region Size

regionSize

25

Sets the size of the region (in pixels) of unoccluded pixels used to calculate the colour correction at an occluded pixel.

Tip:  When Occlusion Compensate is enabled, O_ColourMatcher first finds the closest unoccluded pixel and then expands that distance by this number of pixels to pick up unoccluded pixels to use.

Multi-scale Options

Number of Samples

samples

5

Sets the number of samples in Local Matching mode.

Using a value larger than 1 calculates the correction for multiple block sizes - between Block Size and Max Block Size - and then blends the results together. This can help to reduce errors.

Max Block Size

maxBlockSize

100

Sets the size (in pixels) of the maximum block size to go up to when using multiple samples in the Local Matching mode.

Note:  This control is only available if you have set Mode to Local Matching and Number of Samples to a value larger than 1.

Sample Spacing

intervalType

Uniform

Sets the type of sampling intervals to use when using multiple samples in the Local Matching mode:

Uniform - the sampling interval remains constant. The samples are spaced evenly.

Favour Small Block Sizes - the sampling interval increases as the block size increases. This weights the correction towards smaller block sizes, which preserve more detail, while still including some larger block sizes, which are more immune to disparity errors.

Colour Correction Type

correctionType

Best Guess

Determines how O_ColourMatcher divides the two views into square blocks and matches the colour distributions between corresponding blocks:

Tip:   If you set Number of Samples to a value larger than 1, Colour Correction Type does this for multiple block sizes and then combines the results for different block sizes together.

Minimum Correction - out of the results you have, this picks the smallest correction at each point (that is, closest to your original image). This option can be useful if you have a very poor disparity map.

Best Guess - out of the results you have, this picks the closest correction to the target image at each point. The target image is created by using the disparity field to warp the other view onto the image you're trying to correct. This option can be useful if you have a very good disparity map.

Average Correction - use the mean value of the colour correction at each point. This option is the default.

Note:  This control is only available if you have set Mode to Local Matching.

Mask Options

Mask Components

maskWith

None

Sets the channel to use as a mask when calculating the colour transformation:

None - use the entire image area.

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

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

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

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

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

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

Video Tutorials