BW2 = imfill(BW)

作用填充二值图像BW中的空洞

 

clear all; clc; close all;

img = imread('test1.png');

if ndims(img)==3

    img = rgb2gray(img);

end

img_bw = im2bw(img);

img_fill = imfill(img_bw, 'holes');

figure;

subplot(1,2,1),imshow(img_bw), title('有空洞的图像');

subplot(1,2,2),imshow(img_fill), title('孔洞被填充的图像');

matlab imfill孔洞填充

 

 

 

相关文章:

  • 2022-01-21
  • 2022-02-04
  • 2021-08-02
  • 2021-12-05
  • 2021-12-05
  • 2022-01-03
  • 2021-12-05
猜你喜欢
  • 2021-10-21
  • 2021-06-29
  • 2021-12-05
  • 2021-12-05
  • 2022-12-23
  • 2021-11-30
  • 2021-12-05
相关资源
相似解决方案