10
u/Naifme Jan 04 '20
Have you tried Hough transform algorithm to detect the circle??
2
u/YetAnotherDaveAgain Jan 04 '20
I think you'd need to find a good threshold first, right? Or use sobel or canny to generate outlines THEN Hough?
1
u/Naifme Jan 05 '20
GreyScale image then apply the Hough circles... More info in the link below....
https://www.google.com/amp/s/www.learnopencv.com/hough-transform-with-opencv-c-python/amp/
1
1
u/TheDuke57 Jan 04 '20
Hough circle would probably work awesome here. Especially because they are only looking for the radius which it directly returns
3
u/VickyElango Jan 04 '20
You could also give BLOB detecting a try as it allows you define various parameters such as concavity which would be really important judging from the shape of the cells in your image. Further BLOB detector can also detect clusters.
1
u/alkasm Jan 05 '20
Neither of these answers are directly applicable, but still reading through them may give some good ideas: counting small circles in an image and irregular shape detection and measurement
1
u/BAHHROO Jan 25 '20
Checkout Fiji. I use to use it for quantifying ferrite grains in steel and other image post processing.
1
1
u/gdavtor Jan 04 '20 edited Jan 04 '20
Here is a non object detecting solution:
Threshold the image using adaptive thresholding to isolate the contours of the circles. Then take horizontal (or vertical) slices and record the 'secant' lengths of each circle on that slice (i.e. the length of the gaps between contours touching that slice). This creates a distribution of secant lengths of circles, call it h(x). Such a distribution is a convolution of the distribution of diameters (maximal secants) d(x) with the equation for a circle c(x). Then taking the (discrete) Fourier transform of h(x) will produce the product of the Fourier transforms of c(x) and d(x). The former we know, so we can determine d(x) by dividing and taking the inverse Fourier transform. The distribution d(x) is the one you seek.
Caveat: I typed this as I went to sleep and didn't verify the math. But I think this could work.
EDIT: c(x) is not the equation for a circle; it is the heaviside step function. This actually makes the calculation simpler. The result is: https://i.imgur.com/i2c6n8a.jpg Where F is the Fourier transform
4
u/morifo Jan 04 '20
Hi all, happy new year.
I've got a microscopic image of some spherical shapes, all I need is to produce a histogram with the diameters of each. I started off by using canny edge detection for this image, but given the sheer number of spheres that fill the gaps between the larger ones, hence the lack of empty space, canny is spitting out spaghetti images.
I envisage that I ought to loop over all possible sizes of sphere (circle/oval) and impose a closed loop over each. Any direction would be greatly appreciated. I've attached a part of the image as an example.
Cheers!