Plugin lcvvideo

This module contains elements for motion analysis and object tracking. It resembles open cv's video module.

import lcvvideo 1.0

Summary

TypeCalcOpticalFlowPyrLKReturns the total number of points that are currently tracked.
TypeBackgroundSubtractorBackground subtractor base type.
TypeBackgroundSubtractorMog2Gaussian mixture based background/foreground segmentation algorithm.This is a static item.
TypeBackgroundSubtractorKnnK-nearest neigbours based background/foreground segmentation algorithm. This is a static item.

CalcOpticalFlowPyrLK type

InheritsMatFilter
PropertySize CalcOpticalFlowPyrLK winSize
Propertyint maxLevel
Propertyreal minEigThreshold
MethodCalcOpticalFlowPyrLK addPoint(Point p)
Methodlist CalcOpticalFlowPyrLK points()
Methodint CalcOpticalFlowPyrLK totalPoints()
MethodCalcOpticalFlowPyrLK staticLoad(string key)

Sparse optical flow filter.

CalcOpticalFlowPyrLK addPoint(Point p) method

Add a point to track.

Calculate an optical flow for a sparse feature set using the iterative Lucas-Kanade method with pyramids. The function implements a sparse iterative version of the Lucas-Kanade optical flow in pyramids.

See [motion analysis and object tracking](http://docs.opencv.org/modules/video/doc/motion_analysis_and_object_tracking.html for details. ) Note that this element manages it's points automatically. You can add a point by using the addPoint() function, or you can get a list of all the points by using the points() getter.

  var points = lkflow.points()

A sample is available in samples/video/lktracking.qml :

video/lktracking.qml

{qmlBrief:Adds a point to the vector of points that are currently tracked.} See also CalcOpticalFlowPyrLK::addPoint.

list CalcOpticalFlowPyrLK points() method

This method retrieves a copy of the list of points that are currently traked.

{qmlBrief:Returns the total number of points that are currently tracked as a list of points.} See also CalcOpticalFlowPyrLK::points().

int CalcOpticalFlowPyrLK totalPoints() method

Returns the total number of points that are currently tracked.

Returns the total number of points that are currently tracked.

CalcOpticalFlowPyrLK staticLoad(string key) method

Loads the CalcOpticalFlowPyrLK state from the given \a key.

Size CalcOpticalFlowPyrLK winSize property

Size of the search window at each pyramid level.

int maxLevel property

0-based maximal pyramid level number; if set to 0, pyramids are not used (single level), if set to 1, two levels are used, and so on; if pyramids are passed to input then algorithm will use as many levels as pyramids have but no more than 'maxLevel'.

real minEigThreshold property

The algorithm calculates the minimum eigen value of a 2x2 normal matrix of optical flow equations (this matrix is called a spatial gradient matrix in [Bouguet00]_), divided by number of pixels in a window; if this value is less than 'minEigThreshold', then a corresponding feature is filtered out and its flow is not processed, so it allows to remove bad points and get a performance boost.

BackgroundSubtractor type

InheritsMatFilter
Propertystring learningRate

Background subtractor base type.

string learningRate property

Learning rate for updating the background model (0 to 1, default is 0).

BackgroundSubtractorMog2 type

Gaussian mixture based background/foreground segmentation algorithm.This is a static item.

video/backgroundsubtractormog2.qml

Mat backgroundModel property

Snapshot of the background model computed by the MOG2 algorithm.

int history property

Length of the history. Defaults to 500.

int nmixtures property

Maximum allowed number of mixture components. Defaults to 5.

int nShadowDetection property

The value for marking shadow pixels in the output foreground mask. Must be in the range 0-255. Defaults to 127.

bool detectShadows property

Whether shadow detection should be enabled. Defaults to false.

double backgroundRatio property

Threshold defining whether the component is significant enough to be included into the background model. Defaults to 0.9.

double ct property

Complexity reduction parameter. Defaults to 0.05.

double tau property

Shadow threshold. Defaults to 0.5.

double varInit property

Initial variance for the newly generated components. Defaults to 15.

double varMin property

Parameter used to further control the variance. Defaults to 4.

double varMax property

Parameter used to further control the variance. Defaults to 75.

double varThreshold property

Threshold on the squared Mahalanobis distance to decide whether it is well described by the background model. Defaults to 16.

double varThresholdGen property

Threshold for the squared Mahalanobis distance that helps decide when a sample is close to the existing components. Defaults to 9.

BackgroundSubtractorMog2 staticLoad(string key) method

Loads the BackgroundSubtractorMog2 state from the given key.

BackgroundSubtractorKnn type

InheritsBackgroundSubtractor
Propertybool detectShadows
Propertydouble dist2Threshold
Propertyint history
Propertyint knnSamples
Propertyint nSamples
Propertydouble shadowThreshold
Propertyint shadowValue
MethodBackgroundSubtractorKnn staticLoad(string key)

K-nearest neigbours based background/foreground segmentation algorithm. This is a static item.

bool detectShadows property

Enables or disables shadow detection.

double dist2Threshold property

Threshold on the squared distance.

int history property

Number of last frames that affect the background model.

int knnSamples property

How many nearest neigbours need to match.

int nSamples property

Number of data samples in the background model.

double shadowThreshold property

Shadow threshold.

int shadowValue property

Pixel value for pixels detected as shadow.

BackgroundSubtractorKnn staticLoad(string key) method

Loads the BackgroundSubtractorKnn state from the given key.