Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(15 points) Q2.4 Finding lines Write a function that uses the Hough transform output to detect lines, function (rhos, thetas) = my Houghlines (H, nLines)
(15 points) Q2.4 Finding lines Write a function that uses the Hough transform output to detect lines, function (rhos, thetas) = my Houghlines (H, nLines) where H is the Hough transform accumulator, and nLines is the mamber of lines to return. Outputs Thos and the tas are both nLinesxl vectors that contain the row and column coordinates of peaks in H, that is, the lines found in the image. Ideally, you would want this function to retum the p and 8 coordinates for the nLines highest scoring cells in the Hough accumulator. But for every cell in the accumula corresponding to a real line likely to be a locally maximal value), there will probably be a number of cells in the neighborhood that also scored high but should not be selected These non maximal neighbors can be removed using non maximal suppression. Note that this non maximal suppression step is different from the one performed earlier. Here you will consider all neighbors of a pixel, not just the pixels lying along the gradient direction. You can either implement your own non maximal suppression code or find a suitable function on the Internet (you must acknowledge and cite the source in your write-up, as well as hand in the source in your matlab/directory). Another option is to se Matlab function indilate. Once you have suppressed the non maximal cells in the Hough accumulator, retum the coordinates corresponding to the strongest peaks in the accumulator Your code can not call on Matlab's houghpeaks function or other similar functions. You may tase houghpeaks for comparison and debugging, (15 points) Q2.4 Finding lines Write a function that uses the Hough transform output to detect lines, function (rhos, thetas) = my Houghlines (H, nLines) where H is the Hough transform accumulator, and nLines is the mamber of lines to return. Outputs Thos and the tas are both nLinesxl vectors that contain the row and column coordinates of peaks in H, that is, the lines found in the image. Ideally, you would want this function to retum the p and 8 coordinates for the nLines highest scoring cells in the Hough accumulator. But for every cell in the accumula corresponding to a real line likely to be a locally maximal value), there will probably be a number of cells in the neighborhood that also scored high but should not be selected These non maximal neighbors can be removed using non maximal suppression. Note that this non maximal suppression step is different from the one performed earlier. Here you will consider all neighbors of a pixel, not just the pixels lying along the gradient direction. You can either implement your own non maximal suppression code or find a suitable function on the Internet (you must acknowledge and cite the source in your write-up, as well as hand in the source in your matlab/directory). Another option is to se Matlab function indilate. Once you have suppressed the non maximal cells in the Hough accumulator, retum the coordinates corresponding to the strongest peaks in the accumulator Your code can not call on Matlab's houghpeaks function or other similar functions. You may tase houghpeaks for comparison and debugging
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started