源码如下:%%%%%ReadingofaRGBimagei=imread('face8.jpg');I=rgb2gray(i);BW=im2bw(I);figure,imshow(BW)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%minimisationofbackgroundportion[n1n2]=size(BW);r=floor(n1/10);c=floor(n2/10);x1=1;x2=r;s=r*c;fori=1:10y1=1;y2=c;forj=1:10if(y2&