matthiasm@8: function bipartiteMatchingDemoPlot(sources, detections, a) matthiasm@8: matthiasm@8: hold on matthiasm@8: p1 = size(sources,2); matthiasm@8: p2 = size(detections,2); matthiasm@8: for i=1:p1 matthiasm@8: h=text(sources(1,i), sources(2,i), sprintf('s%d', i)); matthiasm@8: set(h, 'color', 'r'); matthiasm@8: end matthiasm@8: for i=1:p2 matthiasm@8: h=text(detections(1,i), detections(2,i), sprintf('d%d', i)); matthiasm@8: set(h, 'color', 'b'); matthiasm@8: end matthiasm@8: matthiasm@8: if nargin < 3, return; end matthiasm@8: matthiasm@8: for i=1:p1 matthiasm@8: j = a(i); matthiasm@8: if j==0 % i not matched to anything matthiasm@8: continue matthiasm@8: end matthiasm@8: line([sources(1,i) detections(1,j)], [sources(2,i) detections(2,j)]) matthiasm@8: end matthiasm@8: axis_pct;