Update the changelog
[opencv] / docs / appPage / 3dTracker / 3dTrackerFilter.htm
1 <HTML>\r
2 <HEAD>\r
3 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">\r
4 <TITLE>3D Tracker Filter</TITLE>\r
5 </HEAD>\r
6 <BODY>\r
7 <CENTER><TABLE CELLSPACING=0 CELLPADDING=5 WIDTH="90%" BGCOLOR="#6A9BED" NOSAVE >\r
8 <TR NOSAVE>\r
9 <TD NOSAVE>\r
10 <CENTER><I><FONT COLOR="#000000"><FONT SIZE=+4>\r
11 3D Tracker Filter\r
12 </FONT></FONT></I></CENTER>\r
13 </TD>\r
14 </TR>\r
15 </TABLE></CENTER>\r
16 \r
17 \r
18 <H2>Description </H2>\r
19 \r
20 <p>\r
21 The 3D tracker uses the 2D positions of objects as viewed by multiple\r
22 cameras to determine the 3D position of the objects.\r
23 The 3D Tracker filter is a DirectShow filter that runs under\r
24 Microsoft Windows.\r
25 The filter receives input from two or more cameras, passes it to \r
26 2D trackers to process the video frames, then calls the OpenCV 3D\r
27 tracker to combine the 2D results to compute a 3D position.\r
28 </p>\r
29 <p>\r
30 The 2D trackers are COM objects that\r
31 implement an interface called <code>ITracker</code>.\r
32 The available trackers are listed in registry in the\r
33 <b>Video Trackers</b> category.\r
34 Before using the 3D Tracker filter, you must register the tracker(s) you\r
35 want to use with <code>regsvr32.exe</code>.\r
36 There is an example COM object tracker that uses the CamShift tracker\r
37 already in OpenCV. There is also an example tracker called\r
38 BlobTracker.\r
39 </p>\r
40 <p>\r
41 You can run the 3D Tracker filter using the DirectShow filter graph editor,\r
42 <code>graphedt.exe</code>;\r
43 using the sample application provided, <code>Tracker3dDemo.exe</code>;\r
44 or by writing your own application.\r
45 (You can use <code>Tracker3dDemo.exe</code> as a starting point.)\r
46 To use <code>Tracker3dDemo.exe</code>, you must first use <code>graphedt.exe</code> to create a filter graph \r
47 for the sample app to load.\r
48 </p>\r
49 \r
50 <h2>Setup</h2>\r
51 <p>\r
52 Before using the 3D Tracker filter, run the Calib filter\r
53 with each of your cameras to determine the camera intrinsics.\r
54 This needs to be done only once for each camera.\r
55 Even if the cameras are moved, the intrinsics don't change.\r
56 Save the intrinsics for each camera in a separate file.\r
57 The 3D Tracker filter will ask for these filenames when you begin\r
58 camera calibration in the 3D Tracker.\r
59 </p>\r
60 \r
61 <p>\r
62 When you first insert the 3D Tracker filter into a graph, it will have no pins.\r
63 Use the property page to set the number of cameras, as described below,\r
64 and then in GraphEdit choose <b>Refresh</b>\r
65 on the <b>View</b> menu to cause GraphEdit to redisplay the filter\r
66 with the selected number of input and output pins.\r
67 Before you connect the inputs\r
68 and outputs, set the tracker type and input frame size also.\r
69 If you save the graph, the number of cameras, the tracker type,\r
70 and the input size are saved with the graph.\r
71 </p>\r
72 \r
73 <p>\r
74 After you have set up the filter and connected it up,\r
75 the graph will look something like this.\r
76 You may have additional decompression or color conversion filters,\r
77 depending on your cameras and your computer's display.\r
78 </p>\r
79 \r
80 <CENTER><IMG SRC="3dTrackerFilterGraph.png"></CENTER>\r
81 \r
82 <h2>Controls</h2>\r
83 <p>\r
84 Right click on the 3D Tracker and choose <b>Filter Properties...</b> to bring\r
85 up the filter's property page. A tab for the trackers' property page\r
86 will be displayed as well if a tracker has been selected.\r
87 </p>\r
88 \r
89 <CENTER><IMG SRC="3dTrackerPropertyPage.png"></CENTER>\r
90     \r
91 <p>\r
92 The controls in the box can be changed only when none of the pins of\r
93 the filter are connected.\r
94 You must click <b>Apply</b> after changing any of the controls in the box\r
95 for them to take effect.\r
96 </p>\r
97 <DL>\r
98 <DT>Number of cameras\r
99 <DD>\r
100 Sets the number of input and output pins on the filter, and the number\r
101 of trackers it will use. After changing this value and clicking <b>Apply</b>,\r
102 you must choose <b>Refresh</b> on the <b>View</b>\r
103 menu in GraphEdit to cause it to redisplay the filter with the\r
104 selected number of input and output pins.\r
105 </DD>\r
106 </DT>\r
107 \r
108 <DT>Tracker type\r
109 <DD>\r
110 Sets the type of tracker to use for 2D tracking.\r
111 The available trackers are listed in registry in the\r
112 <b>Video Trackers</b> category.\r
113 If the tracker you want to use isn't listed in the drop-down box,\r
114 make sure it is registered.\r
115 After changing the tracker type, you may close and reopen the 3D\r
116 Tracker property page to cause it to display a tab for the trackers'\r
117 property page as well.\r
118 Although the 3D Tracker filter allows different types of trackers to\r
119 be used for different cameras at the same time, the property page does\r
120 not support this configuration.\r
121 </DD>\r
122 </DT>\r
123 \r
124 <DT>Any size, 640 x 480, and 320 x 240\r
125 <DD>\r
126 Sets the input frame size the 3D Tracker filter will accept. If\r
127 <b>Any size</b> is selected, the source filter will choose the size;\r
128 depending on the cameras in use, the inputs may not all be the same size.\r
129 </DD>\r
130 </DT>\r
131 \r
132 <DT>Checkerboard width and height\r
133 <DD>\r
134 Sets the number of columns and rows of squares in your calibration checkerboard.\r
135 This will apply the next time Calibrate cameras is clicked.\r
136 </DD></DT>\r
137     \r
138 <DT>Calibrate cameras ...\r
139 <DD>\r
140 Tells the filter to begin passing frames to cv3dTrackerCalibrateCameras.\r
141 It pops up a dialog requesting the names of files containing the camera\r
142 intrinsics as generated by CalibFilter.\r
143 It uses the values in the checkerboard width and height fields.\r
144 If the graph isn't running, this will take effect when the graph is run.\r
145 See the next section for more information on camera calibration.\r
146 </DD>\r
147 </DT>\r
148 \r
149 <DT>Tracking results\r
150 <DD>\r
151 The property page also contains four fields \r
152 that display the 3D coordinates of the first four objects being tracked.\r
153 These fields are invisible in the image above.\r
154 These fields are updated on every frame whenever the property page is open\r
155 while the graph is running. If a field is gray, it means the\r
156 corresponding object is not currently being tracked by at least two\r
157 cameras. In this case, the location displayed is the last tracked\r
158 location.\r
159 </DD>\r
160 </DT>\r
161 \r
162 </DL>\r
163 \r
164 <H2>Camera calibration</h2>\r
165 <p>\r
166 The checkerboard that is used for camera intrinsics calibration should\r
167 have a large number of squares and be held close to the camera. A\r
168 different checkerboard may be used to calibrate the 3D Tracker filter.\r
169 It can have\r
170 fewer, larger squares so it can be held farther from the camera. It must be\r
171 visible to all the cameras at once. The position of the\r
172 checkerboard when the 3D Tracker camera calibration is done determines\r
173 the 3D coordinate system that is used to report the locations of the\r
174 tracked objects. The plane of the checkerboard is the x-y plane, with\r
175 the origin being the lower-left intersection on the checkerboard.\r
176 </p>\r
177 <p>\r
178 When you begin camera calibration,\r
179 you will see red circles on the images of the checkerboard as\r
180 it finds corners. When it finds all the corners in an image, the\r
181 circles change to rainbow colors.\r
182 Once it finds all the corners in all the images at the same\r
183 time, the locations of the cameras is saved and calibration stops. If\r
184 this happens instantly, you may only see a flash of color in the\r
185 images.\r
186 To force it to keep running the calibration step even after\r
187 all the corners are found, hold down the control key when you click on\r
188 <b>Calibrate cameras</b>. Click <b>Calibrate cameras</b> again\r
189 (without the control key) to cause it to finish calibrating.\r
190 </p>\r
191 <p>\r
192 If you are using the BlobTracker to track infrared LEDs and\r
193 you have infrared filters on the cameras, you must evenly illuminate\r
194 the checkerboard with a fairly intense infrared source. A 250 watt\r
195 infrared flood lamp works well. A regular (non-infrared) flood lamp\r
196 probably would work as well. \r
197 </p>\r
198 \r
199 \r
200 </BODY>\r
201 </HTML>\r