There is always an issue with keying defocused and motion blurred objects: the color on the edges is mixed with the color of the background.
Basically, the problem arises even with static objects which are in focus, because there is always some softness in the practical image.

The most obvious solution to this is either to suppress (desaturate) the background color or to shrink the objects' edges.
In first case, you may have a problem if the background luminance is different, for instance, if you key dark objects against white (like trees against the sky)
In second case, the blurring may be so strong, that the objects disappear completely with shrinking.

This macro expands the actual color of the objects so that it extends through the entire blurred areas, replacing the background color mixture.

This tool can also solve the edging problem which happens due to the data compression or chromatic aberrations or any other edge artefacts.

The workflow is the following:

  1. Connect the macro after your keyer
  2. Set the Output Image parameter to Pre-Shrunk Image
  3. Adjust the Pre-Shrink parameters so that the shrinking was as little as possible to just cut BG color spill completely
  4. Switch the Output Image to Extended Color to check with what colors you are going to fill the edges, adjust the shrinking if nessesary
  5. Switch the Output Image to Final Result
  6. Set the Extend parameters so that you see no sharp borders in the blurred areas. Keep the parameters values as small as possible
  7. Adjust the Soften Border group so that you don't see a border between the internal untouched areas and the recolored blurred areas
The macro outputs the edges mask to the Coverage channel, you can use it as a mask to re-apply grain.

Node Inputs

Input - Source image. Required.
Effect Mask - Defines the areas where the edges are being restored. Optional.

Controls Tab

Pre-Shrink Amount - Slider control. Srinks the edges preliminary to cut the background color completely.
Pre-Srink X Multiplier - Slider control. Adjusts the horizontal amount of shrinking.
Pre-Srink Y Multiplier - Slider control. Adjusts the vertical amount of shrinking.
Extend Amount - Slider control. Extends the internal objects' color to cover the entire blurred edges area.
Extend X Multiplier - Slider control. Adjusts the horizontal extension amount.
Extend Y Multiplier - Slider control. Adjusts the vertical extension amount.
Soften Border - Slider control. Softens the border between the restored edges and the internal unaffected parts of the objects.
Soften Border X Multiplier - Slider control. Adjusts the horizontal amount of border softening.
Soften Border Y Multiplier - Slider control. Adjusts the vertical amount of border softening.
Size Mode - Multi-button control. Lets you choose between standard Fusion units related to the image width and pixels. Setting the parameters in pixels is handy in case of narrow edges whose width may be estimated in pixels more easily.
Output Image - Multi-button control. Displays different stages of the process to adjust the parameter groups more precisely.


Development History and Discussion on PigsFly

Download BlurredEdgesRestoration v04-5

To install the macro, place the downloaded GC_BlurredEdgesRestoration_v04.5.setting file into your Fusion:\Macros folder. Then you can insert it to the Flow either choosing from the main menu: Tools › Macro or by pressing Ctrl+Space and typing the tool name.
You can also drag and drop the file directly from your file manager into the Flow for immediate use without installation.

© 23.08.2010 - 01.02.2015 Gregory Chalenko
Source greenscreen image courtesy of Parasol Island GmbH