Region Filling Algorithm | MATLAB Code without using bwfill | Digital Image Processing

Publicado em: 08 Julho 2020
no canal de: Knowledge Amplifier
3,413
35

clc
clear all
close all
warning off
%%
%Take the Original Image
a=[ 0 0 0 0 0 0 0
0 0 1 1 0 0 0
0 1 0 0 1 0 0
0 1 0 0 1 0 0
0 0 1 0 1 0 0
0 0 1 0 1 0 0
0 1 0 0 0 1 0
0 1 0 0 0 1 0
0 1 1 1 1 0 0
0 0 0 0 0 0 0];
imshow(a);
%%
%Defining the structuring element
b=[0 1 0;1 1 1;0 1 0];
%%
%Take the complement of the original Image
acmp=~(a);
%%
%Deside the strat point of hole and make that 1
x=[0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 1 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0];
%%
y=(imdilate(x,b) & acmp);
%%
while(~isequal(x,y))
x=y;
y=(imdilate(x,b) & acmp);

end
y=y | a;
subplot(1,2,1)
imshow(a);
title('Original Image');
subplot(1,2,2)
imshow(y);
title('Image after performing region filling operation');


Nesta página do site você pode assistir ao vídeo on-line Region Filling Algorithm | MATLAB Code without using bwfill | Digital Image Processing duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Knowledge Amplifier 08 Julho 2020, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 3,413 vezes e gostou 35 espectadores. Boa visualização!