Skip to content

Instantly share code, notes, and snippets.

@mithi
Last active August 28, 2020 00:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mithi/86aacebe97224eae8d82075d64671e1e to your computer and use it in GitHub Desktop.
Save mithi/86aacebe97224eae8d82075d64671e1e to your computer and use it in GitHub Desktop.
curves = Curves(number_of_windows = 9, margin = 100, minimum_pixels = 50,
ym_per_pix = 30 / 720 , xm_per_pix = 3.7 / 700)
undistorted_image = birdsEye.undistort(image)
binary = laneFilter.apply(undistorted_image)
lane_pixels = np.logical_and(birdsEye.sky_view(binary), roi(binary)).astype(np.uint8)
result = curves.fit(lane_pixels)
print("[real world] left best-fit curve parameters:", result['real_left_best_fit_curve'])
print("[real world] right best-fit curve parameters:", result['real_right_best_fit_curve'])
print("[pixel] left best-fit curve parameters:", result['pixel_left_best_fit_curve'])
print("[pixel] right best-fit curve parameters:", result['pixel_right_best_fit_curve'])
print("[left] current radius of curvature:", result['left_radius'], "m")
print("[right] current radius of curvature:", result['right_radius'], "m")
print("vehicle position:", result['vehicle_position_words'])
plt.imshow(result['image'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment