CvInvokeCalcOpticalFlowPyrLK Method (IInputArray, IInputArray, PointF, Size, Int32, MCvTermCriteria, PointF, Byte, Single, LKFlowFlag, Double) |
http://www.emgu.com
Calculates optical flow for a sparse feature set using iterative Lucas-Kanade method in pyramids
Namespace:
Emgu.CV
Assembly:
Emgu.CV.World (in Emgu.CV.World.dll) Version: 4.1.1.3497 (4.1.1.3497)
Syntaxpublic static void CalcOpticalFlowPyrLK(
IInputArray prev,
IInputArray curr,
PointF[] prevFeatures,
Size winSize,
int level,
MCvTermCriteria criteria,
out PointF[] currFeatures,
out byte[] status,
out float[] trackError,
LKFlowFlag flags = LKFlowFlag.Default,
double minEigThreshold = 0.0001
)
Public Shared Sub CalcOpticalFlowPyrLK (
prev As IInputArray,
curr As IInputArray,
prevFeatures As PointF(),
winSize As Size,
level As Integer,
criteria As MCvTermCriteria,
<OutAttribute> ByRef currFeatures As PointF(),
<OutAttribute> ByRef status As Byte(),
<OutAttribute> ByRef trackError As Single(),
Optional flags As LKFlowFlag = LKFlowFlag.Default,
Optional minEigThreshold As Double = 0.0001
)
public:
static void CalcOpticalFlowPyrLK(
IInputArray^ prev,
IInputArray^ curr,
array<PointF>^ prevFeatures,
Size winSize,
int level,
MCvTermCriteria criteria,
[OutAttribute] array<PointF>^% currFeatures,
[OutAttribute] array<unsigned char>^% status,
[OutAttribute] array<float>^% trackError,
LKFlowFlag flags = LKFlowFlag::Default,
double minEigThreshold = 0.0001
)
static member CalcOpticalFlowPyrLK :
prev : IInputArray *
curr : IInputArray *
prevFeatures : PointF[] *
winSize : Size *
level : int *
criteria : MCvTermCriteria *
currFeatures : PointF[] byref *
status : byte[] byref *
trackError : float32[] byref *
?flags : LKFlowFlag *
?minEigThreshold : float
(* Defaults:
let _flags = defaultArg flags LKFlowFlag.Default
let _minEigThreshold = defaultArg minEigThreshold 0.0001
*)
-> unit
Parameters
- prev
- Type: Emgu.CVIInputArray
First frame, at time t - curr
- Type: Emgu.CVIInputArray
Second frame, at time t + dt - prevFeatures
- Type: System.DrawingPointF
Array of points for which the flow needs to be found - winSize
- Type: System.DrawingSize
Size of the search window of each pyramid level - level
- Type: SystemInt32
Maximal pyramid level number. If 0 , pyramids are not used (single level), if 1 , two levels are used, etc - criteria
- Type: Emgu.CV.StructureMCvTermCriteria
Specifies when the iteration process of finding the flow for each point on each pyramid level should be stopped - currFeatures
- Type: System.DrawingPointF
Array of 2D points containing calculated new positions of input features in the second image - status
- Type: SystemByte
Array. Every element of the array is set to 1 if the flow for the corresponding feature has been found, 0 otherwise - trackError
- Type: SystemSingle
Array of double numbers containing difference between patches around the original and moved points - flags (Optional)
- Type: Emgu.CV.CvEnumLKFlowFlag
Flags - minEigThreshold (Optional)
- Type: SystemDouble
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.
See Also