Hi i have an image in which some holes are there , i want to make the image as solid . How to do that. I have attached the image

1 Kommentar

mukesh bisht
mukesh bisht am 9 Dez. 2019
Hi
now i want to make the outline of this filled image to be smoother. i.e. the curved portion replaced with straight lines.
how to do it?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH am 20 Nov. 2019

0 Stimmen

change image.jpeg for the name of your image
image=imread('image.jpeg');
mask=imfill(imclose(not(imbinarize(rgb2gray(image))),strel('disk',1)),'holes');
R=image(:,:,1);
G=image(:,:,2);
B=image(:,:,3);
R(mask)=255;
G(mask)=0;
B(mask)=0;
image(:,:,1)=R;
image(:,:,2)=G;
image(:,:,3)=B;
figure;
imshow(image)

2 Kommentare

mukesh bisht
mukesh bisht am 20 Nov. 2019
Thanks a lot sir.I had been trying this since long time.
JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH am 20 Nov. 2019
Bearbeitet: JESUS DAVID ARIZA ROYETH am 20 Nov. 2019
please formally accept my answer.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Read, Write, and Modify Image finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 20 Nov. 2019

Kommentiert:

am 9 Dez. 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by