Segmentation not working properly?
6 views (last 30 days)
Show older comments
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)
Answers (1)
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.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!