Home > src > BN_pol_rec > functions > passable.m

passable

PURPOSE ^

Passable = [Good Bad] and sum(Passable) = 1;

SYNOPSIS ^

function [Pass] = passable(im_mat, pos)

DESCRIPTION ^

 Passable = [Good Bad] and sum(Passable) = 1;

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [Pass] = passable(im_mat, pos)
0002 % Passable = [Good Bad] and sum(Passable) = 1;
0003 Passable = [0 0];
0004 sz = size(pos);
0005 rgb_pos = zeros(sz(1),3);
0006 no_of_passable = 0;
0007 sx = pos(1) - 1;
0008 sy = pos(2) - 1;
0009 y = sy;
0010 x = sx;
0011 for i = 1:3
0012  for j= 1:3
0013   if inMatrix(im_mat, x, y)  
0014       inMatrix(im_mat, x, y)
0015     rgb_pos(i,:) = im_mat(x, y ,1:3); 
0016     [maxV, idx] = max( findColor(rgb_pos(i,:)));
0017     if idx == 5
0018       no_of_passable = no_of_passable + 1;
0019     end
0020   else
0021       disp('ERROR: not in matrix');
0022       x,y
0023   end
0024   x = x + 1;
0025 end
0026  x = sx;
0027  y = y + 1;
0028 end
0029 Pass = [(no_of_passable/9) (1-(no_of_passable/9))];

Generated on Wed 16-Mar-2005 09:17:47 by m2html © 2003