How can I extract the inner cell body(s) from the cell capsule in images (grayscale) such as these ??

2 次查看(过去 30 天)
This is what I have written so far but I cannot seem to get the exact shape of the cell body in the mask
image_file = 'IMAGE_LOCATION';
image = imread(image_file);
figure
imshow(image);
image = adapthisteq(image);
figure
imshow(image);
image_wth = image - imopen(image, strel('disk', 5));
figure
imshow(image_wth);
image_bw = imbinarize(image_wth);
image_bw = bwareaopen(image_bw, 20);
image_bw = imclose(image_bw, strel('disk', 5));
image_bw = imfill(image_bw, 'holes');
B = bwboundaries(image_bw);
figure
imshow(image_bw);
hold on
visboundaries(B);
figure
imshowpair(image_wth, image_bw);
key = waitforbuttonpress;
close all
  1 个评论
Gaurav Kudva
Gaurav Kudva 2018-2-6
编辑:Gaurav Kudva 2018-2-6
This is what the result looks like for the first image using the code given above.
But a part of the first cell body is missing in the mask.
So I need help in extracting the exact shape of the cell body in the mask. How do I go about it ??

请先登录,再进行评论。

回答(1 个)

Arun Mathamkode
Arun Mathamkode 2018-2-22
To get good results you have to finetune the parameters in the algorithm. For example, giving a lower threshold for imbinarize function (may be 0.1) will give you complete mask. Although I am not much clear about the algorithm you are using, I believe it is heavily depended on multiple parameters. Tuning these parameters for different images will be difficult.
If we can assume the cell body will be approximately circular, we can use imfindcircles to detect the circles in the image and use imfill to create the mask from the circle boundaries. I believe this approach will be more robust.

Community Treasure Hunt

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

Start Hunting!

Translated by