lesson_functions module

This module contains procedures provide in the “Udacity Self-Driving Car Engineer Nanodegree” lecture notes. Some modifications were made. https://www.udacity.com/course/self-driving-car-engineer-nanodegree–nd013

class lesson_functions.Log[source]

Bases: object

class lesson_functions.Params[source]

Bases: object

lesson_functions.add_heat(heatmap, bbox_list)[source]

Iterate through list of bboxes

lesson_functions.apply_threshold(heatmap, threshold)[source]

Zero out pixels below the threshold

lesson_functions.bin_spatial(img, size=(32, 32))[source]

Define a function to compute binned color features

lesson_functions.color_hist(img, nbins=32, bins_range=(0, 256))[source]

Define a function to compute color histogram features

lesson_functions.colorspace(image, color_space)[source]
lesson_functions.convert_color(img, conv='RGB2YCrCb')[source]
lesson_functions.detect_cars_in_image(image, svc, X_scaler, color_space='RGB', orient=9, pix_per_cell=8, cell_per_block=2, channel=0, spatial_size=(16, 16), hist_bins=16, spatial_feat=True, hist_feat=True, hog_feat=True, y_start_stop=[400, 650], xy_windows=[(64, 64)])[source]
lesson_functions.draw_boxes(img, bboxes, color=(0, 0, 255), thick=6)[source]

Define a function to draw bounding boxes

lesson_functions.draw_labeled_bboxes(img, labels)[source]

Iterate through all detected cars

lesson_functions.extract_features(imgs, color_space='RGB', spatial_size=(32, 32), hist_bins=32, orient=9, pix_per_cell=8, cell_per_block=2, channel=0, spatial_feat=True, hist_feat=True, hog_feat=True)[source]

Define a function to extract features from a list of images

lesson_functions.find_cars(img, svc, X_scaler, ystart=400, ystop=650, scale=1, spatial_size=(32, 32), hist_bins=32, orient=9, pix_per_cell=8, cell_per_block=2)[source]
lesson_functions.get_hog_features(img, orient, pix_per_cell, cell_per_block, vis=False, feature_vec=True)[source]

Define a function to return HOG features and visualization

lesson_functions.heat_map(image, box_list, threshold=1)[source]

Create a heat map based box list and threshold

lesson_functions.search_windows(img, windows, clf, scaler, color_space='RGB', spatial_size=(32, 32), hist_bins=32, hist_range=(0, 256), orient=9, pix_per_cell=8, cell_per_block=2, channel=0, spatial_feat=True, hist_feat=True, hog_feat=True)[source]

Define a function you will pass an image and the list of windows to be searched (output of slide_windows())

lesson_functions.single_img_features(img, color_space='RGB', spatial_size=(32, 32), hist_bins=32, orient=9, pix_per_cell=8, cell_per_block=2, channel=0, spatial_feat=True, hist_feat=True, hog_feat=True)[source]

Define a function to extract features from a single image window This function is very similar to extract_features() just for a single image rather than list of images

lesson_functions.slide_window(img, x_start_stop=[None, None], y_start_stop=[None, None], xy_window=(64, 64), xy_overlap=(0.75, 0.75))[source]

Define a function that takes an image, start and stop positions in both x and y, window size (x and y dimensions), and overlap fraction (for both x and y)

lesson_functions.train_svm(cars, notcars, color_space='RGB', orient=9, pix_per_cell=8, cell_per_block=2, channel=0, spatial_size=(16, 16), hist_bins=16, spatial_feat=True, hist_feat=True, hog_feat=True)[source]