2. 今日の流れーTopics
1.Goal of Line Detection, difference with Edge Detection
2.Successive Approximation Method
3.Hough Transform Method
4.RANSAC(Random Sample Consensus) Method
5.Vanishing Point Detection using Hough Transform
6.Applications-Rectangle Detection
2
3. 1. Goal of Line Detection
In image processing, line detection is an algorithm that takes
a collection of n edge points and finds all the lines on which
these edge points lie.
The most popular line detectors are the Hough
transform and convolution-based techniques.
Convolution-based Line Detection:
Same process as for Edge Detection.
3
4. 1. Difference with Edge Detection
An edge is a transition from one phase/object/thing to
another. On one side you have one color, on the other side you
have another color.
A line is a 1D structure. It has the same phase/object/thing
on either side. On one side you have background, on the other
side you have background also.
→Better techniques can better differentiate between these.
4
5. 2.Successive Approximation Method
5
• Transforming from a curve-contour to a simpler
representation (to Piecewise-linear polyline or B-spline curve)
• Algorithm: Mark the first and last point. Find the farthest inlier
from this line and join First and this point. Now remove the
farthest inlier to this line.
• If contour is a line (with noise) we can simplify it to that line.
6. 3.Hough Transform Basics
6
Consider a line-to-point transform, that transforms
the data from x,y space to m,h space, where each
line is transformed to a point.
Problem: neither m or h are bounded, so that Line k
to x axis ⇒ h not defined Line k to y axis ⇒ m → ∞
7. 3.Polar Hough Transform
7
Now the problem is solved,
as both variables are bounded!
→ Polar Hough Transform:
Where f(x,y) is the image, and (r-xcosθ-ysinθ) represents
any arbitrary line in polar form.
→ Unit Sphere & Cubemap Hough Mappings possible(pg. 253)
8. 3.Polar Hough Transform – Theoretical Example
8Output in the case of perfectly continuous lines.
9. 3.Hough Transform for Line Detection
9
→ Goal: To identify straight lines
• Process: For each pixel at (x,y) the Polar Hough transform
algorithm determines if there is enough evidence of a straight
line at that pixel, using votes from sample points.
→ Strengths:
• Gives equations of lines (but not “end-points” of segments).
• Works well with simple images that contain good straight lines.
(Good for Robot Vision)
• Deal with broken lines very well.
• Reasonably efficient if there are “few” edge points.
11. 3.Polar Hough Transform – Discrete case
11
Same as before, but discrete. Number in Accumulator cell
proportional to number of points on the line.
12. 3.Hough Transform for Line Detection
12
→ Problems:
• Very slow of there are many edge points.
• Hough Space is non-linear, different edge sensitivities in
different directions.
• Poor for short lines.
→ Recent Extensions of Hough Method:
• Circle and Ellipse detection by Double Hough Method.
• Image transform plus Hough for general 2D shape detection.
• Vanishing Points Detection(section 4.3.3, part 5 of presentation)
13. 4.RANSAC(Random Sample Consensus) Method
– (For Feature Detection)
13
• Determines the best transformation that includes the most
number of match features (inliers) from the previous step.
• RANSAC loop for planar pattern detection:
1. Select four feature pairs (at random) in the two angles.
2. Compute homography H (see next slide).
3. Compute inliers where SSD(pi’, Hpi) < a certain value,ε.
4. Keep largest set of inliers.
5. Re-compute least-squares estimate on all of the inliers.
14. 4.RANSAC Method – What are Homographies?
14
• Example of Homography
• Projective–mapping between any two
projection planes with the same center of
projection called Homography
15. 4.RANSAC Method – (For Line Detection)
15
→ Simple example: Let us fit a line
• Use biggest set of inliers
• Do least-square fit => SD is low, Very likely it is a line
16. 4.RANSAC Method – Video: Fitting a Line
16
→ Strengths:
• Robust estimation
• Relatively high accuracy
→ Problems:
• Randomness.
• Number of Iterations
required for p% success
17. 5.Vanishing Points Detection – using Hough Transform
17
→ Goal: To collect lost 3D information from perspective in a 2D
image detecting Vanishing points of Parallel lines.
18. 5.Vanishing Points Detection – using Hough Transform
18
→ Textbook method using Cross Product:
Step 1) Calculate Vanishing Point Hypothesis (weight)
= Cross product of any two line vectors=
Near-Collinear segments downweighted
Step 2) Populate Hough space(accumulator) with weights
and find peaks for Vanishing point votes from the lines.
Step 3) Calculate Least Squares Estimate for all Vanishing
points with respect to lines that voted for it.
19. 5.Vanishing Points Detection – using Hough Transform
19
where = Green Triangle area
Rule: The lower the sum of all areas subtended to segment
endpoints, the more appropriate the vanishing point.
20. 6.Applications
20
Rectangle Detection:
Step 1) First, detect all vanishing points
Step 2) Detect the Edge points/Lines that are aligned along
vanishing lines.
We then efficiently recover the inter-sections of pairs of lines
corresponding to different vanishing points. (論文[8]の方法)
21. 6.Applications
21
Rectangle Detection:
Using only Hough Detection
is an 8 dimensional vector-
space problem (論文[8])
Major Quadrilaterals in
image can be detected
using only Vanishing Point
and Line Detection(論文[8]).