Finding Lines in Images 12152021 Finding Lines Hough

  • Slides: 15
Download presentation
Finding Lines in Images 12/15/2021 Finding Lines - Hough Transform 1

Finding Lines in Images 12/15/2021 Finding Lines - Hough Transform 1

References [1] Gonzalez and Woods – Section 10. 2 12/15/2021 Finding Lines - Hough

References [1] Gonzalez and Woods – Section 10. 2 12/15/2021 Finding Lines - Hough Transform 2

Problem Statement • Many objects in images are bounded by lines. – Lines of

Problem Statement • Many objects in images are bounded by lines. – Lines of communication • Roads and rivers • Cables – Many man-made objects • Buildings • Vehicles • To isolate and identify the objects, it is necessary to find the lines. • Often this step is run after the segmentation step. • Can this be extended to other shapes? 12/15/2021 Finding Lines - Hough Transform 3

What is needed? • Typically, the images have been converted to B&W. • Any

What is needed? • Typically, the images have been converted to B&W. • Any two points can be connected with a line. – Many lines are possible. – How does one select the lines of interest. – Look for some dominance characteristic. • Several points per line. • Use curve fitting? 12/15/2021 Finding Lines - Hough Transform 4

Example Image: Lines From [1] 12/15/2021 Finding Lines - Hough Transform 5

Example Image: Lines From [1] 12/15/2021 Finding Lines - Hough Transform 5

Curve Fitting • Several (x, y) values (points). • Have a hypothesis: y =

Curve Fitting • Several (x, y) values (points). • Have a hypothesis: y = f(x) is a good model. • Test the hypothesis. – Objective function. • Sum of square of errors. • Maximum error. – Measure goodness. • Reformulate hypothesis. 12/15/2021 Finding Lines - Hough Transform 6

Hough Transform • Parameterize the decision process. • Every line is characterized by y

Hough Transform • Parameterize the decision process. • Every line is characterized by y = ax + b – The objective then is to find a, b such that a number of points lie on this line. • Transform this problem to the a, b domain. b = y – ax – (x, y) are point coordinates – Often called parameter space. • Consequence: – Say 2 points lie on the same line. – In parameter space each point corresponds to a line. – The lines will intersect, at the (a, b) value!!! 12/15/2021 Finding Lines - Hough Transform 7

From [1] 12/15/2021 Finding Lines - Hough Transform 8

From [1] 12/15/2021 Finding Lines - Hough Transform 8

Multiple points per line • Recall we used several points per line as the

Multiple points per line • Recall we used several points per line as the means of deciding is this was a useful feature. • How do we know if there are enough points on the line? • What if the points are little off? – Motivation similar to computing Sum of the Square of the Errors. 12/15/2021 Finding Lines - Hough Transform 9

Parameter Space Subdivisions • Makes Hough computationally efficient. • For each point find the

Parameter Space Subdivisions • Makes Hough computationally efficient. • For each point find the allowable (a, b) and insert in respective cell. • Solves both the problems on the previous slide!! From [1] 12/15/2021 Finding Lines - Hough Transform 10

Near Vertical Lines • y = ax + b • For near vertical lines,

Near Vertical Lines • y = ax + b • For near vertical lines, the slope approaches infinity. • What about the parameter space? • So this representation is a problem for near vertical lines. • Lets try a normal representation for a line. 12/15/2021 Finding Lines - Hough Transform 11

Normal Representation of a Line • x cos + y sin = • is

Normal Representation of a Line • x cos + y sin = • is the length of the normal from the origin to the line • is the angle between the normal and x-axis 12/15/2021 Finding Lines - Hough Transform 12

Normal Representation of a Line From [1] 12/15/2021 Finding Lines - Hough Transform 13

Normal Representation of a Line From [1] 12/15/2021 Finding Lines - Hough Transform 13

Hough Transform in Normal Representation From [1] 12/15/2021 Finding Lines - Hough Transform 14

Hough Transform in Normal Representation From [1] 12/15/2021 Finding Lines - Hough Transform 14

Review of Approach • Convert from image space to parameter space. • It is

Review of Approach • Convert from image space to parameter space. • It is easier to search in the parameter space. • Can we generalize? – If the curve has more than 2 parameters, then one has to search a higher dimensional space. – Increases computational complexity. 12/15/2021 Finding Lines - Hough Transform 15