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 3. 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 tips 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. You may wish to look into message filters instead http://wiki.ros.org/message_filters Think about what to expect first/last and how often you expect messages to arrive.
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. You may wish to modify the color parameter in the lines and/or circles to make it clear which line corresponds to which color. Note that, on some screens, the code overflows onto the border of the page. Reference: https://docs.opencv.org/3.4/dc/da5/tutorial_py_drawing_functions.html
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 as described above.. You may create other launch files if you wish, just be sure you specify this one in your submission.
Complete the survey to answer the following:
8 points: Submission details (tag, instructions, launcher, etc)
12 points: Correct math/algorithm for image processing
20 points: Correct output images