Motion Analysis
CalcOpticalFlowBM
Calculates the optical flow for two images by using the block matching method.
-
C: void cvCalcOpticalFlowBM(const CvArr* prev, const CvArr* curr, CvSize block_size, CvSize shift_size, CvSize max_range, int use_previous, CvArr* velx, CvArr* vely)
-
Python: cv.CalcOpticalFlowBM(prev, curr, blockSize, shiftSize, max_range, usePrevious, velx, vely) → None
Parameters: |
- prev – First image, 8-bit, single-channel
- curr – Second image, 8-bit, single-channel
- block_size – Size of basic blocks that are compared
- shift_size – Block coordinate increments
- max_range – Size of the scanned neighborhood in pixels around the block
- use_previous – Flag that specifies whether to use the input velocity as initial approximations or not.
- velx –
Horizontal component of the optical flow of
System Message: WARNING/2 (\left \lfloor \frac{\texttt{prev->width} - \texttt{block\_size.width}}{\texttt{shift\_size.width}} \right \rfloor \times \left \lfloor \frac{\texttt{prev->height} - \texttt{block\_size.height}}{\texttt{shift\_size.height}} \right \rfloor)
latex exited with error
[stdout]
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014-OpenBSD_Ports) (preloaded format=latex)
restricted \write18 enabled.
entering extended mode
(./math.tex
LaTeX2e <2014/05/01>
Babel <3.9k> and hyphenation patterns for 78 languages loaded.
(/usr/local/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/share/texmf-dist/tex/latex/base/size12.clo))
(/usr/local/share/texmf-dist/tex/latex/base/inputenc.sty
! LaTeX Error: File `utf8x.def’ not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: def)
Enter file name:
! Emergency stop.
<read *>
l.165 \endinput
^^M
No pages of output.
Transcript written on math.log.
size, 32-bit floating-point, single-channel
- vely – Vertical component of the optical flow of the same size velx , 32-bit floating-point, single-channel
|
The function calculates the optical flow for overlapped blocks block_size.width x block_size.height pixels each, thus the velocity fields are smaller than the original images. For every block in prev
the functions tries to find a similar block in curr in some neighborhood of the original block or shifted by (velx(x0,y0), vely(x0,y0)) block as has been calculated by previous function call (if use_previous=1)
CalcOpticalFlowHS
Calculates the optical flow for two images using Horn-Schunck algorithm.
-
C: void cvCalcOpticalFlowHS(const CvArr* prev, const CvArr* curr, int use_previous, CvArr* velx, CvArr* vely, double lambda, CvTermCriteria criteria)
-
Python: cv.CalcOpticalFlowHS(prev, curr, usePrevious, velx, vely, lambda, criteria) → None
Parameters: |
- prev – First image, 8-bit, single-channel
- curr – Second image, 8-bit, single-channel
- use_previous – Flag that specifies whether to use the input velocity as initial approximations or not.
- velx – Horizontal component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
- vely – Vertical component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
- lambda – Smoothness weight. The larger it is, the smoother optical flow map you get.
- criteria – Criteria of termination of velocity computing
|
The function computes the flow for every pixel of the first input image using the Horn and Schunck algorithm [Horn81]. The function is obsolete. To track sparse features, use calcOpticalFlowPyrLK(). To track all the pixels, use calcOpticalFlowFarneback().
CalcOpticalFlowLK
Calculates the optical flow for two images using Lucas-Kanade algorithm.
-
C: void cvCalcOpticalFlowLK(const CvArr* prev, const CvArr* curr, CvSize win_size, CvArr* velx, CvArr* vely)
-
Python: cv.CalcOpticalFlowLK(prev, curr, winSize, velx, vely) → None
Parameters: |
- prev – First image, 8-bit, single-channel
- curr – Second image, 8-bit, single-channel
- win_size – Size of the averaging window used for grouping pixels
- velx – Horizontal component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
- vely – Vertical component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
|
The function computes the flow for every pixel of the first input image using the Lucas and Kanade algorithm [Lucas81]. The function is obsolete. To track sparse features, use calcOpticalFlowPyrLK(). To track all the pixels, use calcOpticalFlowFarneback().
Help and Feedback
You did not find what you were looking for?
- Ask a question on the Q&A forum.
- If you think something is missing or wrong in the documentation,
please file a bug report.