30 Jul 2020

Hough Circle Fitting

Generalized Hough transform to fit circles to the image.

2020-04-05 13_41_52-Xtras4-RP-Python_HoughCircleFitting

Steps for Circle fitting:

1: Drag and drop the Hough_circle_fitting.pyscro into Avizo/Amira

2: Inputs are as follows: (parameters used for the demo volume 'grain.am' when 'HoughCircleFitting.hx' is loaded are given below in '()')
    a: GrayScale Image : Any 2D or 3D grayscale image/volume 
    b: minimum radius (1)
    c: maximum radius of the circles to be fitted in pixels (5) 
    d: step size to allow for a range of circles to detect (1) 
    e: A maximum number of circles will also need to be specified (100) 
    f: Sigma parameter for Canny edge detector (1)

3: Use given project 'HoughCircleFitting.hx' or one's own dataset

4: Press apply to run and the outputs will be the following:

    a: Circle_mask (8-bit label volume/image) - with the edges of the circles that were fitted to the image as '1' and the rest of the voxels/pixels as '0'
    b: Circle_filled_mask (8-bit label volume/image) - with filled spheres of the above output

Note : 
The distance of separation between circles of different radii works 'per radius'. The recommendation to avoid overlapping circles is to use a smaller range of min-max and run repeatedly instead of using a large range. For instance, instead of min_radius =5 to max_radius=15, it better to run min_radius = 5 to max_radius =7 and in another run min_radius =  9 to max_radius =11 to get the best results.


Parameters used in the Avizo project:
min_radius = 5
max_radius = 7
radius step size = 1

Dataset provided with the pack-and-go object
maximum number of circles = 50
Canny detector sigma parameter =1