Code without using imclearborder:
clc
clear all
close all
warning off
I=double(imbinarize(rgb2gray(imread('Border.png'))));
figure;imshow(I);
title('Original Image');
[r c]=size(I);
output=zeros(r,c);
for i=1:r
for j=1:c
if(i==r || j==c || i==1 || j==1)
output(i,j)=I(i,j);
end
end
end
output=double(output);
figure;imshow(output);
es=imreconstruct(output,I);
figure;imshow(es);
title('Border Part');
figure;
imshow(I-es);
title('Clearing Border objects');
Code using imclearborder:
clc
clear all
close all
warning off
I=(imbinarize(rgb2gray(imread('Border.png'))));
figure;imshow(I);
title('Original Image');
e=imclearborder(I);
figure;
imshow(e);
title('Clearing Border objects');
Documentation link of imclearborder:
https://www.mathworks.com/help/images...
Learn Image Processing using MATLAB:
• Add two Images | MATLAB (Complete cod...
#DigitalImageProcessing #MATLAB #ComputerVision
On this page of the site you can watch the video online Clearing border components | Digital Image Processing| MATLAB with a duration of hours minute second in good quality, which was uploaded by the user Knowledge Amplifier 14 July 2020, share the link with friends and acquaintances, this video has already been watched 1,329 times on youtube and it was liked by 6 viewers. Enjoy your viewing!