Image segmentation of cells with a lot of background noise
1 view (last 30 days)
Show older comments
Hello everyone,
I got some troubles with some images I need to process. There will be many thousands of images, so it need to be handle this automatically.
I have to detect neurons in a series of images, so I can end up to do some 3D-reconstruction. Hence, the boundary of the detected neuron should be accurate to some extend.
However, the problem already occur with the segmentation of neurons. The gray-scale intensity change from picture to picture and the intensity between each neurons in the same picture is also different.
The images(26 in this case for demo) are in the attached cropData2.mat, which you can see and also visualized here:
Fig. 6


Fig. 8


Fig.11


Here is my code for now:
if true
% code
load('cropData2.mat')
Detect(length(cropData)) = struct('BW_image',[]);
% Loop through all images
for k =1:length(cropData)
I = cropData(k).Crop_img;
% Convert to double for calculations
GrayI=double(I);
% Average value for the images
avg =round(mean(mean(GrayI)));
% Values larger than 0.93 of the average value are regarded as noise
% Is there a better way?
h =round(0.93*avg);
% Values lower than 0.78 of the average value are regarded as noise
% Is there a better way?
l =round(0.78*avg);
% Removing values above and lower than h and l
I_filt =I;
I_filt(I_filt>h)=255; % h = high values
I_filt(I_filt<l)=255; % l = low values
% Increasing the contrast
I2 = adapthisteq(I_filt);
% Removing small objects
se = strel('disk', 1);
I_filt2 = imclose(I_filt, se);
% Convert to bw
bw = imbinarize(I_filt2);
% Remove objects less than 100 pixels
% Is there a better way???
binaryImageRemove = imcomplement(bwareaopen(~bw, 100)); % We won't remove anything, since the resolution is bad
% Give some shape back to the neurons
se = strel('square', 6);
I_filt3 = imopen(binaryImageRemove, se);
% Fill holes in region
BW = imcomplement(imfill(~I_filt3, 'holes'));
% Smooth edges
Detect(k).BW_image = imopen(BW, strel('disk',4));
end
end
%Visualize images
for i = 1:length(cropData)
imshow(Detect(i).BW_image)
title(['Image number ',num2str(i)])
pause
% press space to move to next image
end
Does anyone have any experience to handle such a problem?
Thank you for your time and help,
Dario
0 Comments
Answers (2)
Image Analyst
on 6 Jun 2018
This looks pretty challenging, or impossible, to do with traditional image analysis. Perhaps you could use stdfilt() or MSER to look for smooth areas. I suggest you try deep learning which might possibly be a better approach.
0 Comments
Jeremy Zhu
on 28 Jun 2020
I also encountered the same problem, I don’t know if traditional recognition can solve it
0 Comments
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!