Giter Site home page Giter Site logo

vehicle-detection's Introduction

Vehicle Detection

Prject Goals

The primary goals of this project are to:

  1. Extract HOG features from test images for input into a classifier.

  2. develop a classifier to detect presence of vehicle

  3. Use a sliding window technique to scan through the image for the purpose of detecting a car

  4. Combine the sliding window and classifier for decting and locating vehicles

  5. Implement this in a video steam and use the previous frames reduce false positives

Data exploration

cell-4 in jupyter notebook: Firstly, I used the data provided far, left, middle_close, right point of view of cars additionally I have also used the images from KITTI. Here are the sample images randomly chooses from these sources

alt text

I used the get hog features cell-5 function using skimage library

from skimage.feature import hog

after extracting the hog features the image looks as follows

alt text

I also visualized the non car images that are used to train the classifier; after extracting the hog features we have the following

alt text

Exploring the color space and other parameters

I then started exploring the color space and other parameters such as: number of orientatons, pixels per cell, number fo cells perblock, hog channels and used a SVM classifier to make predictions. The case where there is resonable test accuracy is the classifier that I have used for making vehicle detection in video.

Here are some sample resutls cells(9 - 28):

Case Colorspace Number of orientations Pixels Per Cell Cells Per Block HOG Channels SVM Classifier Test Accuracy (%)
1 RGB 9 8 2 ALL 97.18
2 HSV 9 8 2 ALL 98.11
3 LUV 9 8 2 ALL 97.55
4 HLS 9 8 2 ALL 98.76
5 YCrCb 9 8 2 ALL 98.25
6 YUV 9 8 2 ALL 98.54
7 YUV 10 8 2 ALL 98.48
8 YUV 11 8 2 ALL 98.37
9 YUV 12 10 2 ALL 98.23
10 YUV 11 16 2 ALL 98.03

I have then used the

find_cars

function on cell 30 and the function "draw_boxes" function to draw boxes on the cars in the image. The figure after applying these function is as below

alt text

Sliding Window implementation

I have then used sliding window implementation used during the course. First I have used windows with several sizes different window sizes as shown below

alt text alt text alt text alt text

after combining we have (cell 56):

alt text

Then I apply the "add_heat", apply_threshold, and "draw_labeled_bboxes" adapted from course to make heat maps of the vehicles.

alt text

Applying threshold we have

alt text

Changing the cmap to "gray"

alt text

Finally I then make the box that fits the vehicle

alt text

I then combined all the functions and a pipeline and then tested it on all the test images:

alt text

I used this pipeline and applied to both the test video and the project video and successfully identified the vehicles the link for the project video is ![here][https://github.com/sai19872000/vehicle-detection/blob/master/project_video_out.mp4]

vehicle-detection's People

Contributors

sai19872000 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.