Solved CS766 Homework 3 Computer Vision, Spring 2026

$30.00

Original Work ?

Download Details:

  • Name: Homework3-6pbpgq.zip
  • Type: zip
  • Size: 2.95 MB

Category: Tags: , , , You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (1 vote)

Challenge 1: Your task is to develop a vision system that recognizes lines in an
image using the Hough Transform. We will call it the “line finder.” Test your line
finder on these three images: hough_1.png, hough_2.png and hough_3.png.
The line finder pipeline is divided into four sub-parts, each corresponding to a
program you need to write and submit.
a. First, you need to find the edge pixels in the image. You may use the
skimage.feature.canny function from package scikit-image to generate an
edge image from the input gray-level image. Fill in the test case
challenge1a to generate edge images. (2 points)
b. Next, you need to implement the Hough Transform for line detection.
hough_accumulator = generateHoughAccumulator(edge_img,
theta_num_bins, rho_number_bins)
2
As discussed in class, the line equation 𝑦 = 𝑚𝑥 + 𝑐 is not suitable, as it
requires a huge accumulator array. So, use the equation 𝑥𝑠𝑖𝑛(𝜃) − 𝑦𝑐𝑜𝑠(𝜃) +
𝜌 = 0.
Be careful while choosing the range of possible 𝜃 and 𝜌 values and the
number of bins for the accumulator array. A low resolution will not give you
sufficient accuracy in the estimated parameters. On the other hand, a very
high resolution will increase computations and reduces the number of votes
in each bin. If you get bad results, you may want to vote for small patch of
bins rather than a single bin in the accumulator array. After voting, scale the
values of the accumulator so that they lie between 0 and 255 and return the
resulting accumulator. In the README, write down what voting scheme you
used (and why). (6 points)
Functions not allowed: hough_lines(), hough_line_peaks()
c. To find “strong” lines in the image, scan through the accumulator array
looking for peaks. You can either use a standard threshold to find the peaks
or use a smarter method. Briefly explain the method you used to find the
peaks in your README. You can assign zero to hough_threshold if you did
not use the standard threshold method. After having detected the peaks that
correspond to lines, draw the detected lines on a copy of the original image
(using the Matplotlib Axes.plot() function). Make sure you draw the line
using a color that is clearly visible in the output image.
line_detected_img = lineFinder(original_img,
hough_accumulator,
hough_threshold)
Function not allowed: houghpeaks
(6 points)
d. Note that the above implementation does not detect the end-points of line
segments in the image. Implement an algorithm that prunes the detected
lines so that they correspond to the line segments from the original image
(i.e., not infinite). Briefly explain your algorithm in the README. Again, you
can assign zero to hough_threshold if you did not use the standard
threshold method.
line_segment_detected_img
= lineSegmentFinder(original_img,
hough_accumulator,
hough_threshold)
3
Function not allowed: hough_lines(), hough_line_peaks().
(6 points)