Home > vis > plotfigure_2.m

plotfigure_2

PURPOSE ^

plotfigure plots and saves figure

SYNOPSIS ^

function plotfigure_2( ifolder, frame, ext, positions, type, 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 2.0, July 2010

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function plotfigure_2( ifolder, frame, ext, positions, type, 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 2.0, July 2010
0018 
0019 MARKER_SIZE = 30;
0020 %% CHECK CONDITION
0021 if ~exist(strcat(ifolder,'/',ofolder),'dir')
0022     mkdir(strcat(ifolder,'/',ofolder));
0023 end
0024 %% PLOT
0025 visName = strcat(ifolder,'/VIS/VIS_',...
0026                 ifolder,num2str(frame),'.png');
0027 im = imread(visName);
0028 
0029 
0030 f= figure(1); clf(f);
0031 imshow(im); hold on;
0032 
0033 for po = 1: size(positions,1)
0034     plot( positions(po,4), positions(po,5),...
0035         'Marker','o',...
0036         'MarkerEdgeColor',color,...
0037         'LineWidth',1,...
0038         'Color','k',...
0039         'MarkerSize',MARKER_SIZE);
0040     text( positions(po,4)+30, positions(po,5),...
0041         strcat(num2str(positions(po,3)),'_',type(po)),...
0042         'Color','g',...
0043         'HorizontalAlignment','center',...
0044         'VerticalAlignment','middle',...
0045         'FontSize',16);
0046 end
0047 %% SAVE
0048 ofn = strcat(ifolder,'/',ofolder,'/',ofolder,'_',ifolder,num2str(frame),ext);
0049 fillfigure();
0050 exportfigure(ofn,f,size(im));
0051 
0052 end

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