Problem Set 2.3
Topic: Computer Vision – Hough Transformation
Free Response Questions (8 pts):
Please write your solutions on a piece of paper. Then, you can scan your solution. You can also use LeTeX to write your solution. If you have anything that you don’t understand, please ask for help or review the slides again.
1. (3 pts) Why the Hough transformation need to use polar system rather than use slope and intercept expression? Please relate the slope and intercept with the parameter of . Make sure you can get ρ = xcosθ+ysinθ after plug your answers into y = kx + b.
Your solution:
2. (2pts) Here’s very simple question: What’s the range of the value and for a point in Hough space where . is the width of the image, and is the height of the image.
Your solution:
3. (3pts) In polar system, a image point that passed the line ρ = xcosθ+ysinθ can be expressed as a sinusoid curves ρ = ∗ (sin(θ+ α)) in the Hough space. Please prove this formula.
Hint:
1) You can use to divide the ρ = xcosθ+ysinθ.
2) sin(α)∗cos(θ)+cos(α)∗sin(θ) = sin(α+θ)
Programming Problems (4 pts):
1. Draw the Hough transformation for the point (2,5), (3,10), and (8,35). Please visualize their intersections. What is the (m,c) for this line? You should use Python to plot the curves and submit your code in Teams. Please use three colors to draw the curves.
Result:
Hint:
You need to use pip to install the matplotlib and numpy. Here’s a sample code to demonstrate how to draw the function y = x^2.
import matplotlib.pyplot as plt
import numpy as np
# 100 linearly spaced numbers
x = np.linspace(-5,5,100)
# the function, which is y = x^2 here
y = x**2
fig = plt.figure()
# plot the function
plt.plot(x,y, ‘r’)
# show the plot
plt.show()
Bonus:
1. (2pts) Upload the lane detection algorithm you’ve done in the class. Please include the comments of your code.