annotate toolboxes/FullBNT-1.0.7/KPMtools/bipartiteMatchingDemoPlot.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function bipartiteMatchingDemoPlot(sources, detections, a)
wolffd@0 2
wolffd@0 3 hold on
wolffd@0 4 p1 = size(sources,2);
wolffd@0 5 p2 = size(detections,2);
wolffd@0 6 for i=1:p1
wolffd@0 7 h=text(sources(1,i), sources(2,i), sprintf('s%d', i));
wolffd@0 8 set(h, 'color', 'r');
wolffd@0 9 end
wolffd@0 10 for i=1:p2
wolffd@0 11 h=text(detections(1,i), detections(2,i), sprintf('d%d', i));
wolffd@0 12 set(h, 'color', 'b');
wolffd@0 13 end
wolffd@0 14
wolffd@0 15 if nargin < 3, return; end
wolffd@0 16
wolffd@0 17 for i=1:p1
wolffd@0 18 j = a(i);
wolffd@0 19 if j==0 % i not matched to anything
wolffd@0 20 continue
wolffd@0 21 end
wolffd@0 22 line([sources(1,i) detections(1,j)], [sources(2,i) detections(2,j)])
wolffd@0 23 end
wolffd@0 24 axis_pct;