Permalink
Browse files

first commit

  • Loading branch information...
zk00006 committed Apr 6, 2011
1 parent e1375b1 commit eeb789bd4c4f4f4027abbb4b2f488eba4d49de1b
Showing with 7,230 additions and 0 deletions.
  1. +674 −0 LICENSE
  2. BIN _input/00001.png
  3. BIN _input/00002.png
  4. BIN _input/00003.png
  5. BIN _input/00004.png
  6. BIN _input/00005.png
  7. BIN _input/00006.png
  8. BIN _input/00007.png
  9. BIN _input/00008.png
  10. BIN _input/00009.png
  11. BIN _input/00010.png
  12. BIN _input/00011.png
  13. BIN _input/00012.png
  14. BIN _input/00013.png
  15. BIN _input/00014.png
  16. BIN _input/00015.png
  17. BIN _input/00016.png
  18. BIN _input/00017.png
  19. BIN _input/00018.png
  20. BIN _input/00019.png
  21. BIN _input/00020.png
  22. BIN _input/00021.png
  23. BIN _input/00022.png
  24. BIN _input/00023.png
  25. BIN _input/00024.png
  26. BIN _input/00025.png
  27. BIN _input/00026.png
  28. BIN _input/00027.png
  29. BIN _input/00028.png
  30. BIN _input/00029.png
  31. BIN _input/00030.png
  32. BIN _input/00031.png
  33. BIN _input/00032.png
  34. BIN _input/00033.png
  35. BIN _input/00034.png
  36. BIN _input/00035.png
  37. BIN _input/00036.png
  38. BIN _input/00037.png
  39. BIN _input/00038.png
  40. BIN _input/00039.png
  41. BIN _input/00040.png
  42. BIN _input/00041.png
  43. BIN _input/00042.png
  44. BIN _input/00043.png
  45. BIN _input/00044.png
  46. BIN _input/00045.png
  47. BIN _input/00046.png
  48. BIN _input/00047.png
  49. BIN _input/00048.png
  50. BIN _input/00049.png
  51. BIN _input/00050.png
  52. BIN _input/00051.png
  53. BIN _input/00052.png
  54. BIN _input/00053.png
  55. BIN _input/00054.png
  56. BIN _input/00055.png
  57. BIN _input/00056.png
  58. BIN _input/00057.png
  59. BIN _input/00058.png
  60. BIN _input/00059.png
  61. BIN _input/00060.png
  62. BIN _input/00061.png
  63. BIN _input/00062.png
  64. BIN _input/00063.png
  65. BIN _input/00064.png
  66. BIN _input/00065.png
  67. BIN _input/00066.png
  68. BIN _input/00067.png
  69. BIN _input/00068.png
  70. BIN _input/00069.png
  71. BIN _input/00070.png
  72. BIN _input/00071.png
  73. BIN _input/00072.png
  74. BIN _input/00073.png
  75. BIN _input/00074.png
  76. BIN _input/00075.png
  77. BIN _input/00076.png
  78. BIN _input/00077.png
  79. BIN _input/00078.png
  80. BIN _input/00079.png
  81. BIN _input/00080.png
  82. BIN _input/00081.png
  83. BIN _input/00082.png
  84. BIN _input/00083.png
  85. BIN _input/00084.png
  86. BIN _input/00085.png
  87. BIN _input/00086.png
  88. BIN _input/00087.png
  89. BIN _input/00088.png
  90. BIN _input/00089.png
  91. BIN _input/00090.png
  92. BIN _input/00091.png
  93. BIN _input/00092.png
  94. BIN _input/00093.png
  95. BIN _input/00094.png
  96. BIN _input/00095.png
  97. BIN _input/00096.png
  98. BIN _input/00097.png
  99. BIN _input/00098.png
  100. BIN _input/00099.png
  101. BIN _input/00100.png
  102. +1 −0 _input/init.txt
  103. +100 −0 _output/tld.txt
  104. +43 −0 bbox/bb_burn.m
  105. +27 −0 bbox/bb_center.m
  106. +37 −0 bbox/bb_click.m
  107. +27 −0 bbox/bb_click_move.m
  108. +49 −0 bbox/bb_cluster.m
  109. +61 −0 bbox/bb_cluster_confidence.m
  110. +46 −0 bbox/bb_correct.m
  111. +27 −0 bbox/bb_distance.m
  112. +38 −0 bbox/bb_draw.m
  113. +22 −0 bbox/bb_get_similar.m
  114. +24 −0 bbox/bb_height.m
  115. +24 −0 bbox/bb_hull.m
  116. +22 −0 bbox/bb_isdef.m
  117. +24 −0 bbox/bb_isin.m
  118. +25 −0 bbox/bb_isout.m
  119. +28 −0 bbox/bb_normalize.m
  120. +48 −0 bbox/bb_points.m
  121. +33 −0 bbox/bb_predict.m
  122. +25 −0 bbox/bb_rescale_absolute.m
  123. +32 −0 bbox/bb_rescale_relative.m
  124. +22 −0 bbox/bb_scale.m
  125. +82 −0 bbox/bb_scan.m
  126. +25 −0 bbox/bb_shift_absolute.m
  127. +28 −0 bbox/bb_shift_relative.m
  128. +22 −0 bbox/bb_size.m
  129. +30 −0 bbox/bb_square.m
  130. +24 −0 bbox/bb_width.m
  131. +45 −0 compile.m
  132. +25 −0 img/cam_record.m
  133. +32 −0 img/cam_wait.m
  134. +97 −0 img/gt_create.m
  135. +30 −0 img/gt_display.m
  136. +42 −0 img/img_alloc.m
  137. +40 −0 img/img_any2any.m
  138. +33 −0 img/img_blur.m
  139. +33 −0 img/img_dir.m
  140. +25 −0 img/img_get.m
  141. +35 −0 img/img_merge_frames.m
  142. +93 −0 img/img_patch.m
  143. +36 −0 initcamera.m
  144. +149 −0 mex/bb_overlap.cpp
  145. +100 −0 mex/distance.cpp
  146. +440 −0 mex/fern.cpp
  147. +48 −0 mex/ii.cpp
  148. +48 −0 mex/ii2.cpp
  149. +630 −0 mex/linkagemex.cpp
  150. +97 −0 mex/lk.backup.cpp
  151. +220 −0 mex/lk.cpp
  152. +71 −0 mex/tld.cpp
  153. +20 −0 mex/tld.h
  154. +20 −0 mex/vs2008.sln
  155. BIN mex/vs2008.suo
  156. +207 −0 mex/vs2008.vcproj
  157. +65 −0 mex/vs2008.vcproj.XPS1330.Zdenek.user
  158. +154 −0 mex/warp.cpp
  159. +35 −0 other/VisualStudio.sln
  160. +27 −0 other/init_workspace.m
  161. +62 −0 other/run_TLD_demo.m
  162. +51 −0 other/stabilize.m
  163. +19 −0 other/usbclear.m
  164. +26 −0 other/usbinit.m
  165. BIN other/webcam.jpg
  166. +48 −0 run_TLD.m
  167. +8 −0 test/test_bb_scan.m
  168. +17 −0 test/test_bbox_shift_overlap.m
  169. +7 −0 test/test_display_layers.m
  170. +43 −0 test/test_face_detector.m
  171. +10 −0 test/test_featureGenerata.m
  172. +25 −0 test/test_getPatch.m
  173. +22 −0 test/test_tmdPatch2Pattern.m
  174. +6 −0 test/test_webcam.m
  175. +187 −0 tld/tldDemo.m
  176. +68 −0 tld/tldDetection.m
  177. +220 −0 tld/tldDisplay.m
  178. +65 −0 tld/tldExample.m
  179. +40 −0 tld/tldGenerateAprioriData.m
  180. +60 −0 tld/tldGenerateFeatures.m
  181. +30 −0 tld/tldGenerateNegativeData.m
  182. +62 −0 tld/tldGeneratePositiveData.m
  183. +43 −0 tld/tldGeneratePositiveData_single_bbox.m
  184. +42 −0 tld/tldGetPattern.m
  185. +42 −0 tld/tldGetPattern_fast.m
  186. +140 −0 tld/tldInit.m
  187. +59 −0 tld/tldInitDetector.m
  188. +43 −0 tld/tldInitFirstFrame.m
  189. +30 −0 tld/tldInitSource.m
  190. +47 −0 tld/tldLearning.m
  191. +24 −0 tld/tldLoadAprioriImages.m
  192. +23 −0 tld/tldMinMaxVar.m
  193. +60 −0 tld/tldNN.m
  194. +22 −0 tld/tldPatch2Pattern.m
  195. +100 −0 tld/tldProcessFrame.m
  196. +31 −0 tld/tldSaveImages.m
  197. +31 −0 tld/tldSplitNegativeData.m
  198. +53 −0 tld/tldTrack.m
  199. +79 −0 tld/tldTrack_occlusion.2.m
  200. +99 −0 tld/tldTrack_occlusion.m
  201. +51 −0 tld/tldTracking.m
  202. +56 −0 tld/tldTrainNN.m
  203. +90 −0 tld/tldUpdateDetector.m
  204. +106 −0 tld/tldUpdateDetectorConservative.m
  205. +22 −0 utils/idx2id.m
  206. +59 −0 utils/mat2img.m
  207. +29 −0 utils/maximize.m
  208. +22 −0 utils/median2.m
  209. +21 −0 utils/n2s.m
  210. +30 −0 utils/ntuples.m
  211. +22 −0 utils/pseudorandom_indexes.m
  212. +40 −0 utils/randvalues.m
  213. +21 −0 utils/repcel.m
  214. +29 −0 utils/uniquecount.m
  215. +21 −0 utils/vnormp.m
View
674 LICENSE

Large diffs are not rendered by default.

Oops, something went wrong.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
@@ -0,0 +1 @@
+288,36,313,78
View
@@ -0,0 +1,100 @@
+288,36,313,78,1
+288.31,51.544,312.61,92.396,0.9535
+297,24,322,66,0.82615
+305.08,29.41,331.05,73.074,0.79304
+304.01,38.772,330.91,84.087,0.73357
+301.77,41.271,328.35,86.03,0.69091
+312.76,65.206,340.32,111.67,0.66484
+322.37,75.097,351.27,123.79,0.61755
+327.12,69.927,356.44,119.34,0.67408
+324.88,40.321,354.31,90.015,0.68175
+321.05,33.373,350.45,83.084,0.68047
+317.75,52.272,346.56,101.02,0.65874
+319.09,57.736,347.69,106.13,0.66839
+319.57,66.157,347.47,113.34,0.75851
+326.77,58.095,354.31,104.69,0.70503
+328.1,53.007,355.39,99.123,0.71763
+323.95,91.618,351.09,137.48,0.70643
+310.58,120.21,337.25,165.3,0.83605
+289.5,118.44,316.92,164.78,0.82578
+282.04,119.54,309.9,166.65,0.86897
+281.47,99.989,310.17,148.53,0.85381
+280.38,86.979,308.87,135.18,0.83919
+276.76,89.272,306.08,138.91,0.72204
+282.22,100.13,310.76,148.36,0.64004
+284.31,95.414,312.74,143.49,0.59436
+281.38,72.412,310.77,122.07,0.54462
+352,59,382,110,0.65722
+354.62,55.725,385.8,108.7,0.64635
+363.24,52.801,395.91,108.28,0.64686
+361.47,36.689,396.37,95.908,0.63185
+362,16.55,400.02,81.009,0.63489
+379.14,32.34,419.52,100.76,0.6048
+392.48,37.526,436.72,112.41,0.57505
+278.8,9.8,312.4,66.8,0.74485
+285.02,5.7106,316.97,59.943,0.77011
+286.53,-8.0493,318.52,46.243,0.52544
+295.6,-23.408,326.91,29.751,0.53076
+296.97,-27.769,328.46,25.704,0.48987
+303.5,-27.293,334.67,25.643,0.46684
+301.52,-10.062,334.25,45.493,0.3727
+303.45,-5.9746,336.62,50.303,0.48647
+NaN,NaN,NaN,NaN,NaN
+NaN,NaN,NaN,NaN,NaN
+297,4,335.67,69,0.73684
+301.9,32.984,339.84,96.768,0.72317
+307.24,48.809,344.23,111.12,0.79795
+312.21,65.226,345.68,121.77,0.76906
+313.01,60.594,346.59,117.39,0.64402
+309.15,57.807,341.71,112.97,0.82668
+303.84,55.003,337.58,112.18,0.77932
+300.92,49.425,334.42,106.22,0.78804
+296.15,40.987,329.57,97.678,0.79597
+291.05,30.225,325.37,88.421,0.7807
+289.42,30.532,323.19,87.828,0.74873
+289.33,40.797,322.63,97.289,0.72713
+287.09,46.33,319.82,101.88,0.7126
+285.47,55.148,318.1,110.54,0.73819
+284.09,68.938,316.37,123.74,0.80109
+269.12,74.766,301.93,130.46,0.72723
+249.23,63.911,282.13,119.75,0.68988
+243.99,91.883,276.46,146.99,0.67034
+266.82,74.91,300.18,131.53,0.65897
+266.01,31.977,300.1,89.797,0.66884
+267.91,33.86,301.82,91.38,0.6793
+276.05,61.86,309.79,119.11,0.69066
+290.6,87.5,325.6,146.7,0.68047
+296.88,96.704,331.28,154.97,0.74729
+300.79,104.81,334.57,162.07,0.74364
+301.83,107.16,334.78,163.06,0.72813
+308.85,113.98,341.66,169.65,0.7454
+307.26,123.92,340.18,179.78,0.74632
+308.77,125.5,341.29,180.69,0.73487
+289.27,102.02,322.02,157.62,0.71577
+276.1,57.005,308.58,112.14,0.69865
+275.96,57.1,308.46,112.27,0.71118
+280.46,73.853,313.2,129.43,0.73645
+284.99,77.07,317.82,132.79,0.71151
+290.37,75.329,323.22,131.07,0.71505
+292.59,68.138,325.73,124.38,0.69936
+296.1,58.102,329.64,115.01,0.65717
+300.03,60.841,333.08,116.93,0.63795
+304.45,65.395,337.98,122.28,0.61992
+305.46,62.297,340.18,121.17,0.59474
+308.43,59.448,343.05,118.16,0.58508
+306.08,56.658,343.63,120.28,0.53205
+302.83,59.896,340.17,123.17,0.48624
+NaN,NaN,NaN,NaN,NaN
+294,39,330,100,0.59411
+292.74,43.593,329.58,105.91,0.6398
+292.09,31.544,329.99,95.454,0.69356
+292.61,19.163,330.66,83.285,0.71836
+300.47,0.8267,339.39,66.358,0.79734
+305.64,-2.3838,344.11,62.462,0.69705
+306,6,331,48,0.70174
+305.39,6.0495,330.09,47.546,0.69276
+302.17,11.833,339.83,75.167,0.71484
+298.6,37.003,335.85,99.672,0.70948
+287.72,70.103,323.96,131.1,0.57638
+282.16,75.978,318.52,137.25,0.82056
+NaN,NaN,NaN,NaN,NaN
View
@@ -0,0 +1,43 @@
+% Copyright 2011 Zdenek Kalal
+%
+% This file is part of TLD.
+%
+% TLD is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% TLD is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with TLD. If not, see <http://www.gnu.org/licenses/>.
+
+
+function img = bb_burn(img, bb_in, width)
+
+if ~exist('width','var')
+ width = 0;
+end
+
+if isempty(bb_in)
+ return;
+end
+
+for i = 1:size(bb_in,2)
+
+ bb = bb_in(:,i);
+ bb(1) = max([1 bb(1)]);
+ bb(2) = max([1 bb(2)]);
+ bb(3) = min([size(img,2), bb(3)]);
+ bb(4) = min([size(img,1), bb(4)]);
+
+
+ img(bb(2):bb(2)+width,bb(1):bb(3)) = 255;
+ img(bb(4)-width:bb(4),bb(1):bb(3)) = 255;
+ img(bb(2):bb(4),bb(1):bb(1)+width) = 255;
+ img(bb(2):bb(4),bb(3)-width:bb(3)) = 255;
+
+end
View
@@ -0,0 +1,27 @@
+% Copyright 2011 Zdenek Kalal
+%
+% This file is part of TLD.
+%
+% TLD is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% TLD is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with TLD. If not, see <http://www.gnu.org/licenses/>.
+
+
+function center = bb_center(bb)
+% Info
+
+if isempty(bb)
+ center = [];
+ return;
+end
+
+center = 0.5 * [bb(1,:)+bb(3,:); bb(2,:)+bb(4,:)];
View
@@ -0,0 +1,37 @@
+% Copyright 2011 Zdenek Kalal
+%
+% This file is part of TLD.
+%
+% TLD is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% TLD is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with TLD. If not, see <http://www.gnu.org/licenses/>.
+
+
+function bb = bb_click(tld,img)
+% Create
+
+if isfield(tld,'handle')
+ h = get(gca,'Children'); delete(h(1:end-1));
+ set(tld.handle,'cdata',img);
+else
+ imshow(img);
+end
+text(10,10,'Define bounding box and double click inside.','color','white');
+h = imrect;
+p = wait(h);
+bb = [p(1); p(2);p(1)+p(3); p(2)+p(4)];
+% [c,r,p] = impixel(img);
+% if length(c) ~= 2,
+% bb = [];
+% return;
+% end
+% bb = [c(1); r(1); c(2); r(2)];
View
@@ -0,0 +1,27 @@
+% Copyright 2011 Zdenek Kalal
+%
+% This file is part of TLD.
+%
+% TLD is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% TLD is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with TLD. If not, see <http://www.gnu.org/licenses/>.
+
+
+function bb = bb_click_move(img,bb)
+% Change
+
+[c,r,p] = impixel(bb_burn(img,bb));
+
+bbW = bb_width(bb);
+bbH = bb_height(bb);
+
+bb = [c(1) - bbW/2; r(1) - bbH/2; c(1) + bbW/2; r(1) + bbH/2];
View
@@ -0,0 +1,49 @@
+% Copyright 2011 Zdenek Kalal
+%
+% This file is part of TLD.
+%
+% TLD is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% TLD is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with TLD. If not, see <http://www.gnu.org/licenses/>.
+
+function [bb,cSz] = bb_cluster(bb2, SPACE_THR, MIN_NUM_BB)
+% Clusters bboxes.
+
+if isempty(bb2)
+ bb = [];
+ cSz = [];
+ return;
+end
+
+switch size(bb2,2)
+ case 0, T = [];
+ case 1, T = 1;
+ case 2
+ T = ones(2,1);
+ if bb_distance(bb2) > SPACE_THR, T(2) = 2; end
+ otherwise
+ bbd = bb_distance(bb2);
+ Z = linkagemex(bbd,'si');
+ T = cluster(Z,'cutoff', SPACE_THR,'criterion','distance');
+end
+uT = unique(T);
+
+% Merge clusters
+bb = [];
+cSz = [];
+for i = 1:length(uT)
+ num_bb = sum(T == uT(i));
+ if num_bb >= MIN_NUM_BB
+ bb = [bb mean(bb2(:,T == uT(i)),2)];
+ cSz = [cSz num_bb];
+ end
+end
@@ -0,0 +1,61 @@
+% Copyright 2011 Zdenek Kalal
+%
+% This file is part of TLD.
+%
+% TLD is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% TLD is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with TLD. If not, see <http://www.gnu.org/licenses/>.
+
+
+function [oBB,oConf,oSize] = bb_cluster_confidence(iBB, iConf)
+% Clusterering of tracker and detector responses
+% First cluster returned corresponds to the tracker
+
+SPACE_THR = 0.5;
+
+oBB = [];
+oConf = [];
+oSize = [];
+
+if isempty(iBB)
+ return;
+end
+
+switch size(iBB,2)
+ case 0, T = [];
+ case 1, T = 1;
+ case 2
+ T = ones(2,1);
+ if bb_distance(iBB) > SPACE_THR, T(2) = 2; end
+ otherwise
+ bbd = bb_distance(iBB);
+ Z = linkagemex(bbd,'si');
+ T = cluster(Z,'cutoff', SPACE_THR,'criterion','distance');
+end
+
+idx_cluster = unique(T);
+num_clusters = length(idx_cluster);
+
+oBB = nan(4,num_clusters);
+oConf = nan(1,num_clusters);
+oSize = nan(1,num_clusters);
+
+for i = 1:num_clusters
+
+ idx = T == idx_cluster(i);
+
+ oBB(:,i) = mean(iBB(1:4,idx),2);
+ oConf(i) = mean(iConf(idx));
+ oSize(i) = sum(idx);
+
+end
+
Oops, something went wrong.

0 comments on commit eeb789b

Please sign in to comment.