close all;clear all;clc;
% 开运算和闭运算
I = imread('testpic.jpg');
I = im2bw(I);
I = ~I;
se = strel('line',5,90);
J = imopen(I,se);
K = imclose(I,se);
figure;
subplot(131);imshow(I);title('原图像');
subplot(132);imshow(J);title('开运算');
subplot(133);imshow(K);title('闭运算');
该程序代码输出见上图
posted on
2019-09-03 19:52我坚信阳光灿烂
阅读(2490)
评论(0)
编辑收藏举报