数字图像处
end end end
------------------------------图像膨胀------------------------- for i=2:M-1 for j=2:N-1 if B2(i,j)==1 bottle(i,j-1)=1;
bottle(i-1,j)=1; bottle(i+1,j)=1; bottle(i,j+1)=1; end end end for r=1:M for t=1:N
if bottle(r,t)==1 Express(r,t)=255;
else Express(r,t)=0;%填充颜色 % end end end
------------------------------------------------------------- subplot(1,2,2);
imshow(Express);title('显示图像');
--------------------------填充颜色----------------------------