clear;clc;
fid=fopen('D:\Ship\Edge\11','rb');%读取二进制图像
width=200;height=200;
imgdata=fread(fid,[width,height],'uint16');
fclose(fid);
I=double(imgdata)';
figure,imshow(I),title('原始图像');
I1=bwareaopen(I,50);%去除像素值小于50的区域
figure,imshow(I1),title('去除较小区域');
figure,I2=imcontour(I1,3);%轮廓提取
title('轮廓提取');
% subplot(2,2,1),imshow(I),xlabel('原始图像');
% subplot(2,2,2),imshow(I2),xlabel('轮廓提取');
% subplot(2,2,3),imshow(I1),xlabel('去除较小区域');
L=bwlabel(I1,8);%化为标志矩阵
stat=regionprops(L,'all')%图像局部属性
matlab轮廓及属性提取
最新推荐文章于 2024-04-11 20:43:54 发布