BW = imfill(BW,'holes')
该函数通过参数holes可以填充二值图像中的空洞
close all;clear all;clc;
I = imread('tire.tif');
J = imfill(I,'holes'); %图像填充
figure;
subplot(121);imshow(I);
subplot(122);imshow(J);
BW = imfill(BW,'holes')
该函数通过参数holes可以填充二值图像中的空洞
close all;clear all;clc;
I = imread('tire.tif');
J = imfill(I,'holes'); %图像填充
figure;
subplot(121);imshow(I);
subplot(122);imshow(J);