O_FocusMatcher

O_FocusMatcher attempts to correct subtle focus differences that are typically present between the left and right views of a stereo image. It does this by matching the focus distribution of one view to that of the other, based on the disparity vectors upstream.

Inputs and Controls

Connection Type

Connection Name

Function

Input

Kernel

An optional input that allows you to change the shape of the deblur kernel. By default, the kernel is a circular disc. If the way your camera lens renders out-of-focus points of light is not circular, you can input another shape here. O_FocusMatcher then uses the luminance of this RGB image to define the kernel shape.

The size of this image doesn’t matter, as O_FocusMatcher automatically resizes the image to provide the radius defined by Defocus Size.

This input only has an effect if Primary Method is set to Deblur, or Rebuild Method to Rebuild Plus Deblurred.

Source

A stereo pair of images.

Note:  If disparity channels aren’t embedded in the images, you should add an O_Solver and an O_DisparityGenerator node after the image sequence.

If occlusion masks aren’t embedded in the images, you also need an O_OcclusionDetector node after O_DisparityGenerator.

Control (UI)

Knob (Scripting)

Default Value

Function

O_FocusMatcher Tab

Views to Use

viewPair

Dependent on Source

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

Match

matchWhat

Left to Right

Sets which view to match to the other’s focus:

Left to Right - deblur or rebuild the left view to match the right.

Right to Left - deblur or rebuild the right view to match the left.

Primary Method

primaryMethod

Rebuild

Sets how to match the focus:

Rebuild - rebuild one view using the pixels from the other. You can use the Rebuild Method control to select how to handle occluded regions where the picture building fails.

Choose this method if your input images are heavily blurred or the blur varies across the image.

Deblur - deconvolve one view with the specified kernel. You can use the Deblur Options and the Kernel input to adjust the size and shape of the kernel.

Choose this method if your input images are only slightly blurred and the blur is constant across the image.

Rebuild Options

Rebuild Method

rebuildMethod

Rebuild Plus Original

When Primary Method is set to Rebuild, choose how to handle occluded regions where the picture building is likely to fail.

Note:  You need to use an upstream O_OcclusionDetector node to define which regions are considered occluded. O_OcclusionDetector stores this information in the mask_occlusion channel.

Rebuild Plus Deblurred - use the deblurred image in any occluded regions defined in the mask_occlusion channel. You can use the Deblur Options and the Kernel input to adjust the size and shape of the deblur kernel.

Rebuild Plus Original - use the original image in any occluded regions defined in the mask_occlusion channel.

Rebuild Only - use the rebuilt image in any occluded regions defined in the mask_occlusion channel.

Match Original Colour

matchOriginalColour

enabled

When enabled, the rebuilt view has the colour profile of the original view (for example, a rebuilt right view matches the colours of the original right view).

When disabled, the rebuilt view has the colour profile of the view it was rebuilt from (a rebuilt right view matches the colours of the left view).

Deblur Options

Iterations

iterations

20

Sets the number of times the deconvolution algorithm is run for.

Increasing this value may create a sharper image but potentially at the cost of more artefacts.

Defocus Size

defocusSize

0

Sets the size of the kernel the image has been blurred with. This value is in pixels. It’s very important to get it right, so keep adjusting it until you get nice deblurring with sharp edges but no ringing.

Remove Ringing

removeRinging

enabled

When enabled, O_FocusMatcher attempts to reduce ringing artefacts that may appear around the edges in the image.

Ring Range

ringRange

5

Sets the distance from an edge (in pixels) to suppress ringing artefacts.

Ring Ratio

ringRatio

10

Sets the strength of a strong edge relative to a nearby ringing artefact.

Decreasing this value removes more ringing artefacts, but may also stop real edges from being deblurred.

Video Tutorials