Hi,
I've created this function m file to convert grayscale images to binary images (as gray2bin matlab function):
function conv_to_BW(im)[m,n]=size(im);BW=zeros(m,n);for i=1:m for j=1:n if im(i,j)<10 BW(i,j)=0; else BW(i,j)=1; end endend
But, when I apply this function to a file in grayscale as:
conv_to_BW(grayscalefile);
it doesn't generate BW variable-image-matrix and doesn't generate m,n variables.
Best Answer