Q2.3 The Hough transform (20 points) Write a function that applies the Hough Transform to an edge magnitude image. Dis-

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Q2.3 The Hough transform (20 points) Write a function that applies the Hough Transform to an edge magnitude image. Dis-

Post by answerhappygod »

Q2 3 The Hough Transform 20 Points Write A Function That Applies The Hough Transform To An Edge Magnitude Image Dis 1
Q2 3 The Hough Transform 20 Points Write A Function That Applies The Hough Transform To An Edge Magnitude Image Dis 1 (95.78 KiB) Viewed 36 times
I need running MATLAB code for this Hough transform. I cannot use the hough function in Matlab.
Will also need an explanation to how it works.
Q2.3 The Hough transform (20 points) Write a function that applies the Hough Transform to an edge magnitude image. Dis- play the output for one of the images in the write-up. function [H, rhoScale, thetaScale] = myHoughTransform (Im, threshold, rhoRes, thetaRes) Im is the edge magnitude image, threshold (scalar) is a edge strength threshold used to ignore pixels with a low edge filter response. rhoRes (scalar) and thetaRes (scalar) are 4 the resolution of the Hough transform accumulator along the p and axes respectively. H is the Hough transform accumulator that contains the number of "votes" for all the possible lines passing through the image. rhoScale and thetaScale are the arrays of p and values over which myHoughTransform generates the Hough transform matrix H. For example, if rhoScale(i) = p; and thetaScale (j) = 0₁, then H(i, j) contains the votes for p = P₁ and 0 = 0₁. First, threshold the edge image. Each pixel (x, y) above the threshold is a possible point on a line and votes in the Hough transform for all the lines it could be a part of. Parametrize lines in terms of and p such that p = r cos 0 + y sin 0, 0 € [0, 2π] and p = [0, M]. M should be large enough to accommodate all lines that could lie in an image. Each line in the image corresponds to a unique pair (p, 0) in this range. Therefore, values corresponding to negative p values are invalid, and you should not count those votes. The accumulator resolution needs to be selected carefully. If the resolution is set too low, the estimated line parameters might be inaccurate. If resolution is too high, run time will increase and votes for one line might get split into multiple cells in the array. Your code cannot call Matlab's hough function, or any other similar functions. You may use hough for comparison and debugging. A sample visualization of H is shown in Figure 2.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply