Vehicle classification and speed estimation using Computer Vision techniques using python

ABSTRACT:

Self-Driving Car research problem requires several sub-topics that need to be discussed more deeply. Such as Deep Learning, Computer Vision, Fusion Sensor, Localization, Control, until Path Planning. All of them are fusion of several fields of study. This paper discusses the results of implementation of lane detection algorithm on toll road Cipularang as parts of self-driving car system. Video image taken using action camera mounted on top of the vehicle, with 1280×720 resolution. Average speed of the vehicle is 100 km per hour. Programming language of image processing using Python 3. Image processing methods are a combination of methods of colour region, line selection, canny edge detection, and Hough transform. The result shows this algorithm needed to be add some method that can changing the parameters during day and night adaptively. Because constant parameters can only be used in the same lighting conditions. Overall the implementation method in Python Language can successfully detect the road lane with accuracy above 90 percent.

INTRODUCTION:

Intelligent Transportation Systems (ITS) have, amongst its main goals, to avoid traffic delays and traffic jams, improve road safety, and reduce power consumption and emissions. Daily users and transportation agencies benefit from information supplied by ITS through improvements on traffic flow monitoring, management and control. The objective of the present work is to apply Computer Vision techniques to estimate vehicles geo referenced position and speed as part of an ITS. Some of the advantages of leaning towards a Computer Vision approach have already been established in prior work (Oliva et al., 2015), in which we developed an algorithm for traffic flow description with no classification capabilities. In the present paper, we focus on the classification issue. 
In section 2, we describe the Computer Vision techniques and Machine Learning scheme used for the task. In section 3, we show the measurement results obtained from applying these methods to a video obtained from a highway traffic camera. Finally, in section 4, we discuss results and potential improvements to develop in the future.


ALGORITHM DETAILS:

When a new image is acquired, the MOG algorithm acts iteratively on every pixel performing the following steps: 
1) The pixel is assigned to the class with the mean value μ closer to the intensity value of the pixel. 
2) Once it has been assigned to its closest class, the parameters estimation of the Gaussian distributions is updated.
The algorithm used consists of the following three steps:
(1) Detection: the algorithm computes SURF points of interest, and only those located inside blobs associated to moving objects are selected.
(2) Description: for each point of interest, a 64-dimensional vector is created representing a robust description of the point’s neighbourhood in its characteristic scale (SURF descriptors).
(3) Matching: the problem of matching features can be simply described as finding those SURF descriptors’ vectors with the minimum Euclidean distance between them. This process is carried out by the nearest neighbours search algorithm FLANN. Moreover, only reliable matches are taken into account, defined as those matches in which it’s second nearest neighbour is 0.6 times farther than its first neighbour, according to Lowe (2004). Another criteria applied is a biunivocal filter through Forward-Backward error (Kalal et al., 2010). We also encounter false positives matches (red arrow in Figure 6) that could be detected by applying a median filter to features’ angles, excluding those with deviation greater than 5% from the median of all angles in the current frame.

EXISTING METHOD:

a. Implementation of vehicle detection algorithm on toll road Cipularang as parts of self-driving car system. 
b. Video image taken using action camera mounted on top of the vehicle, with 1280x720 resolutions. 
c. Average speed of the vehicle is 100 km per hour. Programming language of image processing using Python 3. 
d. Image processing method is a combination of methods of object detection, feature intuition, color spaces, and HOG (histogram of oriented gradient). The result shows this algorithm needed to be add some method that can change the parameters during day and night adaptively. 
e. Because constant parameters can only be used in the same lighting conditions. Overall the implementation method in Python Language can be successfully detecting the vehicle with accuracy above 90 percent.

PROPOSED METHOD:

In the process of selecting the most suitable classification method for this scheme, several supervised algorithms were tested and compared in Python using scikit-learn, a powerful open-source set of machine learning libraries that also includes data mining and data analysis tools. 10-fold cross-validation was used to obtain more accurate performance results, measuring in each experiment: 
1) Training time.
2) Classification time. 
3) Accuracy on train samples. 
4) Accuracy on test samples.


HARDWARE AND SOFTWARE REQUIREMENT:
SOFTWARE REQUIREMENTS:

Operating System            :   WINDOWS
Simulation Tool                            :    OPENCV PYTHON
Documentation               :   Ms-Office

HARDWARE REQUIREMENTS:

CPU type                                  :    Intel Pentium 4
Clock speed                              :    3.0 GHz
Ram size                                   :    512 MB
Hard disk capacity                    :    80 GB
Monitor type                             :    15 Inch colour monitor
Keyboard type                          :     Internet keyboard
CD -drive type                          :     52xmax