Video Color Morphology

Grows, shrinks and reshapes the bright and dark areas of the video by mathematical morphology, with a rectangle, an ellipse or a cross of adjustable size. Cleans masks (fills holes, removes specks), thickens or thins lines, extracts outlines and small details, and turns the lights of a night scene into blooms.

Example: the street at night with operation dilate, shape ellipse and radius 8; then the bridge with operation gradient and radius 2.

Dilate replaces each pixel by the maximum of the pixels the shape covers around it, erode by the minimum (past the border of the frame the edge pixels repeat); the other operations combine the two. The default settings change the picture only slightly: the bright areas grow by 2 pixels.

Settings

bypass

Bypasses the module processing when activated (ON).

  • OFF (0): Module processes normally
  • ON (1): Input passes directly to output without processing

video in

Video input flow(s).

video out

Video output flow(s).

process time

Total time used for the calculation of the module.

operation

Morphological operation (dilate by default).

  • dilate: the maximum over the shape: the bright areas grow and each light becomes a bloom of the shape.
  • erode: the minimum over the shape: the dark areas grow, small bright details and thin bright lines vanish.
  • open: erode then dilate: removes the bright details smaller than the shape and keeps the larger areas.
  • close: dilate then erode: fills the dark holes and gaps smaller than the shape.
  • gradient: dilate minus erode: the outlines of the shapes on black.
  • top hat: the image minus its opening: only the small bright details, on black.
  • black hat: the closing minus the image: only the small dark details, bright on black.

shape

Structuring element: the pixels taken around each pixel (ellipse by default). The rectangle and the cross cost the same at any radius; the ellipse takes one pass per row width, up to 8 passes from a radius of about 8. At 3840 x 2160 an ellipse of radius 8 then takes about 44 ms per frame in dilate and 72 ms in open, close, top hat and black hat, too slow for real time (a rectangle of radius 5 takes about 25 ms in open): prefer the rectangle there, or the luma or alpha channels.

  • rectangle: 2 x radius x + 1 by 2 x radius y + 1 pixels: square blooms.
  • ellipse: the ellipse inscribed in that rectangle: round blooms. It is exact for small radii (checked up to 8); larger ones get a stepped, rounded octagon inside the ellipse, its rows up to about 10 % shorter.
  • cross: the two axes of that rectangle, one pixel thick: plus-shaped blooms.

radius x

Horizontal radius of the shape, from 0 to 100 pixels (default 2): the shape is 2 x radius x + 1 pixels wide. With radius x and radius y at 0 the output is the input with dilate, erode, open and close, and black with gradient, top hat and black hat. radius x 20 with radius y 0 gives horizontal streaks.

radius y

Vertical radius of the shape, from 0 to 100 pixels (default 2): the shape is 2 x radius y + 1 pixels high.

channels

Channels processed (rgb by default). With the default settings a frame takes about 3.7 ms at 1920 x 1080 and 21 ms at 3840 x 2160 in rgb; luma and alpha take about half of that or less.

  • rgb: red, green and blue, each on its own; the alpha of the source is kept.
  • luma: the luma only: the output is grey, with the alpha of the source.
  • alpha: the alpha only, to grow or shrink a matte (for example the output of Video Stylize Canny with a transparent background); the colors are kept. With gradient, top hat and black hat the output is transparent where the alpha is flat.
  • rgba: the four channels.
Common Settings

info

show manual

Button. Opens the manual page of the selected object (or of its parent module for a control) in the web browser. If no page exists for this object, an error is traced in the trace panel.

For more details about information/help creation, see create-help-file.

description

Free multi-line text attached to the module, saved with the patch. When it is not empty, it is shown as the hint of the module (mouse over the module header in the patch) in place of the default module hint, even when the module hints are disabled.

ID's

visible only in god mode, see setup-panel-tab-expert.

unique ID

Read-only, not saved. Current private numeric ID of the object, used internally to identify it (for example as the target of a bind ID).

preset ID

Read-only, not saved. Private ID used to store and recall the values of this control in presets.

recreate ID

Button. Generates a new unique ID, original ID and preset ID for the object. Use it if you experience difficulties in Polyphonic mode or if two objects share the same ID. Preset values and binds referring to the old IDs are lost.

Object Remote Address

absolute

Read-only, not saved. Absolute address of the object in the Usine objects tree, built from the workspace root. This is the address to use to reach the object from scripts, the objects panel or remote messages. Only shown for objects that are registered in the objects list. See objects-address.

local

Read-only, not saved. Address of the object relative to the current patch, valid inside that patch only. See objects-address.

user addr

Free user-defined address for the object (empty by default). When set, the object is also registered in the objects tree under this name, so it can be reached independently of its position in the workspace (the value is also reported in the mouse-over and mouse-down chunks). Changing it rebuilds the objects list. Only available on objects that support a user address. See objects-address.

See also

version 7.0.250921

Edit All Pages