In this assignment, you will finish your lane detector using edge detection and Hough transforms. This will then make the core of your code for Lab 4. You will take in the result of Homework 7 and output new images showing the outlines of the lane markers. To do this:
Test on each image given in the sample images folder. You want your line detector to find the longest straight-line segments possible. Tune your parameters for filtering, edge detection, and Hough transform until this happens. Some tips are below. Feel free to modify any of these steps as you like as long as you get a good result and produce the desired images. You may wish to go back to prior steps and blur or erode/dilate to improve results.
Your ROS node requires input from multiple topics. There are many ways to do this. The simplest way is to store each message you receive from Homework 7 and run processing once you receive all of the inputs you expect.
Below is a Python function that will take in an image and a set of lines (the output from the cv2.houghp function) and return an image with the lines drawn on. Feel free to use this code to generate your final image for this assignment.
def output_lines(self, original_image, lines): output = np.copy(original_image) if lines is not None: for i in range(len(lines)): l = lines[i][0] cv2.line(output, (l[0],l[1]), (l[2],l[3]), (255,0,0), 2, cv2.LINE_AA) cv2.circle(output, (l[0],l[1]), 2, (0,255,0)) cv2.circle(output, (l[2],l[3]), 2, (0,0,255)) return output
When you submit your code, please include a launch file that starts ONLY your nodes, not the image_pub or rqt_image_view nodes. You may create other launch files if you wish, just be sure you specify this one in your submission.
Turn in to blackboard one PDF containing:
2 points: Submission details (tag, instructions, etc)
8 points: Correct math/algorithm for image processing
10 points: Correct output images (submitted to Blackboard and from running code)