Counts and Sizes of Highly Overlapped/Contacted Particles from Microscopic Image

I have to say this is a challenge tasks in Mathemtica,this answer just a very preliminary start.

img = Import["https://i.stack.imgur.com/QKLHn.jpg"];
mask = MaxDetect[
   ImageAdjust[
    DistanceTransform[
     ColorNegate[
      Binarize[ImageAdjust[GradientFilter[img, 2]], .3]]]], .05];
HighlightImage[img, mask]

Mathematica graphics

So as my count,the number of particles is

Max[MorphologicalComponents[mask]]

1129


The following snippet will allow you to follow the tutorial that you were initially reading using your image instead. The issue, in this case, is not so much the overlapping elements but to correct the noise from a low-light photo to then binarize the image while preserving contour clarity. Using Manipulate at every step can reduce the false positives dramatically. As you can see the number of false positives increases in certain areas of the photo. To deal with the different sizes you could find an appropriate value for the variables kernel and segmentation_X that correspond to a particular particle size in the Serious and Not-So-Serious Image Processing Applications notebook (or simply the third argument of cells in the snippet). It is a good habit to reuse code when that is permitted but it is also fun to come up with solutions from scratch as well. To get more accurate results you could try to use ImagePartition and compound (including errors) the results from the segments in a Mathematica script as it can process smaller pieces of an image faster without the overhead of a graphical user interface that you can later use to refine your results.

hp[img_Image,w_Integer]:=Image[0.5+Subtract@@ImageData/@{img,Blur[img,w]}];
img7= Binarize@Closing[ Threshold[ hp[img,30],0.52],1];
distT =DistanceTransform[img7,Padding->0];
marker = MaxDetect[ImageAdjust[distT],0.02];
w = WatershedComponents[GradientFilter[img7,3],marker,Method->"Rainfall"];Colorize[w]; cells = SelectComponents[w, "Count",500<#<3000&];  measures = ComponentMeasurements[cells,{"Centroid", "EquivalentDiskRadius", "Label"}];Show[img, Graphics[{Orange,Circle@@#&/@(measures[[All,2,1;;2]]), MapThread[Text,{measures[[All,2,3]],measures[[All,2,1]]}]}]]

enter image description here

Max[ComponentMeasurements[cells, "Count"][[All, 1]]]
3549

Here is a slight variation using ImagePartition. The count here was 3,899.

count=0;segments = ImagePartition[img,{250}]; ImageAssemble[ Table[i= Binarize@Closing[ Threshold[ hp[s[[index]],30],0.52],1];
d=DistanceTransform[i,Padding->0];
m = MaxDetect[ImageAdjust[d],0.02];
wa = WatershedComponents[GradientFilter[i,1/10^6],m, Method->"Rainfall"];
Colorize[wa];cells = SelectComponents[wa, "Count",250<#<900&];  measures = ComponentMeasurements[cells,{"Centroid", "EquivalentDiskRadius", "Label"}];
count += Max[ComponentMeasurements[cells, "Count"][[All,1]]];
Show[s[[index]], Graphics[{Orange,Circle@@#&/@(measures[[All,2,1;;2]]), MapThread[Text,{measures[[All,2,3]],measures[[All,2,1]]}]}]]
,{s,segments},{index,1,Last[Length/@segments]}]]

enter image description here

You could also address the different sizes issue with classifiers.