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

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1 function bipartiteMatchingDemoPlot(sources, detections, a)
Daniel@0 2
Daniel@0 3 hold on
Daniel@0 4 p1 = size(sources,2);
Daniel@0 5 p2 = size(detections,2);
Daniel@0 6 for i=1:p1
Daniel@0 7 h=text(sources(1,i), sources(2,i), sprintf('s%d', i));
Daniel@0 8 set(h, 'color', 'r');
Daniel@0 9 end
Daniel@0 10 for i=1:p2
Daniel@0 11 h=text(detections(1,i), detections(2,i), sprintf('d%d', i));
Daniel@0 12 set(h, 'color', 'b');
Daniel@0 13 end
Daniel@0 14
Daniel@0 15 if nargin < 3, return; end
Daniel@0 16
Daniel@0 17 for i=1:p1
Daniel@0 18 j = a(i);
Daniel@0 19 if j==0 % i not matched to anything
Daniel@0 20 continue
Daniel@0 21 end
Daniel@0 22 line([sources(1,i) detections(1,j)], [sources(2,i) detections(2,j)])
Daniel@0 23 end
Daniel@0 24 axis_pct;