* Fixed display of struct and class definitions (except classes with base class specified).
* Fixed formatting and referencing errors in several documentation files.
:param func:The comparison function that returns a negative, zero, or positive value depending on the relationships among the elements (see the above declaration and the example below) - a similar function is used by ``qsort`` from C runline except that in the latter, ``userdata`` is not used
:param userdata:The user parameter passed to the compasion function; helps to avoid global variables in some cases
::
/* a < b ? -1 : a > b ? 1 : 0 */
@ -1263,12 +1270,6 @@ Sorts sequence element using the specified comparison function.
..
:param seq:The sequence to sort
:param func:The comparison function that returns a negative, zero, or positive value depending on the relationships among the elements (see the above declaration and the example below) - a similar function is used by ``qsort`` from C runline except that in the latter, ``userdata`` is not used
:param userdata:The user parameter passed to the compasion function; helps to avoid global variables in some cases
The function sorts the sequence in-place using the specified criteria. Below is an example of using this function:
@ -51,13 +51,13 @@ The class ``BaseColumnFilter`` is a base class for filtering data using single-c
where
:math:`F` is a filtering function but, as it is represented as a class, it can produce any side effects, memorize previously processed data, and so on. The class only defines an interface and is not used directly. Instead, there are several functions in OpenCV (and you can add more) that return pointers to the derived classes that implement specific filtering operations. Those pointers are then passed to the
:ocv:func:`FilterEngine` constructor. While the filtering operation interface uses the ``uchar`` type, a particular implementation is not limited to 8-bit data.
:ocv:class:`FilterEngine` constructor. While the filtering operation interface uses the ``uchar`` type, a particular implementation is not limited to 8-bit data.
..seealso::
:ocv:func:`BaseRowFilter`,
:ocv:func:`BaseFilter`,
:ocv:func:`FilterEngine`,
:ocv:class:`BaseRowFilter`,
:ocv:class:`BaseFilter`,
:ocv:class:`FilterEngine`,
:ocv:func:`getColumnSumFilter`,
:ocv:func:`getLinearColumnFilter`,
:ocv:func:`getMorphologyColumnFilter`
@ -101,13 +101,13 @@ The class ``BaseFilter`` is a base class for filtering data using 2D kernels. Fi
where
:math:`F` is a filtering function. The class only defines an interface and is not used directly. Instead, there are several functions in OpenCV (and you can add more) that return pointers to the derived classes that implement specific filtering operations. Those pointers are then passed to the
:ocv:func:`FilterEngine` constructor. While the filtering operation interface uses the ``uchar`` type, a particular implementation is not limited to 8-bit data.
:ocv:class:`FilterEngine` constructor. While the filtering operation interface uses the ``uchar`` type, a particular implementation is not limited to 8-bit data.
..seealso::
:ocv:func:`BaseColumnFilter`,
:ocv:func:`BaseRowFilter`,
:ocv:func:`FilterEngine`,
:ocv:class:`BaseColumnFilter`,
:ocv:class:`BaseRowFilter`,
:ocv:class:`FilterEngine`,
:ocv:func:`getLinearFilter`,
:ocv:func:`getMorphologyFilter`
@ -143,13 +143,13 @@ The class ``BaseRowFilter`` is a base class for filtering data using single-row
where
:math:`F` is a filtering function. The class only defines an interface and is not used directly. Instead, there are several functions in OpenCV (and you can add more) that return pointers to the derived classes that implement specific filtering operations. Those pointers are then passed to the
:ocv:func:`FilterEngine` constructor. While the filtering operation interface uses the ``uchar`` type, a particular implementation is not limited to 8-bit data.
:ocv:class:`FilterEngine` constructor. While the filtering operation interface uses the ``uchar`` type, a particular implementation is not limited to 8-bit data.
..seealso::
:ocv:func:`BaseColumnFilter`,
:ocv:class:`BaseColumnFilter`,
:ocv:func:`Filter`,
:ocv:func:`FilterEngine`,
:ocv:class:`FilterEngine`,
:ocv:func:`getLinearRowFilter`,
:ocv:func:`getMorphologyRowFilter`,
:ocv:func:`getRowSumFilter`
@ -347,7 +347,7 @@ Unlike the earlier versions of OpenCV, now the filtering operations fully suppor
Explore the data types. As it was mentioned in the
:ocv:func:`BaseFilter` description, the specific filters can process data of any type, despite that ``Base*Filter::operator()`` only takes ``uchar`` pointers and no information about the actual types. To make it all work, the following rules are used:
:ocv:class:`BaseFilter` description, the specific filters can process data of any type, despite that ``Base*Filter::operator()`` only takes ``uchar`` pointers and no information about the actual types. To make it all work, the following rules are used:
*
In case of separable filtering, ``FilterEngine::rowFilter`` is applied first. It transforms the input image data (of type ``srcType`` ) to the intermediate results stored in the internal buffers (of type ``bufType`` ). Then, these intermediate results are processed as
@ -359,9 +359,9 @@ Explore the data types. As it was mentioned in the
..seealso::
:ocv:func:`BaseColumnFilter`,
:ocv:func:`BaseFilter`,
:ocv:func:`BaseRowFilter`,
:ocv:class:`BaseColumnFilter`,
:ocv:class:`BaseFilter`,
:ocv:class:`BaseRowFilter`,
:ocv:func:`createBoxFilter`,
:ocv:func:`createDerivFilter`,
:ocv:func:`createGaussianFilter`,
@ -457,12 +457,12 @@ The function computes and returns the coordinate of a donor pixel corresponding
Normally, the function is not called directly. It is used inside
:ocv:func:`FilterEngine` and
:ocv:class:`FilterEngine` and
:ocv:func:`copyMakeBorder` to compute tables for quick extrapolation.
..seealso::
:ocv:func:`FilterEngine`,
:ocv:class:`FilterEngine`,
:ocv:func:`copyMakeBorder`
@ -558,7 +558,7 @@ Forms a border around an image.
:param value:Border value if ``borderType==BORDER_CONSTANT`` .
The function copies the source image into the middle of the destination image. The areas to the left, to the right, above and below the copied source image will be filled with extrapolated pixels. This is not what
:ocv:func:`FilterEngine` or filtering functions based on it do (they extrapolate pixels on-fly), but what other more complex functions, including your own, may do to simplify image boundary handling.
:ocv:class:`FilterEngine` or filtering functions based on it do (they extrapolate pixels on-fly), but what other more complex functions, including your own, may do to simplify image boundary handling.
The function supports the mode when ``src`` is already in the middle of ``dst`` . In this case, the function does not copy ``src`` itself but simply constructs the border, for example: ::
@ -611,7 +611,7 @@ Returns a box filter engine.
The function is a convenience function that retrieves the horizontal sum primitive filter with
:ocv:func:`getRowSumFilter` , vertical sum filter with
:ocv:func:`getColumnSumFilter` , constructs new
:ocv:func:`FilterEngine` , and passes both of the primitive filters there. The constructed filter engine can be used for image filtering with normalized or unnormalized box filter.
:ocv:class:`FilterEngine` , and passes both of the primitive filters there. The constructed filter engine can be used for image filtering with normalized or unnormalized box filter.
The function itself is used by
:ocv:func:`blur` and
@ -619,7 +619,7 @@ The function itself is used by
..seealso::
:ocv:func:`FilterEngine`,
:ocv:class:`FilterEngine`,
:ocv:func:`blur`,
:ocv:func:`boxFilter`
@ -714,12 +714,12 @@ Creates a non-separable linear filter engine.
:param borderValue:Border vaule used in case of a constant border.
The function returns a pointer to a 2D linear filter for the specified kernel, the source array type, and the destination array type. The function is a higher-level function that calls ``getLinearFilter`` and passes the retrieved 2D filter to the
:ocv:func:`FilterEngine` constructor.
:ocv:class:`FilterEngine` constructor.
..seealso::
:ocv:func:`createSeparableLinearFilter`,
:ocv:func:`FilterEngine`,
:ocv:class:`FilterEngine`,
:ocv:func:`filter2D`
@ -766,7 +766,7 @@ Note that
:ocv:func:`erode`,
:ocv:func:`dilate`,
:ocv:func:`morphologyEx`,
:ocv:func:`FilterEngine`
:ocv:class:`FilterEngine`
createSeparableLinearFilter
@ -807,13 +807,13 @@ The functions construct primitive separable linear filtering operations or a fil
:ocv:func:`createSeparableLinearFilter` or even higher-level
:ocv:func:`sepFilter2D` . The function
:ocv:func:`createMorphologyFilter` is smart enough to figure out the ``symmetryType`` for each of the two kernels, the intermediate ``bufType`` and, if filtering can be done in integer arithmetics, the number of ``bits`` to encode the filter coefficients. If it does not work for you, it is possible to call ``getLinearColumnFilter``,``getLinearRowFilter`` directly and then pass them to the
Here are important members of the class that control the algorithm, which you can set after constructing the class instance:
:ocv:member::nmixtures
..ocv:member:: int nmixtures
Maximum allowed number of mixture comonents. Actual number is determined dynamically per pixel.
:ocv:member::backgroundRatio
..ocv:member:: float backgroundRatio
Threshold defining whether the component is significant enough to be included into the background model ( corresponds to ``TB=1-cf`` from the paper??which paper??). ``cf=0.1 => TB=0.9`` is default. For ``alpha=0.001``, it means that the mode should exist for approximately 105 frames before it is considered foreground.
:ocv:member::varThresholdGen
..ocv:member:: float varThresholdGen
Threshold for the squared Mahalanobis distance that helps decide when a sample is close to the existing components (corresponds to ``Tg``). If it is not close to any component, a new component is generated. ``3 sigma => Tg=3*3=9`` is default. A smaller ``Tg`` value generates more components. A higher ``Tg`` value may result in a small number of components but they can grow too large.
:ocv:member::fVarInit
..ocv:member:: float fVarInit
Initial variance for the newly generated components. It affects the speed of adaptation. The parameter value is based on your estimate of the typical standard deviation from the images. OpenCV uses 15 as a reasonable value.
:ocv:member::
..ocv:member:: float fVarMin
fVarMin Parameter used to further control the variance.
Parameter used to further control the variance.
:ocv:member::
..ocv:member:: float fVarMax
fVarMax Parameter used to further control the variance.
Parameter used to further control the variance.
:ocv:member::fCT
..ocv:member:: float fCT
Complexity reduction parameter. This parameter defines the number of samples needed to accept to prove the component exists. ``CT=0.05`` is a default value for all the samples. By setting ``CT=0`` you get an algorithm very similar to the standard Stauffer&Grimson algorithm.
:param nShadowDetection
..ocv:member:: uchar nShadowDetection
The value for marking shadow pixels in the output foreground mask. Default value is 127.
:param fTau
..ocv:member:: float fTau
Shadow threshold. The shadow is detected if the pixel is a darker version of the background. ``Tau`` is a threshold defining how much darker the shadow can be. ``Tau= 0.5`` means that if a pixel is more than twice darker then it is not shadow. See Prati,Mikic,Trivedi,Cucchiarra, *Detecting Moving Shadows...*, IEEE PAMI,2003.