Move the sources to trunk
[opencv] / interfaces / matlab / toolbox / opencv / cvcalcopticalflowpyrlk.m
1 function varargout = cvcalcopticalflowpyrlk(varargin)\r
2 %CVCALCOPTICALFLOWPYRLK Calculate optical flow between two images for certain set of points.\r
3 %   [featuresB, error] = cvCalcOpticalFlowPyrLK(IMAGE imgA, IMAGE imgB,\r
4 %     featuresA, guessFeaturesB,\r
5 %     winSize, level, [maxIter epsilon]);\r
6 %\r
7 %   imgA              - first frame\r
8 %   imgB              - second frame\r
9 %   featuresA         - [n][2] array of feature points on the first frame\r
10 %   guessFeaturesB    - [n][2] initial guessess about newfeatures' locations.\r
11 %     May be empty.\r
12 %   winSize           - [width height] size of search window\r
13 %   level             - maximal pyramid level number\r
14 %   [maxIter epsilon] - specify when to stop search process.\r
15 %     One of them may be 0.\r
16 %\r
17 %   featuresB         - calculated feature points positions.\r
18 %     Coordinates of points for which flow was not found are [NaN NaN]\r
19 %   error             - array of differences between\r
20 %     patches around the original and moved points\r
21 \r
22 if nargin ~= 7\r
23     error 'Invalid number of parameters';\r
24     return;\r
25 end\r
26 \r
27 out = nargout;\r
28 if out < 1\r
29     out = 1;\r
30 end\r
31 \r
32 if out > 2\r
33     error 'Too many output parameters'\r
34     return;\r
35 end;\r
36 for idx = out+1:2\r
37     varargout{idx} = [];\r
38 end\r
39 \r
40 [varargout{1:2}] = feval('cvwrap', 'CalcOpticalFlowPyrLK', varargin{:});\r
41 \r
42 return;