Home > GVSToolbox > viewAOILandscape.m

viewAOILandscape

PURPOSE ^

A: image

SYNOPSIS ^

function AOIimage = viewAOILandscape( aoiPos, outSideDist, A, showFigure )

DESCRIPTION ^

  A: image
  aoiPos: [ x x x; y y y]

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function AOIimage = viewAOILandscape( aoiPos, outSideDist, A, showFigure )
0002 
0003 
0004 %  A: image
0005 %  aoiPos: [ x x x; y y y]
0006 
0007 %----------------------------------
0008 % show AOI landscape ( voranoid type )
0009 
0010 if nargin < 4
0011     showFigure = 1;
0012 end
0013 
0014 
0015     clf( gcf)
0016     % learning part
0017     numAOI =size(aoiPos,2);
0018     [numYsamples numXsamples] = size( A(:,:,1));
0019     x = 1:numXsamples;
0020     y = 1:numYsamples;
0021     [X,Y] = meshgrid(x,y);
0022     distMatrixLearn = zeros( numYsamples*numXsamples, numAOI);
0023 
0024     for i1 = 1:numAOI
0025         distVecLearn = calc2Dist( aoiPos(:,i1), [X(:)' ; Y(:)' ]); % 2-norm
0026         distMatrixLearn(:,i1) =  distVecLearn;
0027     end
0028     [C AOIimage ]=min( distMatrixLearn,[],2);
0029     AOIimage( C > outSideDist) = numAOI+1; % for outside region
0030     AOIimage = reshape(AOIimage,  [numYsamples, numXsamples ] );
0031     AOIimage = edge(AOIimage);
0032     
0033     
0034     if showFigure
0035         %  imagesc(  AOIimage ), colormap gray;
0036         imshow( mixRGBAndGray( A, AOIimage )); %, colormap gray;
0037         axis equal off
0038         hold on
0039         plot( aoiPos(1,:), aoiPos(2,:), 'b*' );
0040         for i1 = 1:numAOI
0041             text( aoiPos(1,i1)+4,  aoiPos(2,i1)+4, int2str(i1), 'fontsize', 20,'color', 'blue' )
0042         end
0043         hold off
0044         pause(.1);
0045     end
0046     
0047     
0048 
0049 end

Generated on Tue 01-Jul-2014 12:35:04 by m2html © 2005