Vacant Parking Lot Detection System Using Random Forest Classification
Vacant Parking Lot Detection System Using Random Forest Classification
All of these features will be extracted for all the slots ii. Rounded gradient = 0° and
in an image. For our dataset every image has 40 slots magnitude > east & west pixels
and we have extracted two features with four variables iii. Rounded Gradient = 135° and
namely median of the canny edges, white difference magnitude > north-west & south-east pixels.
from empty, number of white pixels and number of iv. Rounded Gradient = 45° and
black pixels in each and every slot along with mean magnitude > north-east & south-west pixels.
and covariance from colour detection. A set of 942 d) Applying High Threshold: Even if we did
images have been used for training and every image non-maximum suppression still there will be some
has 40 slots. Thus, a total of 37,680 parking space each edges that cause noise because of colour variation. So
with four variables is given to Random Forest again, the suppression algorithm is applied more
classifier for generating the trained model. For testing, efficiently by selecting two threshold values as peak
the probe image is taken, pre-processed and features threshold value and a base threshold value. Some
will be extracted from that image and the classification conditions are checked to detect the weak edges as
is done using previously trained model. well. The pixel value must fall under one of these
conditions:
A. Feature Extraction If pixel value is large than peak threshold
1) Canny Edge Detection: Canny edge detection value then it will be taken as thick edge pixel.
is a technique to extract useful structural information If pixel value is smaller than peak
from different vision objects and dramatically reduce threshold value and also large than base
the amount of data to be processed. Every slot is taken threshold value then it will be taken as thin
as image and applied a canny edge detection edge pixel.
algorithm. If the pixel value is smaller than base
Canny edge detection includes five steps. threshold value then that pixel will be
a) Applying Gaussian filter: Gaussian filter supressed.
is applied for softening the noise reduction filtration. It
As applying all of these conditions to every pixel of
prevents the unwanted or fake detection of the edges
the image will decrease the time efficiency, it will be
as the edge detection results are heavily affected by the
only applied to the parking slot of an image.
noise.
e) Edge tracking by hysteresis:
For tracking the connections between the edges
b) Intensity Gradient of the image: The detected in the previous steps blob analysis is applied
canny edge detection algorithm aims to find the points which is connected by the 8-connected neighbourhood
in vertical, diagonal and horizontal edges for a blurred pixels. And the weak edges and its connected edges
image. The operators of edge detection such as sobel, are removed for achieving the accurate result.
Prewitt is helpful in determining the edge gradient and
direction.
2) Colour Variation Detection: There will be spaces and 7536 test parking space images) have been
difference between the parking ground colour and the taken based on the location for building the model and
vehicle colour. Whenever a car comes into the parking classification.
spot there will be a disturbance in the background
IV. RESULTS AND DISCUSSION
colour of parking images. Our aim is to detect those
disturbance and store it for classification. LUV After applying Random Forest classifier using the 10-
algorithm is used for colour variation detection in our fold cross validation, an accuracy of 98.31% is
proposed method. The algorithm used by Peng in [6] achieved and detection of parking lot is depicted in
has been used in our proposed method for colour Fig. 4. The confusion matrix for the generated output
detection where the mean and covariance of the image is given below.
have been calculated and given to the classifier. We
have separated the background colour and vehicle
colour using the new colour space (U, V). The (U, V)
colour space is defined as follow:
Fig. 6. Decision boundary on testing set of size 7,536. (Red triangle location traces of the slots in the images by efficient
represents the occupied and blue squares represents the vacant image processing techniques.
parking spaces.)
VI. REFERENCES
The accuracy of the model is calculated by the formula [1] Jones and Lewis, 2011, “Vacant Parking Spot Detection”,
Stanford.edu, California.
Accuracy = (TP + TN) / (TP + TN + FP + FN). [2] Yusnita et al, 2012. “Intelligent Parking Space Detection System
Based on Image Processing”, International Journal of Innovation,
Precision, F1-score, Recall and Support of the model Management and Technology, Vol. 3, No. 3, June 2012.
are given below where the parameters are the predicted [3] Huan et al. 2013, “Vehicle detection from parking lot using
values of the model. the aerial images” in IEEE International Geoscience and Remote
Sensing Symposium.
precision recall f1-score support [4] M. Teutsch and W. Kruger 2015, “Robust and fast detection of
moving vehicles in aerial videos using sliding windows,” in
Empty 0.98 0.97 0.97 2443 Proceedings of the IEEE Conference on Computer Vision and
Occupied 0.98 0.99 0.99 5093 Pattern Recognition, pp. 26-34, 2015.
[5] Gou et al., 2016, “Extraction of parking lot structure from aerial
The above can be calculated using the formulas image in urban areas”, International Journal of Innovative
Precision = (TP) / (TP + FP) Computing, Information and Control, Volume 12, Number 2, April
Recall = (TP) / (TP + FN) 2016, pp. 371–383.
F1-Score = (2 * Precision * Recall) / (Precision + [6] Peng et al, 2018, “Drone-Based Vacant Parking Space
Detection” IEEE Advanced Information Networking and
Recall) Applications Workshops, 2018.
F1-Score is a value used for model comparison of [7] Wu et al, 2007, “Robust Parking Space Detection Considering
same data with another model or process. Inter-Space Correlation” ICME, pp. 659-662, Jul. 2007.
[8] Tsai et al, 2007, “Vehicle detection using normalized colour and
Support = number of values of each class having. edge map”, IEEE Transactions on Image Processing, vol. 16, no. 3,
Where precision and recall are the data to be viewed pp. 850-864, 2007.
carefully. [9] Nicholas, 2007, “Vacant Parking Space Detection in Static
Images”, University of California, San Diego.
TABLE I. COMPARISON OF PREVIOUS MODELS WITH OUR [10] Ananth et al, 2008, “Vision Based Parking Space
MODEL Classification”, Clemson University,
[11] Ichihashi et al, 2009, “Vacant Parking Space Detector for
DATASET ERROR Outdoor Parking Lot by Using Surveillance Camera and FCM
REFERENCE FEATURES ACCURACY
SIZE RATE
Wu et al. [7] Colour 1100 85% 6.5 Classifier”, IEEE International Conference on Fuzzy Systems, Jeju
Island, 2009, pp. 127-134.
Gabor
Sastre et al. [17] 12,150 78% 2.2 [12] L.-C. Chen, et al., 2010, “Vision-based vehicle surveillance and
Filters
parking lot management using multiple cameras,” Sixth
Huang et al. [18] Colour 2600 75% 2.5
International Conference on Intelligent Information Hiding and
Bong et.al [19] Colour 80 75% 7.0 Multimedia Signal Processing (IIHMSP), pp. 631-634, 2010.
Ichihashi et al. [13] Paulo et al. 2013, “Parking space Detection using the
PCA 54,800 80% 2.0
[11] Textural Descriptors” in IEEE International Conference on
Huang and Wang Systems, Man, and Cybernetic, 978-1-4799-0652-9/13, 2013
Colour 6912 88% 1.2
[2] IEEE.
Paulo et al. [13] Texture 82,516 93% 0.7 [14] Ahrnbom et al, 2016, “Fast Classification of Empty and
Edge and Occupied Parking Spaces Using Integral Channel Features”,
Proposed Model 37,680 98.31% 0.17
Colour IEEE Conference on Computer Vision and Pattern Recognition
Workshops (CVPRW), Las Vegas, NV, 2016, pp. 1609-1615.
The proposed method has achieved a very good [15] Amato et al,2016, “Car Parking Occupancy Detection Using
Smart Camera Networks and Deep Learning” IEEE Symposium on
accuracy of 98.31% compared to the existing methods Computers and Communication (ISCC), pp. 1212-1217, 2016.
since a combination of both canny edge detection and [16] Praveen et al, 2018, “A Haar-Cascade classifier based Smart
LUV based colour detection is used. Also, the Random Parking System”, Int'l Conf. IP, Comp. Vision, and Pattern
Forest algorithm contributes more to the accuracy Recognition, IPCV'18.
[17] Sastre et al, 2007, “Computer algebra algorithms applied to
caused due to its ability to solve the overfitting computer vision in a parking management system”, IEEE
problem of training data using the decision tree international symposium on industrial electronics, 2007. ISIR 2007,
classifier. pp. 1678-1680.
[18] Huang et al, 2013, “Vacant parking space detection based on
V. FUTURE WORK plane-based Bayesian hierarchical framework”, IEEE Transactions
on Circuits and Systems for Video Technology”, 23, 1598-1610.
Using this model, we can build a very efficient and [19] Bong et al, 2008, “Integrated approach in the design of car park
intelligent parking system. Efficiency can also be occupancy information system”, IAENG International Journal of
increased in case of different weather conditions like Computer Science, 35, 1-8.
[20] Huang, C.-C., & Wang, S.-J., 2010, “A hierarchical Bayesian
sunny, rainy and cloudy days, in different light generation framework for vacant parking space detection” IEEE
conditions and also in different views of the parking Transactions on Circuits and Systems for Video Technology, 20,
space like space covering with the leaves or other 1770-1785.
conditions. The proposed method can also be extended
to includes the location tracking of the empty slot
using the Google’s API. An android application can be
created where the users can easily access the location
of the empty slot in the parking lot without giving the