How to extract the backgroung from the object .....after using Watershed segmentation??

1 visualizzazione (ultimi 30 giorni)
I= imread('C:\Users\IT Lab\Downloads\brain.jpeg');
I1= imtophat(I, strel('disk',50));
figure,imshow(I1);
title('1');
level = graythresh(I1);
BW = im2bw(I1,level);
figure,imshow(BW);
title('2')
C=~BW;
figure,imshow(C);
D= -bwdist(C);
D(C)= -Inf;
L= watershed(D);
figure,imshow(L);
wi=label2rgb(L);
figure,imshow(wi);
im=I;
im(L==0)=0;
figure,imshow(im);
Here is my segmentation code, but now I have to work with the background only, not the brain image, which I will merge later....So, can anybody help me in separating the background from the Brain image(x-ray)?

Risposte (2)

yanqi liu
yanqi liu il 27 Set 2021
sir,may be you should upload brain.jpeg to develop

Image Analyst
Image Analyst il 27 Set 2021
~BW would be the background. It's just the inverse of the foreground.
You can get a better answer if you upload the image.

Categorie

Scopri di più su Introduction to Installation and Licensing in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by