This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import cv2 | |
import matplotlib.pyplot as plt | |
import matplotlib.image as mpimg | |
import pickle | |
# Read in an image | |
image = mpimg.imread('signs_vehicles_xygrad.png') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import matplotlib.image as mpimg | |
import numpy as np | |
import cv2 | |
# Read in an image, you can also try test1.jpg or test4.jpg | |
image = mpimg.imread('test6.jpg') | |
# Define a function that thresholds the S-channel of HLS | |
# Use exclusive lower bound (>) and inclusive upper (<=) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import cv2 | |
import matplotlib.pyplot as plt | |
import matplotlib.image as mpimg | |
image = mpimg.imread('bridge_shadow.jpg') | |
# Edit this function to create your own pipeline. | |
def pipeline(img, s_thresh=(170, 255), sx_thresh=(20, 100)): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.image as mpimg | |
import matplotlib.pyplot as plt | |
# Load our image | |
# `mpimg.imread` will load .jpg as 0-255, so normalize back to 0-1 | |
img = mpimg.imread('warped_example.jpg')/255 | |
def hist(img): | |
# TO-DO: Grab only the bottom half of the image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.image as mpimg | |
import matplotlib.pyplot as plt | |
import cv2 | |
# Load our image | |
binary_warped = mpimg.imread('warped_example.jpg') | |
def find_lane_pixels(binary_warped): | |
# Take a histogram of the bottom half of the image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
import matplotlib.image as mpimg | |
import matplotlib.pyplot as plt | |
# Load our image - this should be a new frame since last time! | |
binary_warped = mpimg.imread('warped_example.jpg') | |
# Polynomial fit values from the previous frame | |
# Make sure to grab the actual values from the previous step in your project! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def generate_data(): | |
''' | |
Generates fake data to use for calculating lane curvature. | |
In your own project, you'll ignore this function and instead | |
feed in the output of your lane detection algorithm to | |
the lane curvature calculation. | |
''' | |
# Set random seed number so results are consistent for grader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def generate_data(ym_per_pix, xm_per_pix): | |
''' | |
Generates fake data to use for calculating lane curvature. | |
In your own project, you'll ignore this function and instead | |
feed in the output of your lane detection algorithm to | |
the lane curvature calculation. | |
''' | |
# Set random seed number so results are consistent for grader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let almost_factorial = f => n => n == 0 ? 1 : n * f(n-1) | |
//This first version is not yet a combinator | |
let Y1 = f => f (x => Y1(f)(x)) | |
let factorial = (almost_factorial(x => (Y(almost_factorial)(x)))) | |
console.log(factorial(6)) | |
//720 | |
/*The strict (applicative-order) Y combinator*/ | |
let Y2 = f => (x => x(x))(x => f(y => x(x)(y))) | |
let factorial2 = Y2(almost_factorial) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Write a function 'kalman_filter' that implements a multi- | |
# dimensional Kalman Filter for the example given | |
from math import * | |
class matrix: | |
# implements basic operations of a matrix class | |