Home > vis > plotfigure.m

plotfigure

PURPOSE ^

plotfigure plots and saves figure

SYNOPSIS ^

function plotfigure( ifolder, frame, ext, positions, ofolder,color)

DESCRIPTION ^

plotfigure plots and saves figure
 EXAMPLE
       plotfigure('rhod74-10-',25,'.mn.png',[200 100; 120 650; 430 560],'FN');
 INPUT
         ifolder     - input folder name
         frame       - image frame number
         ext         - extenstion eg. mn.png
         positions   - N X 5 matrix of seq,fr, id,x,y positions
         ofolder     - output folder name eg. FN , FP
 OUTPUT
         none
 SEE ALSO
         im_get, plot, fillfigure, exportfigure
 ABOUT
         Written by Rich Nguyen (rich.uncc@gmail.com)
         Version 1.0, June 2010

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function plotfigure( ifolder, frame, ext, positions, ofolder,color)
0002 %plotfigure plots and saves figure
0003 % EXAMPLE
0004 %       plotfigure('rhod74-10-',25,'.mn.png',[200 100; 120 650; 430 560],'FN');
0005 % INPUT
0006 %         ifolder     - input folder name
0007 %         frame       - image frame number
0008 %         ext         - extenstion eg. mn.png
0009 %         positions   - N X 5 matrix of seq,fr, id,x,y positions
0010 %         ofolder     - output folder name eg. FN , FP
0011 % OUTPUT
0012 %         none
0013 % SEE ALSO
0014 %         im_get, plot, fillfigure, exportfigure
0015 % ABOUT
0016 %         Written by Rich Nguyen (rich.uncc@gmail.com)
0017 %         Version 1.0, June 2010
0018 
0019 MARKER_SIZE = 10;
0020 %% CHECK CONDITION
0021 if ~exist(strcat(ifolder,'/',ofolder),'dir')
0022     mkdir(strcat(ifolder,'/',ofolder));
0023 end
0024 %% PLOT
0025 mapper = BCMapper();
0026 im = mapper.read(ifolder,'SC',frame);
0027 
0028 
0029 f= figure(1); clf(f);
0030 imshow(im); hold on;
0031 
0032 for po = 1: size(positions,1)
0033     plot( positions(po,4), positions(po,5),...
0034         'Marker','o',...
0035         'MarkerEdgeColor',color,...
0036         'LineWidth',1,...
0037         'Color','k',...
0038         'MarkerSize',MARKER_SIZE);
0039     text( positions(po,4)+10, positions(po,5),...
0040         num2str(positions(po,3)),...
0041         'Color','g',...
0042         'HorizontalAlignment','center',...
0043         'VerticalAlignment','middle',...
0044         'FontSize',8);
0045 end
0046 %% SAVE
0047 ofn = strcat(ifolder,'/',ofolder,'/',ofolder,'_',ifolder,num2str(frame),ext);
0048 fillfigure();
0049 exportfigure(ofn,f,size(im));
0050 
0051 end

Generated on Thu 17-Mar-2011 14:45:51 by m2html © 2005