My current problem:

  • I have an input 3D binary image (a 3D matrix that has only 0 and 1) that consists of random numbers of sphere with radius r.
  • We do not know how many spheres are there in the image.
  • All spheres have the same radius r, but we do not know radius r.
  • Spheres are all over the place in the image and can overlap each other.
  • example image is given below.

My requirement:

  • what is the radius r?

Currently, I simply just flatten the image to get rid of the z axis and perform edge detection and I am trying Hough Transform using: http://rsbweb.nih.gov/ij/plugins/hough-circles.html

However, with Hough Transform, I see that the variables minimum radius, maximum radius, and number of circles have to be specified. I have tried a few attempts below:

known radius

unknown radius

Given the correct parameters, Hough Transform can detect the circles just fine. But in the real application, I do not know how many spheres are there, and making the program attempting to guess minimum and maximum radius seems not feasible. Are there other ways to accomplish this?

Cross-link: https://stackoverflow.com/questions/9653291/finding-radius-r-of-the-overlappable-spheres-in-3d-image

  • $\begingroup$ You don't need to know radius of the circles in advance to perform the Hough circle transform; the radius just becomes another dimension of the parameter space. See cis.rit.edu/class/simg782/lectures/lecture_10/lec782_05_10.pdf ...In your volume data, you can do a 3D analogue of edge detection, and the Hough parameter space will be 4-dimensional: three parameters for the position of the center of the sphere, and one parameter for its radius. $\endgroup$ – Rahul Mar 11 '12 at 8:09
  • $\begingroup$ In theory, it suffices to analyze a small arc of a circle, since the curvature uniquely determines the radius. However, you might also imagine that you have all circles that are tangent to a given point. The resulting figure is a circle with double the radius that you seek, so in extreme cases, the problem is unsolvable. $\endgroup$ – Per Alexandersson Mar 11 '12 at 8:11

A simpler solution and much more computationally efficient when compared to Hough Transform is to use the distance transform:

  • Find the surface of your spheres (i.e. the pixels that have value 1 and have at least one neighboring 0 pixel);
  • Compute the distance transform with respect to the spheres surface, but constrain the computation only to pixels that are internal to the spheres. The output will be a distance map;
  • The radius will be exactly the maximum value in your distance map.

Another advantage of this solution when compared to Hough transform is that it provides a much more precise value for the radius.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.