From the pictures of the road I extracts the part where the lane is present. Then, the part is clarified in color and synthesized with the original photograph to recognize the lane. And apply the result to video of the car
- mpimg.imread()
- cv2.cvtColor(image,cv2.COLOR_RGB2GRAY), cv2.GaussianBlur(gray,(kernel_size, kernel_size),0)
- cv2.Canny(blur_gray, low_threshold, high_threshold)
The rate of change with respect to the color of the pixel becomes larger at the boundary value of the object of the photograph. Pixels smaller than the minimum threshold of this rate of change are removed and pixels between the highest threshold and the lowest threshold are alive if they are associated with pixels above the highest threshold.
Now that an area where the lane is present in the picture is constant, Remove other pixels except the area.
- cv2.fillPoly(mask, vertices, ignore_mask_color)
Detect lines on the image through the hough transform to fill the lines with color and plot the lines in blank image
- cv2.HoughLinesP(masked_edges, rho, theta, threshold, np.array([]), min_line_length, max_line_gap)
- cv2.addWeighted(line_image, 1, image, 1, 0)