Skip to content

Latest commit

 

History

History
60 lines (33 loc) · 3.34 KB

Writeup.md

File metadata and controls

60 lines (33 loc) · 3.34 KB

Udacity SDCND Project_1 : Finding lane lines on the Road

In this project, Use computer vision technology to find lane lines in the picture


Process

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


Details (soildWhiteRight soildYellowLeft)

First, include library to deal with mathematical operation and receive image

  • mpimg.imread()

screenshot from 2018-03-23 14-08-00 screenshot from 2018-03-23 14-41-06

And make the image gry_color then use the Gaussian function to smooth the wrong pixels in the image

  • cv2.cvtColor(image,cv2.COLOR_RGB2GRAY), cv2.GaussianBlur(gray,(kernel_size, kernel_size),0)

screenshot from 2018-03-23 14-08-25 screenshot from 2018-03-23 14-39-19

Use a candy effect to select boundaries on the photo.

  • 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.

screenshot from 2018-03-23 14-12-16 screenshot from 2018-03-23 14-39-29

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)

screenshot from 2018-03-23 14-12-37 screenshot from 2018-03-23 14-39-44

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)

screenshot from 2018-03-23 14-12-49 screenshot from 2018-03-23 14-39-53

The last process is to combine original image and detected lines

  • cv2.addWeighted(line_image, 1, image, 1, 0)

screenshot from 2018-03-23 14-13-00 screenshot from 2018-03-23 14-40-02