%顶帽变换
f=imread('rice.tif');
subplot(2,2,1),imshow(f),title('原图像')
se=strel('disk',10);%结构元素
fo=imopen(f,se);%开运算
subplot(2,2,2),imshow(fo),title('开运算后的图像')
f2=imsubtract(f,fo);%顶帽变换
subplot(2,2,3),imshow(f2),title('顶帽变换')
se=strel('disk',3);%结构元素
g=imsubtract(imadd(f,imtophat(f,se)),imbothat(f,se));%经阈值处理后的顶帽变换
subplot(2,2,4),imshow(g),title('经阈值处理后的顶帽变换图像')
顶帽变换
最新推荐文章于 2025-06-06 14:27:52 发布