Robust Local Optical Flow Libary Documentation  V 1.2
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
RLOFSample.m
1 % /******************************************************************************
2 % * COPYRIGHT: *
3 % * *
4 % * This file is the property of the author and Communication Systems Group, *
5 % * Technische Universität Berlin. All rights reserved. *
6 % * *
7 % * It may not be publicly disclosed, distributed, used, copied or modified *
8 % * without prior written authorization by a representative of *
9 % * Communication Systems Group, Technische Universität Berlin or the author. *
10 % * Any modified version of this document needs to contain this header. *
11 % ******************************************************************************/
12 %
13 % /******************************************************************************
14 % * THERMS IF USAGE: *
15 % * PERSONAL, NON-COMMERCIAL or ACADEMIC USAGE: *
16 % * You are free to use this software for whatever you like. If you use this *
17 % * algorithm for a scientific publication, please cite the one of the *
18 % * following paper: *
19 % * *
20 % * @INPROCEEDINGS{ICIPSenst2014, *
21 % * AUTHOR = {Tobias Senst and Thilo Borgmann and Ivo Keller and Thomas *
22 % * Sikora}, *
23 % * TITLE = {Cross based Robust Local Optical Flow}, *
24 % * BOOKTITLE = {21th IEEE International Conference on Image Processing}, *
25 % * YEAR = {2014}, *
26 % * MONTH = okt, *
27 % * PAGES = {1967--1971}, *
28 % * ADDRESS = {Paris, France}, *
29 % * } *
30 % * *
31 % * @INPROCEEDINGS{ICIPSenst2013, *
32 % * AUTHOR = {Tobias Senst and Jonas Geistert and Ivo Keller and Thomas *
33 % * Sikora}, *
34 % * TITLE = {Robust Local Optical Flow Estimation using Bilinear Equations for *
35 % * Sparse Motion Estimation}, *
36 % * BOOKTITLE = {20th IEEE International Conference on Image Processing}, *
37 % * YEAR = {2013}, *
38 % * MONTH = sep, *
39 % * PAGES = {2499--2503}, *
40 % * ADDRESS = {Melbourne, Australia}, *
41 % * DOI = {10.1109/ICIP.2013.6738515}, *
42 % * } *
43 % * *
44 % * @ARTICLE{TCSVTSenst2012, *
45 % * AUTHOR = {Tobias Senst and Volker Eiselein and Thomas Sikora}, *
46 % * TITLE = {Robust Local Optical Flow for Feature Tracking}, *
47 % * JOURNAL = {IEEE Transactions on Circuits and Systems for Video Technology},*
48 % * YEAR = {2012}, *
49 % * MONTH = sep, *
50 % * PAGES = {1377--1387}, *
51 % * VOLUME = {22}, *
52 % * NUMBER = {9}, *
53 % * DOI = {10.1109/TCSVT.2012.2202070} *
54 % * } *
55 % * *
56 % * @INPROCEEDINGS{WACVSenst2011, *
57 % * AUTHOR = {Tobias Senst and Volker Eiselein and Rubén Heras Evangelio and *
58 % * Thomas Sikora}, *
59 % * TITLE = {Robust Modified L2 Local Optical Flow Estimation and Feature *
60 % * Tracking}, *
61 % * BOOKTITLE = {IEEE Workshop on Motion and Video Computing}, *
62 % * YEAR = {2011}, *
63 % * MONTH = jan, *
64 % * EDITOR = {Eric Mortensen}, *
65 % * PAGES = {685--690}, *
66 % * ADDRESS = {Kona, USA}, *
67 % * DOI = {10.1109/WACV.2011.5711571}, *
68 % * } *
69 % * *
70 % * COMMERCIAL USAGE: *
71 % * It is not allowed to use any content of this package for any commercial *
72 % * use or any advertisement for upcoming commercial products. If you want to*
73 % * use any content for such a purpose please contact: *
74 % * Prof. Dr.-Ing. Thomas Sikora <sikora@nue.tu-berlin.de>. *
75 % ******************************************************************************/
76 %
77 % /******************************************************************************
78 % * WARRANTIES: *
79 % * *
80 % * Software provided by Technische Universität Berlin with this document is *
81 % * provided "AS IS" and any express of implied warranties including, but *
82 % * not limited to, the implied warranties of merchantability and fitness *
83 % * for a particular purpose are disclaimed. *
84 % * In no event shall the author or contributors be liable for any direct, *
85 % * indirect, incidental, special, exemplary, or consequential damages *
86 % * (including, but not limited to, procurement of substitute goods or *
87 % * services, loss of use, data, or profits or business interruption) caused in*
88 % * any way out of the use of this software, even if advised of the possibility*
89 % * of such damage. *
90 % ******************************************************************************/
91 
92 image1 = imread('../Doc/ErnstReuter1.png');
93 image2 = imread('../Doc/ErnstReuter2.png');
94 
95 pointlist1 = [];
96 
97 % perform an accuracy test of each PLK/RLOF implementation
98 % define parameter
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')...
105  ];
106 
107 % demo estimates and validates the motion vector for each PLK/RLOF derivate
108 idx = 1;
109 for n = 1 : length(parameter)
110  pointlist2 = mex_RLOF(image1, image2, pointlist1, parameter(n));
111 end
112 
113 % demo estimates and displays motion vectors for a given grid of samples
114 gridSize = 10;
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)' ];
120 %track features
121 parameter = struct('method', 'PLK', 'options', 'PrintParameter');
122 pointlist2 = mex_RLOF(image1, image2, pointlist1, parameter);
123 % draw result
124 imagesc(image1);
125 for i = 1:size(pointlist2,2)
126  line([pointlist1(1,i) pointlist2(1,i)], [pointlist1(2,i) pointlist2(2,i)]);
127 end
void demo()
Demo programm.
Definition: RLOFSample.cpp:117