Segmentation not working properly?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
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
답변 (1개)
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
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.
참고 항목
카테고리
Help Center 및 File Exchange에서 Biomedical Imaging에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!