I use the following codes for this work, but they have low accuracy. I would be grateful if you could help me. ![enter image description here](https://community.wolfram.com//c/portal/getImageAttachment?filename=rrr.png&userId=2971053)
The codes are as follows
Pruning@Thinning@Closing[#, 5] &@DeleteSmallComponents[#, 500] &@
LocalAdaptiveBinarize[#, 2] &@GaussianFilter[#, 10] &@img
![enter image description here](https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot%28323%29.png&userId=2971053)
ridges = ImageAdjust[RidgeFilter[imge, 7]]
![enter image description here](https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot%28328%29.png&userId=2971053)
bin = MorphologicalBinarize[ridges, {.1, .2}]
![enter image description here](https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot%28329%29.png&userId=2971053)
dist = DistanceTransform[ColorNegate@bin];
maxMarkers = MaxDetect[dist, 10];
HighlightImage[bin, maxMarkers]
![enter image description here](https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot%28330%29.png&userId=2971053)
watersheds = WatershedComponents[ridges, maxMarkers];
Colorize[watersheds]
![enter image description here](https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot%28331%29.png&userId=2971053)