码迷,mamicode.com
首页 > 其他好文 > 详细

CarND Project - Advanced Lane Finding

时间:2017-08-24 10:38:58      阅读:349      评论:0      收藏:0      [点我收藏+]

标签:die   rspec   tin   ati   apply   camera   term   uda   mod   

(Udacity Learning Note: CarND-Term1 Project 4)

Camera Calibration & Distortion Correction

Two Types of Distortion

  • Radial Distortion
  • Tangential Distortion

Using OpenCV

Example

  • Finding chessboard corners (for an 8x6 board):
ret, corners = cv2.findChessboardCorners(gray, (8,6), None)
  • Drawing detected corners on an image:
img = cv2.drawChessboardCorners(img, (8,6), corners, ret)
  • Camera calibration, given object points, image points, and the shape of the grayscale image:
ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(objpoints, imgpoints, gray.shape[:-1], None, None)
  • Undistorting a test image:
dst = cv2.undistort(img, mtx, dist, None, mtx)

Perspective Transform

Commonly Used View

  • Front-facing View (Normal View)
  • Top-down View (Bird-eye View)

Why?

  • Because ultimately we want to measure the curvature of the lines, and to do that, we need to transform to a top-down view.

Apply Perpective Transform using OpenCV

  • Compute the perspective transform, M, given source and destination points:
  M = cv2.getPerspectiveTransform(src, dst)
  • Compute the inverse perspective transform:
  Minv = cv2.getPerspectiveTransform(dst, src)
  • Warp an image using the perspective transform, M: (warp v. 扭曲)
  warped = cv2.warpPerspective(img, M, img_size, flags=cv2.INTER_LINEAR)

Gradient Threshold

 

CarND Project - Advanced Lane Finding

标签:die   rspec   tin   ati   apply   camera   term   uda   mod   

原文地址:http://www.cnblogs.com/casperwin/p/7421107.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!