Randomized Hough transform: Difference between revisions

Content deleted Content added
Adding a wikilink, fixing style/layout errors
Line 16:
with restriction: <math>ac-b^2>0</math>
 
However, an ellipse can be fully determined if one knows three points on it and the tangents[[tangent]]s in these points.
 
RHT starts by randomly selecting three points on the ellipse. Let them be X<submath>1X_1</submath>, X<submath>2X_2</submath> and X<submath>3X_3</submath>. The first step is to find the tangents of these three points. They can be found by fitting a straight line using [[least squares]] technique for a small window of neighboring pixels.
 
The next step is to find the intersection points of the tangent lines. This can be easily done by solving the line equations found in the previous step. Then let the intersection points be T<submath>T_{12}</submath> and T<submath>T_{23}</submath>, the midpoints of line segments <math>X_1X_2</math> and <math>X_2X_3</math> be M<submath>M_{12}</submath> and M<submath>M_{23}</submath>. Then the center of the ellipse will lie in the intersection of <math>T_{12}M_{12}</math> and <math>T_{23}M_{23}</math>. Again, the coordinates of the intersected point can be determined by solving line equations and the detailed process is skipped here for conciseness.
 
Let the coordinates of ellipse center found in previous step be (x<sub>0</submath>(x_0, y<sub>0y_0)</submath>). Then the center can be translated to the origin with <math>x' = x-x_0</math> and <math>y' = y-y_0</math> so that the ellipse equation can be simplified to:
 
<math>ax'^2+2bx'y'+cy'^2=1</math>
 
Now we can solve for the rest of ellipse parameters: <math>a</math>, <math>b</math> and <math>c</math> by substituting the coordinates of X<submath>1X_1</submath>, X<submath>2X_2</submath> and X<submath>3X_3</submath> into the equation above.
 
===Accumulating===