Segmentation not working properly?

2 views (last 30 days)
Warid Islam
Warid Islam on 17 Oct 2022
Commented: Warid Islam on 21 Oct 2022
I want to segment tumors from stomach. 'u2.png' is the original image. The region inside the red boundary should be the actual segmentated region. However, my segmentation result is 'u1.png', which is not correct. I tried the method below. Any suggestions would be appreciated, Thank you.
m=imread('u2.png');
T = graythresh(m); % find the threshold for input image
S = imbinarize(m,T); % Segment the image using thresholding
figure, imshow(S,[])
binaryImage = imfill(S, 'holes');
figure, imshow(binaryImage)
BW = bwareafilt(binaryImage, 1);
figure, imshow(BW)
img_class=class(j);
fill=cast(BW,img_class);
m1=fill.*j;
figure,imshow(m1)
  9 Comments

Sign in to comment.

Answers (1)

Vinayak Choyyan
Vinayak Choyyan on 20 Oct 2022
Hi,
As per my understanding, you are trying to perform medical image segmentation. I see you are trying to use predefined segmentation techniques but have not got good results.
Please check out this link
to know more about the segmentation tools and methods provided in MATLAB and easily try out various segmentation techniques, including deep learning based segmentation, through MATLAB’s Image Segmenter App. You can also use the Image Segmenter App to refine the segmentation and get better results.
  3 Comments
Warid Islam
Warid Islam on 21 Oct 2022
Thank you for your suggestions.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!