网站虚拟域名/北京网站建设专业公司
f=imread(‘test1.png’);
subplot(1,3,1);
imshow(f);
title(‘原图’);
bw=im2bw(f);
subplot(1,3,2);
imshow(bw);
title(‘二值图像’);
level=graythresh(f);
bw2=im2bw(f,level);
subplot(1,3,3);
imshow(bw2);
title(‘通过graythresh计算门槛值后得到二值图像’);