8.4.2.32. opticalflow
|
(packages/opencv/opticalflow.lsh) |
dummy function that adds OpenCV C header files in C file
8.4.2.32.0. (cvCalcOpticalFlowLK srca srcb winsize velx vely)
|
(packages/opencv/opticalflow.lsh) |
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvCalcOpticalFlowLK( Lucas & Kanade method )
// Purpose: calculate Optical flow for 2 images using Lucas & Kanade algorithm
// Context:
// Parameters:
// srcA, // first image
// srcB, // second image
// winSize, // size of the averaging window used for grouping
// velx, // horizontal
// vely // vertical components of optical flow
//
// Returns:
//
// Notes: 1.Optical flow to be computed for every pixel in ROI
// 2.For calculating spatial derivatives we use 3x3 Sobel operator.
// 3.We use the following border mode.
// The last row or column is replicated for the border
// ( IPL_BORDER_REPLICATE in IPL ).
//
//F*/
OPENCVAPI void cvCalcOpticalFlowLK( const CvArr* srcA, const CvArr* srcB,
CvSize winSize, CvArr* velx, CvArr* vely );
8.4.2.32.1. (cvCalcOpticalFlowBM srca srcb blocksize shiftsize maxrange useprevious velx vely)
|
(packages/opencv/opticalflow.lsh) |
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvCalcOpticalFlowBM
// Purpose: calculate Optical flow for 2 images using block matching algorithm
// Context:
// Parameters:
// srcA, // first image
// srcB, // second image
// blockSize, // size of basic blocks which are compared
// shiftSize, // coordinates increments.
// maxRange, // size of the scanned neighborhood.
// usePrevious, // use previous(input) velocity field.
// velx, // horizontal
// vely // vertical components of optical flow
//
// Returns:
// Notes:
//F*/
OPENCVAPI void cvCalcOpticalFlowBM( const CvArr* srcA, const CvArr* srcB,
CvSize blockSize, CvSize shiftSize,
CvSize maxRange, int usePrevious,
CvArr* velx, CvArr* vely );
8.4.2.32.2. (cvCalcOpticalFlowHS srca srcb useprevious velx vely lambda criteria)
|
(packages/opencv/opticalflow.lsh) |
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvCalcOpticalFlowHS(Horn & Schunck method )
// Purpose: calculate Optical flow for 2 images using Horn & Schunck algorithm
// Context:
// Parameters:
// srcA, // first image
// srcB, // second image
// int usePrevious, // use previous(input) velocity field.
// velx, // horizontal
// vely // vertical components of optical flow
// double lambda, // Lagrangian multiplier
// criteria // criteria of process termination
//
// Returns:
//
// Notes: 1.Optical flow to be computed for every pixel in ROI
// 2.For calculating spatial derivatives we use 3x3 Sobel operator.
// 3.We use the following border mode.
// The first and last rows and columns are replicated for the border
// ( IPL_BORDER_REPLICATE in IPL ).
//F*/
OPENCVAPI void cvCalcOpticalFlowHS( const CvArr* srcA, const CvArr* srcB,
int usePrevious, CvArr* velx, CvArr* vely,
double lambda, CvTermCriteria criteria );
8.4.2.32.3. (cvCalcOpticalFlowPyrLK imga imgb pyra pyrb featuresa featuresb count winsize level status error criteria flags)
|
(packages/opencv/opticalflow.lsh) |
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: cvCalcOpticalFlowPyrLK
// Purpose:
// It is Lucas & Kanade method, modified to use pyramids.
// Also it does several iterations to get optical flow for
// every point at every pyramid level.
// Calculates optical flow between two images for certain set of points.
// Context:
// Parameters:
// imgA - first frame(time t)
// imgB - second frame(time t+1)
// pyrA - buffer for pyramid for the first frame.
// if the pointer is not NULL, the buffer must have size enough to
// store pyramid(from level 1 to level #<level>(see below))
// (total size of(imgSize.width+8)*imgSize.height/3
// bytes will be enough)).
// pyrB - similar to pyrA, but for the second frame.
//
// for both parameters above the following rules work:
// If image pointer is 0, the function allocates the buffer
// internally, calculates pyramid and releases the buffer after
// processing.
// Else(image should be large enough then) the function calculates
// pyramid and stores it in the buffer unless the
// CV_LKFLOW_PYR_A[B]_READY flag is set. After function call
// both pyramids are calculated and ready-flag for corresponding
// image can be set.
//
// count - number of feature points
// winSize - size of search window on each pyramid level
// level - maximal pyramid level number
// (if 0, pyramids are not used(single level),
// if 1, two levels are used etc.)
//
// next parameters are arrays of <count> elements.
// ------------------------------------------------------
// featuresA - array of points, for which the flow needs to be found
// featuresB - array of 2D points, containing calculated
// new positions of input features(in the second image).
// status - array, every element of which will be set to 1 if the flow for the
// corresponding feature has been found, 0 else.
// error - array of double numbers, containing difference between
// patches around the original and moved points
// (it is optional parameter, can be NULL).
// ------------------------------------------------------
// criteria - specifies when to stop the iteration process of finding flow
// for each point on each pyramid level
//
// flags - miscellaneous flags:
// CV_LKFLOW_PYR_A_READY - pyramid for the first frame
// is precalculated before call
// CV_LKFLOW_PYR_B_READY - pyramid for the second frame
// is precalculated before call
// CV_LKFLOW_INITIAL_GUESSES - featuresB array holds initial
// guesses about new features'
// locations before function call.
// Returns:
// Notes: For calculating spatial derivatives 3x3 Sharr operator is used.
// The values of pixels beyond the image are determined using border
// replication.
//F*/
#define CV_LKFLOW_PYR_A_READY 1
#define CV_LKFLOW_PYR_B_READY 2
#define CV_LKFLOW_INITIAL_GUESSES 4
OPENCVAPI void cvCalcOpticalFlowPyrLK( const CvArr* imgA, const CvArr* imgB,
CvArr* pyrA, CvArr* pyrB,
CvPoint2D32f* featuresA,
CvPoint2D32f* featuresB,
int count,
CvSize winSize,
int level,
char* status,
float* error,
CvTermCriteria criteria,
int flags );