Segmentation not working properly?

조회 수: 1 (최근 30일)
Warid Islam
Warid Islam 2022년 10월 17일
댓글: Warid Islam 2022년 10월 21일
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
Walter Roberson
Walter Roberson 2022년 10월 21일
j=rgb2gray(imread('IMG-0012-00218.png'));
figure, imshow(j)
[numrow, numcol] = size(j);
[x,y]=getpts;x=round(x);y=round(y);
x = max(3, min(x, numcol-2));
y = max(3, min(y, numrow-2));
a 5 x 5 window centered on x and y should now be entirely within the image, provided that the image has at least 5 rows and 5 columns.
At this point you can do things like
subimage = j(y-2:y+2, x-2:x+2);
do growing within subimage starting from (2,2)
or you can do
maskedimage = zeros(numrow, numcol, 'like', j);
maskedimage(y-2:y+2, x-2:x+2) = j(y-2:y+2, x-2:x+2);
do growing on maskedimage starting from row y column x
Warid Islam
Warid Islam 2022년 10월 21일
Thank you very much.

댓글을 달려면 로그인하십시오.

답변 (1개)

Vinayak Choyyan
Vinayak Choyyan 2022년 10월 20일
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
Vinayak Choyyan
Vinayak Choyyan 2022년 10월 21일
In that case you can train a supervised deep learning model to do automatic segmentation.
You will have to create dataset to train the model for automatic segmentation. To label/segment the training images, you can use the Image Labeler, Video Labeler, or Ground Truth Labeler apps. Then you could train various deep learning models like convolutional neural network (CNN) based encoder decoder segmentations to get a fairly accurate model. You can leverage the tools available in MATLAB, which you can find in the link in my comment above.
Or you could also find many examples of medical image segmentation on google which used deep learning and produced good results of accuracy. It is a highly explored topic.
Warid Islam
Warid Islam 2022년 10월 21일
Thank you for your suggestions.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Biomedical Imaging에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by