Implementation of Randomized Hough Ellipse Transform. This repository refers to the publication [1].
Multithreading version: RHET
[1]. Inverso, Samuel. "Ellipse detection using randomized Hough transform."
Final Project: introduction to computer vision (2002): 4005-4757.
- Noise reduction
- Gradient calculation
- Non-maximum suppression
- Double threshold
Use random.sample() to select three points; then, find the parameter of ellipse as a candidate by these points.
- Determine the equation of the line for each point where the line’s slope is the gradient at the point.
- Determine the intersection of the tangents passing throughpoint pairs (X1,X2) and (X2,X3).
- Calculate the bisector of the tangent intersection points. Thisis a line from the tangent’s intersection,t, to the midpoint of the twopoints,m.
- Find the bisectors intersection to give the ellipse’s center,O
- Shift the ellipse to origin. (Shift center (p, q) to (0, 0))
- Solve ellipse equation with the three points
- The sign of 4AC−B^2 determines the type of conic section:
- positive --> Ellipse or Circle
- zero --> Parabola
- negative --> Hyperbola
- ellipse out of image
- semi major axis bound
- semi minor axis bound
- flattening bound (customized)
- nucleus-cell ratio bound (customized)
- voting
- select the best result
n = 337, time = 2.67 sec
n = 439, time = 5.1 sec
n = 644, time = 15.3 sec
time complexity: linear
n = 337, time = 0.7 sec
n = 439, time = 1.1 sec
n = 644, time = 1.5 sec