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

조회 수: 1 (최근 30일)
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)?

답변 (2개)

yanqi liu
yanqi liu 2021년 9월 27일
sir,may be you should upload brain.jpeg to develop

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

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by