# How to detect the fuzzy edge in this image?

I am trying to process a lot of images of bacteria. As you can see from this image, when several bacterias are very close, the boundary tends to be very fuzzy.

I try to binary the image or detect the edge use canny operator.But the result is unsatisfying.

So is there a right way to distinguish every cell in this situation?I want both get the right count and position of every cell. Thanks to all of you.

bacteria segmentation is a broad field with many approaches. here's an example. For your spesific image, I think you can do the following tricks:

d=double(imread('bac.png'));
d=d./max(d(:));

ws=7; % window size
mean_d=imfilter(d,fspecial('average',ws),'replicate'); % this is a local mean operation
d2=d-mean_d;

d3 = conv2(d2.*(d2>0), fspecial('laplacian',0),'same');
subplot(3,1,1);imagesc(d);colorbar
subplot(3,1,2);imagesc(d2);colorbar
subplot(3,1,3);imagesc(d3);colorbar


you can take it from there...

I assume that you have already tried kind of edge detector - you should pay attention Hysteresis for Canny -

Second, you can try to image enhancement technique which name is Histogram Equalization. Histogram equalization makes darker parts more more darker and brighter parts will be more brighter. Then you can apply Canny or adaptive threshold to detect these bacterias.