92 image1 = imread(
'../Doc/ErnstReuter1.png');
93 image2 = imread(
'../Doc/ErnstReuter2.png');
97 % perform an accuracy test of each PLK/RLOF implementation
99 parameter = [ struct('method', 'PLK', 'options', 'PerformTest')...
100 struct('method', 'RLOF', 'options', 'PerformTest')...
101 struct('method', 'BEPLK', 'options', 'PerformTest')...
102 struct('method', 'BERLOF', 'options', 'PerformTest')...
103 struct('method', 'CB_BEPLK', 'options', 'PerformTest')...
104 struct('method', 'CB_BERLOF', 'options', 'PerformTest')...
107 %
demo estimates and validates the motion vector
for each PLK/RLOF derivate
109 for n = 1 : length(parameter)
110 pointlist2 = mex_RLOF(image1, image2, pointlist1, parameter(n));
113 %
demo estimates and displays motion vectors for a given grid of samples
115 noRows = size(image1,1);
116 noCols = size(image1,2);
117 % initialize pointlist with features to track
118 [Y,X] = meshgrid(0:gridSize:noRows-1, 0:gridSize:noCols-1);
119 pointlist1 = [reshape(X, size(X,1) * size(X,2), 1)'; reshape(Y, size(Y,1) * size(Y,2), 1)' ];
121 parameter = struct('method', 'PLK', 'options', 'PrintParameter');
122 pointlist2 = mex_RLOF(image1, image2, pointlist1, parameter);
125 for i = 1:size(pointlist2,2)
126 line([pointlist1(1,i) pointlist2(1,i)], [pointlist1(2,i) pointlist2(2,i)]);
void demo()
Demo programm.