FFmpeg 1.2.12
Since* 0.7
#

Apply video transform using libopencv.

To enable this filter install libopencv library and headers and configure FFmpeg with --enable-libopencv.

The filter takes the parameters: filter_name{:=}filter_params.

filter_name is the name of the libopencv filter to apply.

filter_params specifies the parameters to pass to the libopencv filter. If not specified the default values are assumed.

Refer to the official libopencv documentation for more precise information: http://opencv.willowgarage.com/documentation/c/image_filtering.html

Follows the list of supported libopencv filters.

#

dilate

Dilate an image by using a specific structuring element. This filter corresponds to the libopencv function cvDilate.

It accepts the parameters: struct_el:nb_iterations.

struct_el represents a structuring element, and has the syntax: colsxrows+anchor_xxanchor_y/shape

cols and rows represent the number of columns and rows of the structuring element, anchor_x and anchor_y the anchor point, and shape the shape for the structuring element, and can be one of the values "rect", "cross", "ellipse", "custom".

If the value for shape is "custom", it must be followed by a string of the form "=filename". The file with name filename is assumed to represent a binary image, with each printable character corresponding to a bright pixel. When a custom shape is used, cols and rows are ignored, the number or columns and rows of the read file are assumed instead.

The default value for struct_el is "3x3+0x0/rect".

nb_iterations specifies the number of times the transform is applied to the image, and defaults to 1.

Follow some example:

# use the default values
ocv=dilate

# dilate using a structuring element with a 5x5 cross, iterate two times
ocv=dilate=5x5+2x2/cross:2

# read the shape from the file diamond.shape, iterate two times
# the file diamond.shape may contain a pattern of characters like this:
#   *
#  ***
# *****
#  ***
#   *
# the specified cols and rows are ignored (but not the anchor point coordinates)
ocv=0x0+2x2/custom=diamond.shape:2
#

erode

Erode an image by using a specific structuring element. This filter corresponds to the libopencv function cvErode.

The filter accepts the parameters: struct_el:nb_iterations, with the same syntax and semantics as the dilate filter.

#

smooth

Smooth the input video.

The filter takes the following parameters: type:param1:param2:param3:param4.

type is the type of smooth filter to apply, and can be one of the following values: "blur", "blur_no_scale", "median", "gaussian", "bilateral". The default value is "gaussian".

param1, param2, param3, and param4 are parameters whose meanings depend on smooth type. param1 and param2 accept integer positive values or 0, param3 and param4 accept float values.

The default value for param1 is 3, the default value for the other parameters is 0.

These parameters correspond to the parameters assigned to the libopencv function cvSmooth.