real-time vehicle detection using cross-correlation and...

10
Research Article Real-Time Vehicle Detection Using Cross-Correlation and 2D-DWT for Feature Extraction Abdelmoghit Zaarane , Ibtissam Slimani , Abdellatif Hamdoun, and Issam Atouf LTI Lab, Laboratory of Information Processing, Department of Physics, Faculty of Sciences Ben M’sik, University Hassan II Casablanca, BP 7955, Casablanca, Morocco Correspondence should be addressed to Abdelmoghit Zaarane; [email protected] Received 31 July 2018; Revised 5 November 2018; Accepted 5 December 2018; Published 9 January 2019 Academic Editor: Jar Ferr Yang Copyright © 2019 Abdelmoghit Zaarane et al. is is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. Nowadays, real-time vehicle detection is one of the biggest challenges in driver-assistance systems due to the complex envi- ronment and the diverse types of vehicles. Vehicle detection can be exploited to accomplish several tasks such as computing the distances to other vehicles, which can help the driver by warning to slow down the vehicle to avoid collisions. In this paper, we propose an efficient real-time vehicle detection method following two steps: hypothesis generation and hypothesis verification. In the first step, potential vehicles locations are detected based on template matching technique using cross-correlation which is one of the fast algorithms. In the second step, two-dimensional discrete wavelet transform (2D-DWT) is used to extract features from the hypotheses generated in the first step and then to classify them as vehicles and nonvehicles. e choice of the classifier is very important due to the pivotal role that plays in the quality of the final results. erefore, SVMs and AdaBoost are two classifiers chosen to be used in this paper and their results are compared thereafter. e results of the experiments are compared with some existing system, and it showed that our proposed system has good performance in terms of robustness and accuracy and that our system can meet the requirements in real time. 1. Introduction e automatic vehicle detection has gained importance in research for the last fifteen years where the development of a successful system for vehicle detection is the principal step for driver assistance which needs calculation of the distances between vehicles to warn drivers to slow down vehicles to avoid accidents and collisions. Several methods are used to detect vehicles [1] such as laser-based or radar systems. However, in this paper, we are based on image processing. e majority of the proposed method follows two steps, namely, hypothesis generation and hypothesis verification. In the hypothesis generation step, the localization of vehicles “zones of interest” in the image is hypothesized. In the hypothesis verification, the zones of interest are treated and verified if they are vehicles or not. Several methods are proposed to generate the hy- pothesis. Yan et al. [1] used the preknowledge shadows underneath the vehicles to detect the zones where a vehicle can be in the image but that can be suitable just in specific weather and specific time in the day. Soo et al. [2] proposed a monocular symmetry-based vehicle detection system in which the symmetry is one of the most interesting visual characteristics of a vehicle. However, computation of the symmetry values for every pixel is a time-consuming pro- cess. Jazayeri et al. [3] detected and tracked vehicles based on motion information, and they relied on temporal in- formation of features and their motion behaviors for vehicle identification, which helps recompensing the complexity in recognizing types, colors, and shapes of a vehicle. A motion- based method is a successful method to detect moving objects. However, it is intensive in terms of calculation and requires analysis of several frames before an object can be detected. It is also sensitive to camera movement and may fail to detect objects with slow relative motion. Gao et al. [4] used color information and edge information to detect Hindawi Journal of Electrical and Computer Engineering Volume 2019, Article ID 6375176, 9 pages https://doi.org/10.1155/2019/6375176

Upload: others

Post on 13-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Real-Time Vehicle Detection Using Cross-Correlation and ...downloads.hindawi.com/journals/jece/2019/6375176.pdfvehicles “red bounding box” and hypothesis of nearby ve-hicles “green

Research ArticleReal-Time Vehicle Detection Using Cross-Correlation and2D-DWT for Feature Extraction

Abdelmoghit Zaarane Ibtissam Slimani Abdellatif Hamdoun and Issam Atouf

LTI Lab Laboratory of Information Processing Department of Physics Faculty of Sciences Ben MrsquosikUniversity Hassan II Casablanca BP 7955 Casablanca Morocco

Correspondence should be addressed to Abdelmoghit Zaarane zabdelmoghitgmailcom

Received 31 July 2018 Revised 5 November 2018 Accepted 5 December 2018 Published 9 January 2019

Academic Editor Jar Ferr Yang

Copyright copy 2019 Abdelmoghit Zaarane et al +is is an open access article distributed under the Creative Commons AttributionLicense which permits unrestricted use distribution and reproduction in any medium provided the original work isproperly cited

Nowadays real-time vehicle detection is one of the biggest challenges in driver-assistance systems due to the complex envi-ronment and the diverse types of vehicles Vehicle detection can be exploited to accomplish several tasks such as computing thedistances to other vehicles which can help the driver by warning to slow down the vehicle to avoid collisions In this paper wepropose an efficient real-time vehicle detection method following two steps hypothesis generation and hypothesis verification Inthe first step potential vehicles locations are detected based on template matching technique using cross-correlation which is oneof the fast algorithms In the second step two-dimensional discrete wavelet transform (2D-DWT) is used to extract features fromthe hypotheses generated in the first step and then to classify them as vehicles and nonvehicles +e choice of the classifier is veryimportant due to the pivotal role that plays in the quality of the final results +erefore SVMs and AdaBoost are two classifierschosen to be used in this paper and their results are compared thereafter +e results of the experiments are compared with someexisting system and it showed that our proposed system has good performance in terms of robustness and accuracy and that oursystem can meet the requirements in real time

1 Introduction

+e automatic vehicle detection has gained importance inresearch for the last fifteen years where the development of asuccessful system for vehicle detection is the principal stepfor driver assistance which needs calculation of the distancesbetween vehicles to warn drivers to slow down vehicles toavoid accidents and collisions

Several methods are used to detect vehicles [1] such aslaser-based or radar systems However in this paper we arebased on image processing +e majority of the proposedmethod follows two steps namely hypothesis generationand hypothesis verification In the hypothesis generationstep the localization of vehicles ldquozones of interestrdquo in theimage is hypothesized In the hypothesis verification thezones of interest are treated and verified if they are vehiclesor not Several methods are proposed to generate the hy-pothesis Yan et al [1] used the preknowledge shadows

underneath the vehicles to detect the zones where a vehiclecan be in the image but that can be suitable just in specificweather and specific time in the day Soo et al [2] proposed amonocular symmetry-based vehicle detection system inwhich the symmetry is one of the most interesting visualcharacteristics of a vehicle However computation of thesymmetry values for every pixel is a time-consuming pro-cess Jazayeri et al [3] detected and tracked vehicles based onmotion information and they relied on temporal in-formation of features and their motion behaviors for vehicleidentification which helps recompensing the complexity inrecognizing types colors and shapes of a vehicle A motion-based method is a successful method to detect movingobjects However it is intensive in terms of calculation andrequires analysis of several frames before an object can bedetected It is also sensitive to camera movement and mayfail to detect objects with slow relative motion Gao et al [4]used color information and edge information to detect

HindawiJournal of Electrical and Computer EngineeringVolume 2019 Article ID 6375176 9 pageshttpsdoiorg10115520196375176

vehicles where the detection method is based on the de-tection of rear lights by looking for the red representation inthe image and they used the function of symmetry measureto analyse the symmetry of the color distribution and de-termine the specific position of axis of the symmetry Af-terwards the pair of edges are determined to rebuild theintegrated edges of a vehicle

After the hypotheses generation step the generatedhypotheses should be classified either as vehicles or not Inthis step two essential operations are needed feature ex-traction and classification Various methods are proposed toovercome this step +e Haar-like feature extraction methodis usually used which is a robust and rapid method whichuses the integral image but the problem resides in the hugenumber of the output features Usually dimensionality re-duction techniques [5 6] are required for the high-dimensional features +e Haar-like method was a goodpartner for many classifiers In [7ndash9] the Haar-like methodwas combined with the SVMs classifier Also the Haar-likecombination method and the AdaBoost classifier have beenused in [10ndash12] Other famous features extraction methodsare also used such as the histogram of oriented gradients(HOG) Gabor filters and Gradient features In [1] theAdaBoost and SVMs classifiers are trained by the combinedHOGrsquos features In [13] a new descriptor is proposed forvehicle verification using the alternative family of functionsof log Gabor instead of the existing descriptors based on theGabor filter Descriptors which are based on Gabor filtershave presented good results and showed good performancein extracting features [14] A system that detects rear ofvehicles in real time based on the AdaBoost classificationmethod and the gradient features method for adaptive cruisecontrol application (ACC applications) is presented +eGradient features method is good at characterizing theobjects shape and appearance

In our proposition at the hypothesis generation stepvehicle candidates are determined by using cross-correlationafter preprocessing using edge detection to improve theresults +e cross-correlation is a common method whichhas been used to evaluate and compute the similarity degreebetween two compared images In the step of hypothesisverification the generated candidates in the previous stepare verified Two major operations are needed in this stepfeature extraction and classification For feature extractionthe third level of 2D-DWT is utilized which is a powerfultechnique for representing data at different scales and fre-quencies For classification two classifiers are used supportvector machines (SVMs) classifier and AdaBoost classifierand then their results are compared to get a reliable resultWe have tested these classifiers using real data However itneeds a large training set Currently we concentrate on thedaytime detection for various vehicle models and types Inour approach the vehicle candidates are generated using thehighly correlated zones +ese possible vehicle candidatesare then classified with AdaBoost and SVMs to removenonvehicle objects Figure 1 shows the overall flow diagramof the method

+e organization of the paper is as follows Section 2describes the hypothesis generation In Section 3 the

hypothesis verification method is presented +e experi-mental results are presented in Section 4 followed by theconclusion in Section 5

2 Hypothesis Generation

+e principal step in the vehicle detection system is thegeneration of hypothesis where in this step we should lookin the image for the places where vehicles may be found(zones of interest) In our proposition we perform first apreprocessing method using edge detection which acts animportant role in the performance of our method Afterperforming the preprocessing the cross-correlation is usedto detect the zones of interest which is an algorithm thatcalculates the similarity between a template and an image+e use of edge detection improves the result of the cross-correlation and also reduces the processing time

In this section the preprocessing and the cross-correlation techniques for initial candidate generation aretreated

21 Edge Detection +e best features that can be extractedfrom vehicles in the detection systems are corners colorshadows and horizontal edges and vertical edges +eshadows are good features to extract that can be utilized tofacilitate the hypothesis of vehicles However they are verydependent on image intensity that depends also on weatherconditions +e corner features can be found easily How-ever they can be corrupted easily due to the noise

In this paper the edge detection is used where thehorizontal edges and vertical edges are good features toextract Looking at the edges reduces the required in-formation because they replace a color image by a binaryimage in which objects and surface markings are outlined+ese image parts are the most informative ones

+e first step is to generate a global contour image fromthe input gray-scale image using the Canny edge detector[15]+e selection of the threshold values for the Canny edgedetector is not so critical as long as it generates enough edgesfor the symmetry detector +e edge detection was per-formed on the image and on the template Figure 2 shows theresult of edge detection performed on a typical road scenecaptured by the forward looking camera

+is technique improves the choice quality of the vehiclecandidates and it optimizes the processing time

22Cross-Correlation +e purpose is to identify areas in theimage that are probably vehicles However the problem is todetect the pattern position in images +e cross-correlationis utilized to achieve this purpose which is a standardmethod of estimating the degree of similarity in other wordsto estimate how much two images are correlated [16]+erefore the vehicle hypotheses in the images are foundbased on the similarity degree between template images andtest images Figure 3 shows a template image example

+e function of cross-correlation between the image andthe template is defined as

2 Journal of Electrical and Computer Engineering

ρ sumij

(x(i j) minus x)(y(i j) minus y)σxσy

(1)

where x(i j) is the part of the image shared by template andx is the mean of x(i j) y(i j) is the template and y is themean of y(i j) and σx and σy are the standard deviations of

x(i j) and y(i j) respectively e function ρ varies be-tween minus1 and +1 where the good correlation state is foundwhen the ρ function takes values near +1 (ie when rstfunction increases the second one does too in proportion)the uncorrelated state is found when the ρ function takesvalues near 0 (ie no relation between variation in the rstfunction and the second one) and the anti-correlated state isdetected when the ρ function takes values near minus1 (ie whenthe rst function decreases the second increases in pro-portion) e best match occurs when templates and testimages have maximum ρ Multiple candidate locations canbe found by using this technique

e problem of matching using cross-correlation is thatit detects the similarity between template and a part of theimage only if they have almost the same size or a little bitbigger or smaller size which means that we can detect ve-hicles just in a predened distance in other words we candetect only far vehicles or near vehicles In our propositionto overcome this problem we chose to work with fourdierent templatersquos sizes Two smaller sizes are used to detectfar and very far vehicles and two bigger sizes are used todetect close and very close vehicles We do not need varioussizes because the farthest vehicles are not that importantDierent hypotheses of dierent vehicles are generatedusing few templates even if they have dierent shapes ortypes compared with the templates using the edge detectiontherefore there is no need to use templates for each vehicletype shape or texture In our case three templates in foursizes are enough to generate the hypotheses following thethree vehicles categories template for cars template forbuses and template for trucks Figure 4 shows an example ofcross-correlation result that generates the hypothesis of farvehicles ldquored bounding boxrdquo and hypothesis of nearby ve-hicles ldquogreen bounding boxrdquo

3 Hypothesis Verification

e hypothesis verication step acts an important role forvehicle detection e results of the previous step are the

Gray input image

sequence

Preprocessing (edge

detection)

Cross-correlation

Support vector

machinesadaboost

Detected vehicles

Hypothesis generation Hypothesis verification

Third level 2D-DWT

Figure 1 Overall ow diagram of our vehicle detection algorithm

Figure 2 Resulting image using the Canny edge detector

Figure 3 Example of a template

Journal of Electrical and Computer Engineering 3

positions in the image where vehicles may be found Howevernot all positions detected on the image belong to vehicles+erefore further verification is needed In the verificationstep two major methods are needed feature extractionmethod and classification method +e classifier is used toclassify the extracted features if they correspond to vehicles ornot Seeking the solutions to improve the vehicle detectionaccuracy and reduce the false detection rate while consideringthe real time we propose to use the two-dimensional discretewavelet transform for feature extraction AdaBoost and SVMsto classify these extracted features +e discrete wavelettransform (DWT) has a good location property in frequencyand time domains and it is an efficient method for featuresextraction +e AdaBoost and SVM classifiers are used inseveral studies and they showed a very good result

In this section the discrete wavelet transform and SVMsand AdaBoost classifiers are treated

31 Discrete Wavelet Transform Wavelet transform iswidely used in many applications because it reduces thecomputation cost and provides sharper timefrequency lo-calization [17] in contrary to the Fourier transform +ediscrete wavelet transform (DWT) is any wavelet transformfor which the wavelets are discretely sampled +e principalof DWT is to decompose the input signal into two sub-signals the detail and the approximation +e approxima-tion corresponds to the low frequency of the input signalwhich is the most energy of a signal and the detail corre-sponds to the high frequency of the input signal +istechnique can be repeated at multiple levels by taking theapproximation as an input signal +e same principal isapplied for images and the DWTdecomposes the image intofour subband images LL LH HL and HH subband images[18] as shown in Figure 5 +e LL subband image containsthe low-frequency component of the input image whichcorresponds to the approximation and HL LH and HHsubband images contain the high-frequency components ofthe input image which are the details

As shown in Figure 6 the low-pass filter and the high-pass filter are used first on the lines of the input imageldquoie verticallyrdquo and then on the columns ldquoie horizontallyrdquoFurthermore after each filtering operation a down samplingis used to reduce the overall number of computation +istechnique can be repeated at multiple levels until obtainingthe desired result as shown in Figure 7

In this study we have concentrated on the third level ofthe 2D-DWT +is technique is applied on each generatedcandidate and on the dataset images to extract features Weextract the important features that we need and it helps us toimprove the result of the classification

32 Support Vector Machines (SVMs) SVM is a popularmachine learning algorithm for classification It is a dis-tinctive classifier that defines a separation hyper plane basedon training data with its label (supervised learning) +isalgorithm generates the best hyper plane that classifies newexamples +e SVM algorithm principle is used to find thehyper plane that maximizes the distance between thetraining example classes which is called the margin

Figure 4 +e result of the cross-correlation

(a)

LL LH

HL HH

(b)

Figure 5 (a) First level of DWT (b) Subbands of the first level ofDWT

LL

High pass

Low pass

Low pass

High pass

High pass

2

2

LH

HL

HH

Low pass

Image2

2

2

2

Figure 6 +e structure of forward two-dimensional DWT

4 Journal of Electrical and Computer Engineering

+erefore the optimal separating hyper plane maximizes themargin of the training data

+e separating hyper plane is defined as

f(x) (ω middot x) + b (2)

where ω is known as the weight and b is called the bias+e margin is given as

M 2

ω (3)

According to this expression it is necessary to minimizeω to maximize the margin

+e classification function is given as

Cf 1113944i

ωi middot k x xi( 1113857 + b (4)

where xi is the support vector selected from trainingsamples x is the input vector k(x xi) is the kernel functionand ωi is the support vector weight (xi) which is determinedin the training process

In our paper radial basis function kernel (RBF kernel) isused and it gives good results compared to the other kernels+e RBF kernel function is given as

k x xi( 1113857 exp minusxminusx2

i

2δ21113888 11138891113888 1113889 (5)

+e SVMs are trained using the positive samples andnegative samples +e positive and negative vectors aretrained to be classified with the SVMs X is considered to be amember of class one only if Cf ge 0 otherwise x is considereda member of class two +e flowchart that illustrates theSVM classification is shown in Figure 8

33 AdaBoost Classifier AdaBoost (Adaptive boosting) wasproposed by Freund and Schapire in 1996 [19] It is a

supervised learning algorithm that classifies between positiveand negative examples and it aims at converting an ensembleof weak classifiers into strong classifier a single classifier mayclassify the objects poorly However when multiple classifiersare combined with selection of the training set at every it-eration and assigning right amount of weight in final votingwe can have good accuracy score for the overall classifier +ealgorithmrsquos input is a set of labeled training examples (xi yi)i 1 m where xi is an example and yi is its label thatindicates if xi is a positive or negative example Every weakclassifier is noted as function ht(x) that returns one of the twovalues [+1minus1] ht(x) is +1 if x is classified as a positiveexample and ht(x) is minus1 if x is classified as a negative ex-ample +e AdaBoost algorithm is shown in Algorithm 1according to [20]

Concerning training examples we give m labeled ex-amples (x1 y1) (xm ym) whither the xi isin X and thelabels yi isin minus1 +1 Dt is a distribution calculated on the m

training examples of each value of t 1 T and to find aweak hypothesis ht X⟶ minus1 +1 a weak learning algo-rithm is applied Where the weak learner purpose is to lookfor a weak hypothesis that has a low-weighted error εt

relative to Dt +e weighted combination sign of the weakhypotheses is computed to determineH the final hypothesis

34 Preparation of Input Data

341 Training Process To train the classifier we shouldprepare the templates first by normalizing them to 158 times 154grayscale images then extracting the features using the thirdlevel of 2D-DWT and finally setting them in labeled vectors

342 Classification Process To classify the generated can-didates (zones of interest) we should normalize them to 158times 154 grayscale images and then extract the features usingthe third level of 2D-DWT and finally we construct a vectorusing the extracted features which will be the input of thetrained classifier and then obtain the results of theclassification

Figure 7 +ird level of 2D-DWT

Templates Test image

SVMs training SVMsclassification

Vehicle Nonvehicle

Figure 8 +e flowchart of SVM classification

Journal of Electrical and Computer Engineering 5

4 Experiment Results

41 Experimental Datasets +e database used in the ex-periments contains two parts +e first part was done bycombining the Caltech car database [21] and some imagesthat are captured manually from different situations whichwere used to train the classifier +e second part was col-lecting the videos in real traffic scenes which are utilized totest the hypothesis generation step and hypothesis verifi-cation step Some of the images contain vehicles and otherscontain background objects All images are normalized to158 times 154 pixels +is paper uses MATLAB R2015b as thesoftware development tool to test the proposed method +edevice configuration is 40GB memory DDR4 and 340GHzIntel(R) Core(TM) i5 CPU

+e Caltech car database included 1155 vehicle imagesfrom the rear and 1155 nonvehicle images +e real trafficscenes are captured by a camera mounted on the carwindshield +e real traffic scenes contain much in-terference such as traffic lines trees and billboards Figure 9shows some examples of the database

42 Performance Metrics To test the proposed system wecollected real traffic videos using a camera mounted on frontof a car +e vehicle detection was tested in various envi-ronments and it showed a good rate especially on thehighways

Some results of hypothesis generation using cross-correlation from different image sequences are shown inFigure 10+e trees beside the road and the rear window of acar generate some false hypothesis However the purpose ofthis step was to detect the potential vehicles location re-gardless of the amount of false candidates generated wherethe false candidates would be removed in the hypothesisverification step as shown in Figure 11

To evaluate the performance of the proposed methodthe statistical data and the accuracy of various testing caseswere recorded and are listed in Table 1 +e accuracy isdefined as follows

accuracy Td

Td + Mv + Fdtimes 100 (6)

where Td is the number of true detections Mv is the numberof missed vehicles and Fd is the number of false detections

In order to get the best results we have to look for anefficient classifier where the classification step is the mostimportant step in detection systems +erefore we haveused and compared two classifiers SVMs and AdaBoostwhich are two efficient methods of classification whichhave been used to verify and classify the extracted featuresby using 2D-DWTof the generated hypothesis +e use ofthese two classifiers gave really efficient results Howeverthe AdaBoost classifier gave a high accuracy of classifi-cation and showed more advantages than the SVMclassifier that also showed an important accuracy ofgenerated hypothesis classification +e most missed ve-hicles are missed due to the overlapping However thedetection of overlapping vehicles is done successfullybased on the percentage of vehicle parts hidden behindother vehicles If only small part of a vehicle is hidden itwill be generated in the hypothesis generation step andwill be detected otherwise it will not be detected +isproblem is not very important and the most important

Figure 9 Some vehicle training sample images

Input (x1 y1) (xm ym) is a set of labeled examples where xi belongs to X yi isin minus1 +1 Initialization D1(i) 1m for i 1 mFor t 1 TTrain the weak learner based on distribution DtObtain the weak hypotheses ht X⟶ Y minus1 +1

Select ht with low weighted errorεt 1113936

iht(x)neyDt(i)

If εt gt 12 then set T tminus 1 and abort loopChoose βt εt(1minus εt)Update Dt Dt+1(i) Dt(i)Zt times

βt if ht(xi) yi

1 otherwise1113896

Where Zt is a factor of normalization (chosen in a way that Dt+1 is a distribution)+e final hypothesis is given asH(x) sign (1113936

Tt1ln(1βt)ht(x) )

ALGORITHM 1

6 Journal of Electrical and Computer Engineering

problem is to detect vehicles directly in front of thecurrent vehicle

Table 1 shows the results of our vehicle detection system

43 Evaluation Results To evaluate our proposed work weuse three methods to compare with Yan et al [1] are basedon shadow under vehicle to detect the region of interest andthen used histograms of oriented gradients and the Ada-Boost classifier for vehicle detection Tang et al [7] are basedon the Haar-like features and the AdaBoost classifier todetect vehicles which is a very popular method Ruan et al[22] focused on wheel detection to detect vehicles +ey arebased on the HOG extractor and MB-LBP (multiblock localbinary pattern) with AdaBoost to detect vehiclersquos wheelsTable 2 shows the results of three different methods from

different scenes in different conditions compared to ourproposed method results and this comparison shows thatthe proposed method has the highest accuracy and confirms

(a) (b) (c)

Figure 10 Hypothesis generation result after cross-correlation (a) very close and very far generated candidates (b) very close and fargenerated candidates (c) close and far generated candidates

(a) (b)

(c) (d)

Figure 11 +e results of hypothesis verification step of the generated candidates

Table 1 Vehicle detection rates

Methods Video sequences1 2 3 4

Cross-correlation +2D-DWT + SVMs

TD 98 102 115 121MV 2 2 2 4FD 2 2 1 2

Accuracy () 9608 9623 9746 9527

Cross-correlation +2D-DWT +AdaBoost

TD 99 101 116 123MV 1 2 1 2FD 1 2 1 1

Accuracy () 9802 9619 9831 9762

Journal of Electrical and Computer Engineering 7

that it is able to detect vehicles in different conditions with ahigh accuracy and efficiency

5 Conclusion

A real-time vehicle detection system using a cameramounted on front of a car is proposed in this paper Wehave proposed a solution based on the cross-correlationmethod +e proposed system included two steps the hy-pothesis generation and hypothesis verification steps Firstlyin the hypothesis generation step the initial candidate se-lection is done by using the cross-correlation technique afterapplying the edge detection to improve the result and reducethe processing time +en in the hypothesis verification stepthe two-dimensional discrete wavelet transform has beenapplied on both selected candidates and dataset to extractfeatures Two famous classifier SVM and AdaBoost have beentrained using these extracted features Based on a comparisonof these two classifier results it was concluded that theAdaBoost classifier performed better in terms of accuracy thanSVMs that has also showed an interesting accuracy +e ex-perimental results presented in this paper showed that theproposed approach have good accuracy compared to othermethods

Data Availability

+e data used to support the findings of this study are in-cluded within the article [21]

Additional Points

Our perspectives include the improvement in hypothesisverification step by updating the AdaBoost classifier in orderto reduce the processing time and the distance measurementbetween the detected vehicles and the camera

Conflicts of Interest

+e authors declare that there are no conflicts of interest

References

[1] G Yana Y Ming Y Yang and L Fan ldquoReal-time vehicledetection using histograms of oriented gradients and Ada-Boost classificationrdquo Optik vol 127 no 19 pp 7941ndash79512016

[2] S T Soo and T Braunl ldquoSymmetry-based monocular vehicledetection systemrdquo Machine Vision and Applications vol 23no 5 pp 831ndash842 2012

[3] A Jazayeri H Cai Y Jiang Zheng andM Tuceryan ldquoVehicledetection and tracking in car video based on motion modelrdquoIEEE Transactions on Intelligent Transportation Systemsvol 12 no 2 pp 583ndash595 2011

[4] L Gao C Li T Fang and X Zhang ldquoVehicle detection basedon color and edge informationrdquo in ICIAR 2008 Vol 5112Springer Berlin Germany 2008

[5] J Li and D Tao ldquoSimple exponential family PCArdquo IEEETransactions on Neural Networks and Learning Systemsvol 24 no 3 pp 485ndash497 2013

[6] P J Cunningham and Z Ghahramani ldquoLinear di-mensionality reductionsurvey insights and generaliza-tionsrdquo Journal of Machine Learning Research vol 16pp 2859ndash2900 2015

[7] Y Tang C Zhang R Gu P Li and B Yang ldquoVehicle de-tection and recognition for intelligent traffic surveillancesystemrdquo Multimedia Tools and Applications vol 76 no 4pp 5817ndash5832 2015

[8] X Wen H Zhao N Wang and H Yuan ldquoA rear-vehicledetection system for static images based on monocular vi-sionrdquo in Proceedings of 9th International Conference onControl Automation Robotics and Vision pp 2421ndash2424Singapore March 2006

[9] W Liu X Wen B Duan et al ldquoRear vehicle detection andtracking for lane change assistrdquo in Proceedings of IEEE In-telligent Vehicles Symposium pp 252ndash257 Istanbul TurkeyJune 2007

[10] M M Moghimi M Nayeri M Pourahmadi andM KMoghimi ldquoMoving vehicle detection using AdaBoost andhaar-like feature in surveillance videosrdquo International Journalof Imaging and Robotics vol 18 no 1 pp 94ndash106 2018

[11] X Wen L Shao Y Xue and W Fang ldquoA rapid learningalgorithm for vehicle classificationrdquo Information Sciencesvol 295 pp 395ndash406 2015

[12] R Lienhart and J Maydt ldquoAn extended set of haarndashlikefeatures for rapid object detectionrdquo in Proceedings of IEEEInternational Conference on Image Processing pp 900ndash903Rochester NY USA January 2002

[13] J Arrospide and L Salgado ldquoLog-gabor filters for image-based vehicle verificationrdquo IEEE Transactions on ImageProcessing vol 22 no 6 pp 2286ndash2295 2013

[14] A Khammari F Nashashibi Y Abramson and C LaurgeauldquoVehicle detection combining gradient analysis and AdaBoostclassificationrdquo in Proceedings of 2005 IEEE IntelligentTransportation Systems pp 66ndash71 Vienna Austria Sep-tember 2005

[15] J Canny ldquoA computational approach to edge detectionrdquo IEEETransactions on Pattern Analysis and Machine Intelligencevol 8 no 6 pp 679ndash698 1986

[16] S-D Wei and S-H Lai ldquoFast template matching based onnormalized cross correlation with adaptive multilevel winnerupdaterdquo IEEE Transactions on Image Processing vol 17no 11 pp 2227ndash2235 2008

[17] I Daubechies ldquo+e wavelet transform time-frequency lo-calization and signal analysisrdquo IEEE Information Ceory So-ciety vol 36 no 5 pp 961ndash1005 1990

[18] I Slimani A Zaarane and A Hamdoun ldquoConvolutionalgorithm for implementing 2D discrete wavelet transformon the FPGArdquo in Proceedings of Computer Systems andApplications (AICCSA) 2016 IEEEACS 13th InternationalConference of IEEE pp 1ndash3 Agadir Morocco Novem-ber-December 2016

[19] Y Freund and R E Schapire ldquoA decision-theoretic gener-alization of online learning and an application to boostingrdquo in

Table 2 Evaluation results of 4 vehicle detection methods

MethodsVideo sequences

1 () 2 () 3 () 4 ()Yana et al [1] 9703 9524 9748 9682Tang et al [7] 9608 9429 9664 9606Ruan et al [22] 9423 9245 9422 9379Proposed method 9802 9619 9831 9762

8 Journal of Electrical and Computer Engineering

Computational Learning Ceory (Eurocolt) Vol 904Springer Berlin Germany 1995

[20] Y Freund and E S Robert ldquoExperiments with a new boostingalgorithmrdquo in Proceedings of Cirteenth International Con-ference pp 148ndash156 Bari Italy July 1996

[21] Caltech Cars Dataset httpwwwrobotsoxacuksimvggdata3html

[22] Yu-S Ruan I-C Chang and H-Y Yeh ldquoVehicle detectionbased on wheel part detectionrdquo in Proceedings of IEEE In-ternational Conference on Consumer Electronics-Taiwan(ICCE-TW) pp 187-188 Taipei Taiwan June 2017

Journal of Electrical and Computer Engineering 9

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom

Page 2: Real-Time Vehicle Detection Using Cross-Correlation and ...downloads.hindawi.com/journals/jece/2019/6375176.pdfvehicles “red bounding box” and hypothesis of nearby ve-hicles “green

vehicles where the detection method is based on the de-tection of rear lights by looking for the red representation inthe image and they used the function of symmetry measureto analyse the symmetry of the color distribution and de-termine the specific position of axis of the symmetry Af-terwards the pair of edges are determined to rebuild theintegrated edges of a vehicle

After the hypotheses generation step the generatedhypotheses should be classified either as vehicles or not Inthis step two essential operations are needed feature ex-traction and classification Various methods are proposed toovercome this step +e Haar-like feature extraction methodis usually used which is a robust and rapid method whichuses the integral image but the problem resides in the hugenumber of the output features Usually dimensionality re-duction techniques [5 6] are required for the high-dimensional features +e Haar-like method was a goodpartner for many classifiers In [7ndash9] the Haar-like methodwas combined with the SVMs classifier Also the Haar-likecombination method and the AdaBoost classifier have beenused in [10ndash12] Other famous features extraction methodsare also used such as the histogram of oriented gradients(HOG) Gabor filters and Gradient features In [1] theAdaBoost and SVMs classifiers are trained by the combinedHOGrsquos features In [13] a new descriptor is proposed forvehicle verification using the alternative family of functionsof log Gabor instead of the existing descriptors based on theGabor filter Descriptors which are based on Gabor filtershave presented good results and showed good performancein extracting features [14] A system that detects rear ofvehicles in real time based on the AdaBoost classificationmethod and the gradient features method for adaptive cruisecontrol application (ACC applications) is presented +eGradient features method is good at characterizing theobjects shape and appearance

In our proposition at the hypothesis generation stepvehicle candidates are determined by using cross-correlationafter preprocessing using edge detection to improve theresults +e cross-correlation is a common method whichhas been used to evaluate and compute the similarity degreebetween two compared images In the step of hypothesisverification the generated candidates in the previous stepare verified Two major operations are needed in this stepfeature extraction and classification For feature extractionthe third level of 2D-DWT is utilized which is a powerfultechnique for representing data at different scales and fre-quencies For classification two classifiers are used supportvector machines (SVMs) classifier and AdaBoost classifierand then their results are compared to get a reliable resultWe have tested these classifiers using real data However itneeds a large training set Currently we concentrate on thedaytime detection for various vehicle models and types Inour approach the vehicle candidates are generated using thehighly correlated zones +ese possible vehicle candidatesare then classified with AdaBoost and SVMs to removenonvehicle objects Figure 1 shows the overall flow diagramof the method

+e organization of the paper is as follows Section 2describes the hypothesis generation In Section 3 the

hypothesis verification method is presented +e experi-mental results are presented in Section 4 followed by theconclusion in Section 5

2 Hypothesis Generation

+e principal step in the vehicle detection system is thegeneration of hypothesis where in this step we should lookin the image for the places where vehicles may be found(zones of interest) In our proposition we perform first apreprocessing method using edge detection which acts animportant role in the performance of our method Afterperforming the preprocessing the cross-correlation is usedto detect the zones of interest which is an algorithm thatcalculates the similarity between a template and an image+e use of edge detection improves the result of the cross-correlation and also reduces the processing time

In this section the preprocessing and the cross-correlation techniques for initial candidate generation aretreated

21 Edge Detection +e best features that can be extractedfrom vehicles in the detection systems are corners colorshadows and horizontal edges and vertical edges +eshadows are good features to extract that can be utilized tofacilitate the hypothesis of vehicles However they are verydependent on image intensity that depends also on weatherconditions +e corner features can be found easily How-ever they can be corrupted easily due to the noise

In this paper the edge detection is used where thehorizontal edges and vertical edges are good features toextract Looking at the edges reduces the required in-formation because they replace a color image by a binaryimage in which objects and surface markings are outlined+ese image parts are the most informative ones

+e first step is to generate a global contour image fromthe input gray-scale image using the Canny edge detector[15]+e selection of the threshold values for the Canny edgedetector is not so critical as long as it generates enough edgesfor the symmetry detector +e edge detection was per-formed on the image and on the template Figure 2 shows theresult of edge detection performed on a typical road scenecaptured by the forward looking camera

+is technique improves the choice quality of the vehiclecandidates and it optimizes the processing time

22Cross-Correlation +e purpose is to identify areas in theimage that are probably vehicles However the problem is todetect the pattern position in images +e cross-correlationis utilized to achieve this purpose which is a standardmethod of estimating the degree of similarity in other wordsto estimate how much two images are correlated [16]+erefore the vehicle hypotheses in the images are foundbased on the similarity degree between template images andtest images Figure 3 shows a template image example

+e function of cross-correlation between the image andthe template is defined as

2 Journal of Electrical and Computer Engineering

ρ sumij

(x(i j) minus x)(y(i j) minus y)σxσy

(1)

where x(i j) is the part of the image shared by template andx is the mean of x(i j) y(i j) is the template and y is themean of y(i j) and σx and σy are the standard deviations of

x(i j) and y(i j) respectively e function ρ varies be-tween minus1 and +1 where the good correlation state is foundwhen the ρ function takes values near +1 (ie when rstfunction increases the second one does too in proportion)the uncorrelated state is found when the ρ function takesvalues near 0 (ie no relation between variation in the rstfunction and the second one) and the anti-correlated state isdetected when the ρ function takes values near minus1 (ie whenthe rst function decreases the second increases in pro-portion) e best match occurs when templates and testimages have maximum ρ Multiple candidate locations canbe found by using this technique

e problem of matching using cross-correlation is thatit detects the similarity between template and a part of theimage only if they have almost the same size or a little bitbigger or smaller size which means that we can detect ve-hicles just in a predened distance in other words we candetect only far vehicles or near vehicles In our propositionto overcome this problem we chose to work with fourdierent templatersquos sizes Two smaller sizes are used to detectfar and very far vehicles and two bigger sizes are used todetect close and very close vehicles We do not need varioussizes because the farthest vehicles are not that importantDierent hypotheses of dierent vehicles are generatedusing few templates even if they have dierent shapes ortypes compared with the templates using the edge detectiontherefore there is no need to use templates for each vehicletype shape or texture In our case three templates in foursizes are enough to generate the hypotheses following thethree vehicles categories template for cars template forbuses and template for trucks Figure 4 shows an example ofcross-correlation result that generates the hypothesis of farvehicles ldquored bounding boxrdquo and hypothesis of nearby ve-hicles ldquogreen bounding boxrdquo

3 Hypothesis Verification

e hypothesis verication step acts an important role forvehicle detection e results of the previous step are the

Gray input image

sequence

Preprocessing (edge

detection)

Cross-correlation

Support vector

machinesadaboost

Detected vehicles

Hypothesis generation Hypothesis verification

Third level 2D-DWT

Figure 1 Overall ow diagram of our vehicle detection algorithm

Figure 2 Resulting image using the Canny edge detector

Figure 3 Example of a template

Journal of Electrical and Computer Engineering 3

positions in the image where vehicles may be found Howevernot all positions detected on the image belong to vehicles+erefore further verification is needed In the verificationstep two major methods are needed feature extractionmethod and classification method +e classifier is used toclassify the extracted features if they correspond to vehicles ornot Seeking the solutions to improve the vehicle detectionaccuracy and reduce the false detection rate while consideringthe real time we propose to use the two-dimensional discretewavelet transform for feature extraction AdaBoost and SVMsto classify these extracted features +e discrete wavelettransform (DWT) has a good location property in frequencyand time domains and it is an efficient method for featuresextraction +e AdaBoost and SVM classifiers are used inseveral studies and they showed a very good result

In this section the discrete wavelet transform and SVMsand AdaBoost classifiers are treated

31 Discrete Wavelet Transform Wavelet transform iswidely used in many applications because it reduces thecomputation cost and provides sharper timefrequency lo-calization [17] in contrary to the Fourier transform +ediscrete wavelet transform (DWT) is any wavelet transformfor which the wavelets are discretely sampled +e principalof DWT is to decompose the input signal into two sub-signals the detail and the approximation +e approxima-tion corresponds to the low frequency of the input signalwhich is the most energy of a signal and the detail corre-sponds to the high frequency of the input signal +istechnique can be repeated at multiple levels by taking theapproximation as an input signal +e same principal isapplied for images and the DWTdecomposes the image intofour subband images LL LH HL and HH subband images[18] as shown in Figure 5 +e LL subband image containsthe low-frequency component of the input image whichcorresponds to the approximation and HL LH and HHsubband images contain the high-frequency components ofthe input image which are the details

As shown in Figure 6 the low-pass filter and the high-pass filter are used first on the lines of the input imageldquoie verticallyrdquo and then on the columns ldquoie horizontallyrdquoFurthermore after each filtering operation a down samplingis used to reduce the overall number of computation +istechnique can be repeated at multiple levels until obtainingthe desired result as shown in Figure 7

In this study we have concentrated on the third level ofthe 2D-DWT +is technique is applied on each generatedcandidate and on the dataset images to extract features Weextract the important features that we need and it helps us toimprove the result of the classification

32 Support Vector Machines (SVMs) SVM is a popularmachine learning algorithm for classification It is a dis-tinctive classifier that defines a separation hyper plane basedon training data with its label (supervised learning) +isalgorithm generates the best hyper plane that classifies newexamples +e SVM algorithm principle is used to find thehyper plane that maximizes the distance between thetraining example classes which is called the margin

Figure 4 +e result of the cross-correlation

(a)

LL LH

HL HH

(b)

Figure 5 (a) First level of DWT (b) Subbands of the first level ofDWT

LL

High pass

Low pass

Low pass

High pass

High pass

2

2

LH

HL

HH

Low pass

Image2

2

2

2

Figure 6 +e structure of forward two-dimensional DWT

4 Journal of Electrical and Computer Engineering

+erefore the optimal separating hyper plane maximizes themargin of the training data

+e separating hyper plane is defined as

f(x) (ω middot x) + b (2)

where ω is known as the weight and b is called the bias+e margin is given as

M 2

ω (3)

According to this expression it is necessary to minimizeω to maximize the margin

+e classification function is given as

Cf 1113944i

ωi middot k x xi( 1113857 + b (4)

where xi is the support vector selected from trainingsamples x is the input vector k(x xi) is the kernel functionand ωi is the support vector weight (xi) which is determinedin the training process

In our paper radial basis function kernel (RBF kernel) isused and it gives good results compared to the other kernels+e RBF kernel function is given as

k x xi( 1113857 exp minusxminusx2

i

2δ21113888 11138891113888 1113889 (5)

+e SVMs are trained using the positive samples andnegative samples +e positive and negative vectors aretrained to be classified with the SVMs X is considered to be amember of class one only if Cf ge 0 otherwise x is considereda member of class two +e flowchart that illustrates theSVM classification is shown in Figure 8

33 AdaBoost Classifier AdaBoost (Adaptive boosting) wasproposed by Freund and Schapire in 1996 [19] It is a

supervised learning algorithm that classifies between positiveand negative examples and it aims at converting an ensembleof weak classifiers into strong classifier a single classifier mayclassify the objects poorly However when multiple classifiersare combined with selection of the training set at every it-eration and assigning right amount of weight in final votingwe can have good accuracy score for the overall classifier +ealgorithmrsquos input is a set of labeled training examples (xi yi)i 1 m where xi is an example and yi is its label thatindicates if xi is a positive or negative example Every weakclassifier is noted as function ht(x) that returns one of the twovalues [+1minus1] ht(x) is +1 if x is classified as a positiveexample and ht(x) is minus1 if x is classified as a negative ex-ample +e AdaBoost algorithm is shown in Algorithm 1according to [20]

Concerning training examples we give m labeled ex-amples (x1 y1) (xm ym) whither the xi isin X and thelabels yi isin minus1 +1 Dt is a distribution calculated on the m

training examples of each value of t 1 T and to find aweak hypothesis ht X⟶ minus1 +1 a weak learning algo-rithm is applied Where the weak learner purpose is to lookfor a weak hypothesis that has a low-weighted error εt

relative to Dt +e weighted combination sign of the weakhypotheses is computed to determineH the final hypothesis

34 Preparation of Input Data

341 Training Process To train the classifier we shouldprepare the templates first by normalizing them to 158 times 154grayscale images then extracting the features using the thirdlevel of 2D-DWT and finally setting them in labeled vectors

342 Classification Process To classify the generated can-didates (zones of interest) we should normalize them to 158times 154 grayscale images and then extract the features usingthe third level of 2D-DWT and finally we construct a vectorusing the extracted features which will be the input of thetrained classifier and then obtain the results of theclassification

Figure 7 +ird level of 2D-DWT

Templates Test image

SVMs training SVMsclassification

Vehicle Nonvehicle

Figure 8 +e flowchart of SVM classification

Journal of Electrical and Computer Engineering 5

4 Experiment Results

41 Experimental Datasets +e database used in the ex-periments contains two parts +e first part was done bycombining the Caltech car database [21] and some imagesthat are captured manually from different situations whichwere used to train the classifier +e second part was col-lecting the videos in real traffic scenes which are utilized totest the hypothesis generation step and hypothesis verifi-cation step Some of the images contain vehicles and otherscontain background objects All images are normalized to158 times 154 pixels +is paper uses MATLAB R2015b as thesoftware development tool to test the proposed method +edevice configuration is 40GB memory DDR4 and 340GHzIntel(R) Core(TM) i5 CPU

+e Caltech car database included 1155 vehicle imagesfrom the rear and 1155 nonvehicle images +e real trafficscenes are captured by a camera mounted on the carwindshield +e real traffic scenes contain much in-terference such as traffic lines trees and billboards Figure 9shows some examples of the database

42 Performance Metrics To test the proposed system wecollected real traffic videos using a camera mounted on frontof a car +e vehicle detection was tested in various envi-ronments and it showed a good rate especially on thehighways

Some results of hypothesis generation using cross-correlation from different image sequences are shown inFigure 10+e trees beside the road and the rear window of acar generate some false hypothesis However the purpose ofthis step was to detect the potential vehicles location re-gardless of the amount of false candidates generated wherethe false candidates would be removed in the hypothesisverification step as shown in Figure 11

To evaluate the performance of the proposed methodthe statistical data and the accuracy of various testing caseswere recorded and are listed in Table 1 +e accuracy isdefined as follows

accuracy Td

Td + Mv + Fdtimes 100 (6)

where Td is the number of true detections Mv is the numberof missed vehicles and Fd is the number of false detections

In order to get the best results we have to look for anefficient classifier where the classification step is the mostimportant step in detection systems +erefore we haveused and compared two classifiers SVMs and AdaBoostwhich are two efficient methods of classification whichhave been used to verify and classify the extracted featuresby using 2D-DWTof the generated hypothesis +e use ofthese two classifiers gave really efficient results Howeverthe AdaBoost classifier gave a high accuracy of classifi-cation and showed more advantages than the SVMclassifier that also showed an important accuracy ofgenerated hypothesis classification +e most missed ve-hicles are missed due to the overlapping However thedetection of overlapping vehicles is done successfullybased on the percentage of vehicle parts hidden behindother vehicles If only small part of a vehicle is hidden itwill be generated in the hypothesis generation step andwill be detected otherwise it will not be detected +isproblem is not very important and the most important

Figure 9 Some vehicle training sample images

Input (x1 y1) (xm ym) is a set of labeled examples where xi belongs to X yi isin minus1 +1 Initialization D1(i) 1m for i 1 mFor t 1 TTrain the weak learner based on distribution DtObtain the weak hypotheses ht X⟶ Y minus1 +1

Select ht with low weighted errorεt 1113936

iht(x)neyDt(i)

If εt gt 12 then set T tminus 1 and abort loopChoose βt εt(1minus εt)Update Dt Dt+1(i) Dt(i)Zt times

βt if ht(xi) yi

1 otherwise1113896

Where Zt is a factor of normalization (chosen in a way that Dt+1 is a distribution)+e final hypothesis is given asH(x) sign (1113936

Tt1ln(1βt)ht(x) )

ALGORITHM 1

6 Journal of Electrical and Computer Engineering

problem is to detect vehicles directly in front of thecurrent vehicle

Table 1 shows the results of our vehicle detection system

43 Evaluation Results To evaluate our proposed work weuse three methods to compare with Yan et al [1] are basedon shadow under vehicle to detect the region of interest andthen used histograms of oriented gradients and the Ada-Boost classifier for vehicle detection Tang et al [7] are basedon the Haar-like features and the AdaBoost classifier todetect vehicles which is a very popular method Ruan et al[22] focused on wheel detection to detect vehicles +ey arebased on the HOG extractor and MB-LBP (multiblock localbinary pattern) with AdaBoost to detect vehiclersquos wheelsTable 2 shows the results of three different methods from

different scenes in different conditions compared to ourproposed method results and this comparison shows thatthe proposed method has the highest accuracy and confirms

(a) (b) (c)

Figure 10 Hypothesis generation result after cross-correlation (a) very close and very far generated candidates (b) very close and fargenerated candidates (c) close and far generated candidates

(a) (b)

(c) (d)

Figure 11 +e results of hypothesis verification step of the generated candidates

Table 1 Vehicle detection rates

Methods Video sequences1 2 3 4

Cross-correlation +2D-DWT + SVMs

TD 98 102 115 121MV 2 2 2 4FD 2 2 1 2

Accuracy () 9608 9623 9746 9527

Cross-correlation +2D-DWT +AdaBoost

TD 99 101 116 123MV 1 2 1 2FD 1 2 1 1

Accuracy () 9802 9619 9831 9762

Journal of Electrical and Computer Engineering 7

that it is able to detect vehicles in different conditions with ahigh accuracy and efficiency

5 Conclusion

A real-time vehicle detection system using a cameramounted on front of a car is proposed in this paper Wehave proposed a solution based on the cross-correlationmethod +e proposed system included two steps the hy-pothesis generation and hypothesis verification steps Firstlyin the hypothesis generation step the initial candidate se-lection is done by using the cross-correlation technique afterapplying the edge detection to improve the result and reducethe processing time +en in the hypothesis verification stepthe two-dimensional discrete wavelet transform has beenapplied on both selected candidates and dataset to extractfeatures Two famous classifier SVM and AdaBoost have beentrained using these extracted features Based on a comparisonof these two classifier results it was concluded that theAdaBoost classifier performed better in terms of accuracy thanSVMs that has also showed an interesting accuracy +e ex-perimental results presented in this paper showed that theproposed approach have good accuracy compared to othermethods

Data Availability

+e data used to support the findings of this study are in-cluded within the article [21]

Additional Points

Our perspectives include the improvement in hypothesisverification step by updating the AdaBoost classifier in orderto reduce the processing time and the distance measurementbetween the detected vehicles and the camera

Conflicts of Interest

+e authors declare that there are no conflicts of interest

References

[1] G Yana Y Ming Y Yang and L Fan ldquoReal-time vehicledetection using histograms of oriented gradients and Ada-Boost classificationrdquo Optik vol 127 no 19 pp 7941ndash79512016

[2] S T Soo and T Braunl ldquoSymmetry-based monocular vehicledetection systemrdquo Machine Vision and Applications vol 23no 5 pp 831ndash842 2012

[3] A Jazayeri H Cai Y Jiang Zheng andM Tuceryan ldquoVehicledetection and tracking in car video based on motion modelrdquoIEEE Transactions on Intelligent Transportation Systemsvol 12 no 2 pp 583ndash595 2011

[4] L Gao C Li T Fang and X Zhang ldquoVehicle detection basedon color and edge informationrdquo in ICIAR 2008 Vol 5112Springer Berlin Germany 2008

[5] J Li and D Tao ldquoSimple exponential family PCArdquo IEEETransactions on Neural Networks and Learning Systemsvol 24 no 3 pp 485ndash497 2013

[6] P J Cunningham and Z Ghahramani ldquoLinear di-mensionality reductionsurvey insights and generaliza-tionsrdquo Journal of Machine Learning Research vol 16pp 2859ndash2900 2015

[7] Y Tang C Zhang R Gu P Li and B Yang ldquoVehicle de-tection and recognition for intelligent traffic surveillancesystemrdquo Multimedia Tools and Applications vol 76 no 4pp 5817ndash5832 2015

[8] X Wen H Zhao N Wang and H Yuan ldquoA rear-vehicledetection system for static images based on monocular vi-sionrdquo in Proceedings of 9th International Conference onControl Automation Robotics and Vision pp 2421ndash2424Singapore March 2006

[9] W Liu X Wen B Duan et al ldquoRear vehicle detection andtracking for lane change assistrdquo in Proceedings of IEEE In-telligent Vehicles Symposium pp 252ndash257 Istanbul TurkeyJune 2007

[10] M M Moghimi M Nayeri M Pourahmadi andM KMoghimi ldquoMoving vehicle detection using AdaBoost andhaar-like feature in surveillance videosrdquo International Journalof Imaging and Robotics vol 18 no 1 pp 94ndash106 2018

[11] X Wen L Shao Y Xue and W Fang ldquoA rapid learningalgorithm for vehicle classificationrdquo Information Sciencesvol 295 pp 395ndash406 2015

[12] R Lienhart and J Maydt ldquoAn extended set of haarndashlikefeatures for rapid object detectionrdquo in Proceedings of IEEEInternational Conference on Image Processing pp 900ndash903Rochester NY USA January 2002

[13] J Arrospide and L Salgado ldquoLog-gabor filters for image-based vehicle verificationrdquo IEEE Transactions on ImageProcessing vol 22 no 6 pp 2286ndash2295 2013

[14] A Khammari F Nashashibi Y Abramson and C LaurgeauldquoVehicle detection combining gradient analysis and AdaBoostclassificationrdquo in Proceedings of 2005 IEEE IntelligentTransportation Systems pp 66ndash71 Vienna Austria Sep-tember 2005

[15] J Canny ldquoA computational approach to edge detectionrdquo IEEETransactions on Pattern Analysis and Machine Intelligencevol 8 no 6 pp 679ndash698 1986

[16] S-D Wei and S-H Lai ldquoFast template matching based onnormalized cross correlation with adaptive multilevel winnerupdaterdquo IEEE Transactions on Image Processing vol 17no 11 pp 2227ndash2235 2008

[17] I Daubechies ldquo+e wavelet transform time-frequency lo-calization and signal analysisrdquo IEEE Information Ceory So-ciety vol 36 no 5 pp 961ndash1005 1990

[18] I Slimani A Zaarane and A Hamdoun ldquoConvolutionalgorithm for implementing 2D discrete wavelet transformon the FPGArdquo in Proceedings of Computer Systems andApplications (AICCSA) 2016 IEEEACS 13th InternationalConference of IEEE pp 1ndash3 Agadir Morocco Novem-ber-December 2016

[19] Y Freund and R E Schapire ldquoA decision-theoretic gener-alization of online learning and an application to boostingrdquo in

Table 2 Evaluation results of 4 vehicle detection methods

MethodsVideo sequences

1 () 2 () 3 () 4 ()Yana et al [1] 9703 9524 9748 9682Tang et al [7] 9608 9429 9664 9606Ruan et al [22] 9423 9245 9422 9379Proposed method 9802 9619 9831 9762

8 Journal of Electrical and Computer Engineering

Computational Learning Ceory (Eurocolt) Vol 904Springer Berlin Germany 1995

[20] Y Freund and E S Robert ldquoExperiments with a new boostingalgorithmrdquo in Proceedings of Cirteenth International Con-ference pp 148ndash156 Bari Italy July 1996

[21] Caltech Cars Dataset httpwwwrobotsoxacuksimvggdata3html

[22] Yu-S Ruan I-C Chang and H-Y Yeh ldquoVehicle detectionbased on wheel part detectionrdquo in Proceedings of IEEE In-ternational Conference on Consumer Electronics-Taiwan(ICCE-TW) pp 187-188 Taipei Taiwan June 2017

Journal of Electrical and Computer Engineering 9

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom

Page 3: Real-Time Vehicle Detection Using Cross-Correlation and ...downloads.hindawi.com/journals/jece/2019/6375176.pdfvehicles “red bounding box” and hypothesis of nearby ve-hicles “green

ρ sumij

(x(i j) minus x)(y(i j) minus y)σxσy

(1)

where x(i j) is the part of the image shared by template andx is the mean of x(i j) y(i j) is the template and y is themean of y(i j) and σx and σy are the standard deviations of

x(i j) and y(i j) respectively e function ρ varies be-tween minus1 and +1 where the good correlation state is foundwhen the ρ function takes values near +1 (ie when rstfunction increases the second one does too in proportion)the uncorrelated state is found when the ρ function takesvalues near 0 (ie no relation between variation in the rstfunction and the second one) and the anti-correlated state isdetected when the ρ function takes values near minus1 (ie whenthe rst function decreases the second increases in pro-portion) e best match occurs when templates and testimages have maximum ρ Multiple candidate locations canbe found by using this technique

e problem of matching using cross-correlation is thatit detects the similarity between template and a part of theimage only if they have almost the same size or a little bitbigger or smaller size which means that we can detect ve-hicles just in a predened distance in other words we candetect only far vehicles or near vehicles In our propositionto overcome this problem we chose to work with fourdierent templatersquos sizes Two smaller sizes are used to detectfar and very far vehicles and two bigger sizes are used todetect close and very close vehicles We do not need varioussizes because the farthest vehicles are not that importantDierent hypotheses of dierent vehicles are generatedusing few templates even if they have dierent shapes ortypes compared with the templates using the edge detectiontherefore there is no need to use templates for each vehicletype shape or texture In our case three templates in foursizes are enough to generate the hypotheses following thethree vehicles categories template for cars template forbuses and template for trucks Figure 4 shows an example ofcross-correlation result that generates the hypothesis of farvehicles ldquored bounding boxrdquo and hypothesis of nearby ve-hicles ldquogreen bounding boxrdquo

3 Hypothesis Verification

e hypothesis verication step acts an important role forvehicle detection e results of the previous step are the

Gray input image

sequence

Preprocessing (edge

detection)

Cross-correlation

Support vector

machinesadaboost

Detected vehicles

Hypothesis generation Hypothesis verification

Third level 2D-DWT

Figure 1 Overall ow diagram of our vehicle detection algorithm

Figure 2 Resulting image using the Canny edge detector

Figure 3 Example of a template

Journal of Electrical and Computer Engineering 3

positions in the image where vehicles may be found Howevernot all positions detected on the image belong to vehicles+erefore further verification is needed In the verificationstep two major methods are needed feature extractionmethod and classification method +e classifier is used toclassify the extracted features if they correspond to vehicles ornot Seeking the solutions to improve the vehicle detectionaccuracy and reduce the false detection rate while consideringthe real time we propose to use the two-dimensional discretewavelet transform for feature extraction AdaBoost and SVMsto classify these extracted features +e discrete wavelettransform (DWT) has a good location property in frequencyand time domains and it is an efficient method for featuresextraction +e AdaBoost and SVM classifiers are used inseveral studies and they showed a very good result

In this section the discrete wavelet transform and SVMsand AdaBoost classifiers are treated

31 Discrete Wavelet Transform Wavelet transform iswidely used in many applications because it reduces thecomputation cost and provides sharper timefrequency lo-calization [17] in contrary to the Fourier transform +ediscrete wavelet transform (DWT) is any wavelet transformfor which the wavelets are discretely sampled +e principalof DWT is to decompose the input signal into two sub-signals the detail and the approximation +e approxima-tion corresponds to the low frequency of the input signalwhich is the most energy of a signal and the detail corre-sponds to the high frequency of the input signal +istechnique can be repeated at multiple levels by taking theapproximation as an input signal +e same principal isapplied for images and the DWTdecomposes the image intofour subband images LL LH HL and HH subband images[18] as shown in Figure 5 +e LL subband image containsthe low-frequency component of the input image whichcorresponds to the approximation and HL LH and HHsubband images contain the high-frequency components ofthe input image which are the details

As shown in Figure 6 the low-pass filter and the high-pass filter are used first on the lines of the input imageldquoie verticallyrdquo and then on the columns ldquoie horizontallyrdquoFurthermore after each filtering operation a down samplingis used to reduce the overall number of computation +istechnique can be repeated at multiple levels until obtainingthe desired result as shown in Figure 7

In this study we have concentrated on the third level ofthe 2D-DWT +is technique is applied on each generatedcandidate and on the dataset images to extract features Weextract the important features that we need and it helps us toimprove the result of the classification

32 Support Vector Machines (SVMs) SVM is a popularmachine learning algorithm for classification It is a dis-tinctive classifier that defines a separation hyper plane basedon training data with its label (supervised learning) +isalgorithm generates the best hyper plane that classifies newexamples +e SVM algorithm principle is used to find thehyper plane that maximizes the distance between thetraining example classes which is called the margin

Figure 4 +e result of the cross-correlation

(a)

LL LH

HL HH

(b)

Figure 5 (a) First level of DWT (b) Subbands of the first level ofDWT

LL

High pass

Low pass

Low pass

High pass

High pass

2

2

LH

HL

HH

Low pass

Image2

2

2

2

Figure 6 +e structure of forward two-dimensional DWT

4 Journal of Electrical and Computer Engineering

+erefore the optimal separating hyper plane maximizes themargin of the training data

+e separating hyper plane is defined as

f(x) (ω middot x) + b (2)

where ω is known as the weight and b is called the bias+e margin is given as

M 2

ω (3)

According to this expression it is necessary to minimizeω to maximize the margin

+e classification function is given as

Cf 1113944i

ωi middot k x xi( 1113857 + b (4)

where xi is the support vector selected from trainingsamples x is the input vector k(x xi) is the kernel functionand ωi is the support vector weight (xi) which is determinedin the training process

In our paper radial basis function kernel (RBF kernel) isused and it gives good results compared to the other kernels+e RBF kernel function is given as

k x xi( 1113857 exp minusxminusx2

i

2δ21113888 11138891113888 1113889 (5)

+e SVMs are trained using the positive samples andnegative samples +e positive and negative vectors aretrained to be classified with the SVMs X is considered to be amember of class one only if Cf ge 0 otherwise x is considereda member of class two +e flowchart that illustrates theSVM classification is shown in Figure 8

33 AdaBoost Classifier AdaBoost (Adaptive boosting) wasproposed by Freund and Schapire in 1996 [19] It is a

supervised learning algorithm that classifies between positiveand negative examples and it aims at converting an ensembleof weak classifiers into strong classifier a single classifier mayclassify the objects poorly However when multiple classifiersare combined with selection of the training set at every it-eration and assigning right amount of weight in final votingwe can have good accuracy score for the overall classifier +ealgorithmrsquos input is a set of labeled training examples (xi yi)i 1 m where xi is an example and yi is its label thatindicates if xi is a positive or negative example Every weakclassifier is noted as function ht(x) that returns one of the twovalues [+1minus1] ht(x) is +1 if x is classified as a positiveexample and ht(x) is minus1 if x is classified as a negative ex-ample +e AdaBoost algorithm is shown in Algorithm 1according to [20]

Concerning training examples we give m labeled ex-amples (x1 y1) (xm ym) whither the xi isin X and thelabels yi isin minus1 +1 Dt is a distribution calculated on the m

training examples of each value of t 1 T and to find aweak hypothesis ht X⟶ minus1 +1 a weak learning algo-rithm is applied Where the weak learner purpose is to lookfor a weak hypothesis that has a low-weighted error εt

relative to Dt +e weighted combination sign of the weakhypotheses is computed to determineH the final hypothesis

34 Preparation of Input Data

341 Training Process To train the classifier we shouldprepare the templates first by normalizing them to 158 times 154grayscale images then extracting the features using the thirdlevel of 2D-DWT and finally setting them in labeled vectors

342 Classification Process To classify the generated can-didates (zones of interest) we should normalize them to 158times 154 grayscale images and then extract the features usingthe third level of 2D-DWT and finally we construct a vectorusing the extracted features which will be the input of thetrained classifier and then obtain the results of theclassification

Figure 7 +ird level of 2D-DWT

Templates Test image

SVMs training SVMsclassification

Vehicle Nonvehicle

Figure 8 +e flowchart of SVM classification

Journal of Electrical and Computer Engineering 5

4 Experiment Results

41 Experimental Datasets +e database used in the ex-periments contains two parts +e first part was done bycombining the Caltech car database [21] and some imagesthat are captured manually from different situations whichwere used to train the classifier +e second part was col-lecting the videos in real traffic scenes which are utilized totest the hypothesis generation step and hypothesis verifi-cation step Some of the images contain vehicles and otherscontain background objects All images are normalized to158 times 154 pixels +is paper uses MATLAB R2015b as thesoftware development tool to test the proposed method +edevice configuration is 40GB memory DDR4 and 340GHzIntel(R) Core(TM) i5 CPU

+e Caltech car database included 1155 vehicle imagesfrom the rear and 1155 nonvehicle images +e real trafficscenes are captured by a camera mounted on the carwindshield +e real traffic scenes contain much in-terference such as traffic lines trees and billboards Figure 9shows some examples of the database

42 Performance Metrics To test the proposed system wecollected real traffic videos using a camera mounted on frontof a car +e vehicle detection was tested in various envi-ronments and it showed a good rate especially on thehighways

Some results of hypothesis generation using cross-correlation from different image sequences are shown inFigure 10+e trees beside the road and the rear window of acar generate some false hypothesis However the purpose ofthis step was to detect the potential vehicles location re-gardless of the amount of false candidates generated wherethe false candidates would be removed in the hypothesisverification step as shown in Figure 11

To evaluate the performance of the proposed methodthe statistical data and the accuracy of various testing caseswere recorded and are listed in Table 1 +e accuracy isdefined as follows

accuracy Td

Td + Mv + Fdtimes 100 (6)

where Td is the number of true detections Mv is the numberof missed vehicles and Fd is the number of false detections

In order to get the best results we have to look for anefficient classifier where the classification step is the mostimportant step in detection systems +erefore we haveused and compared two classifiers SVMs and AdaBoostwhich are two efficient methods of classification whichhave been used to verify and classify the extracted featuresby using 2D-DWTof the generated hypothesis +e use ofthese two classifiers gave really efficient results Howeverthe AdaBoost classifier gave a high accuracy of classifi-cation and showed more advantages than the SVMclassifier that also showed an important accuracy ofgenerated hypothesis classification +e most missed ve-hicles are missed due to the overlapping However thedetection of overlapping vehicles is done successfullybased on the percentage of vehicle parts hidden behindother vehicles If only small part of a vehicle is hidden itwill be generated in the hypothesis generation step andwill be detected otherwise it will not be detected +isproblem is not very important and the most important

Figure 9 Some vehicle training sample images

Input (x1 y1) (xm ym) is a set of labeled examples where xi belongs to X yi isin minus1 +1 Initialization D1(i) 1m for i 1 mFor t 1 TTrain the weak learner based on distribution DtObtain the weak hypotheses ht X⟶ Y minus1 +1

Select ht with low weighted errorεt 1113936

iht(x)neyDt(i)

If εt gt 12 then set T tminus 1 and abort loopChoose βt εt(1minus εt)Update Dt Dt+1(i) Dt(i)Zt times

βt if ht(xi) yi

1 otherwise1113896

Where Zt is a factor of normalization (chosen in a way that Dt+1 is a distribution)+e final hypothesis is given asH(x) sign (1113936

Tt1ln(1βt)ht(x) )

ALGORITHM 1

6 Journal of Electrical and Computer Engineering

problem is to detect vehicles directly in front of thecurrent vehicle

Table 1 shows the results of our vehicle detection system

43 Evaluation Results To evaluate our proposed work weuse three methods to compare with Yan et al [1] are basedon shadow under vehicle to detect the region of interest andthen used histograms of oriented gradients and the Ada-Boost classifier for vehicle detection Tang et al [7] are basedon the Haar-like features and the AdaBoost classifier todetect vehicles which is a very popular method Ruan et al[22] focused on wheel detection to detect vehicles +ey arebased on the HOG extractor and MB-LBP (multiblock localbinary pattern) with AdaBoost to detect vehiclersquos wheelsTable 2 shows the results of three different methods from

different scenes in different conditions compared to ourproposed method results and this comparison shows thatthe proposed method has the highest accuracy and confirms

(a) (b) (c)

Figure 10 Hypothesis generation result after cross-correlation (a) very close and very far generated candidates (b) very close and fargenerated candidates (c) close and far generated candidates

(a) (b)

(c) (d)

Figure 11 +e results of hypothesis verification step of the generated candidates

Table 1 Vehicle detection rates

Methods Video sequences1 2 3 4

Cross-correlation +2D-DWT + SVMs

TD 98 102 115 121MV 2 2 2 4FD 2 2 1 2

Accuracy () 9608 9623 9746 9527

Cross-correlation +2D-DWT +AdaBoost

TD 99 101 116 123MV 1 2 1 2FD 1 2 1 1

Accuracy () 9802 9619 9831 9762

Journal of Electrical and Computer Engineering 7

that it is able to detect vehicles in different conditions with ahigh accuracy and efficiency

5 Conclusion

A real-time vehicle detection system using a cameramounted on front of a car is proposed in this paper Wehave proposed a solution based on the cross-correlationmethod +e proposed system included two steps the hy-pothesis generation and hypothesis verification steps Firstlyin the hypothesis generation step the initial candidate se-lection is done by using the cross-correlation technique afterapplying the edge detection to improve the result and reducethe processing time +en in the hypothesis verification stepthe two-dimensional discrete wavelet transform has beenapplied on both selected candidates and dataset to extractfeatures Two famous classifier SVM and AdaBoost have beentrained using these extracted features Based on a comparisonof these two classifier results it was concluded that theAdaBoost classifier performed better in terms of accuracy thanSVMs that has also showed an interesting accuracy +e ex-perimental results presented in this paper showed that theproposed approach have good accuracy compared to othermethods

Data Availability

+e data used to support the findings of this study are in-cluded within the article [21]

Additional Points

Our perspectives include the improvement in hypothesisverification step by updating the AdaBoost classifier in orderto reduce the processing time and the distance measurementbetween the detected vehicles and the camera

Conflicts of Interest

+e authors declare that there are no conflicts of interest

References

[1] G Yana Y Ming Y Yang and L Fan ldquoReal-time vehicledetection using histograms of oriented gradients and Ada-Boost classificationrdquo Optik vol 127 no 19 pp 7941ndash79512016

[2] S T Soo and T Braunl ldquoSymmetry-based monocular vehicledetection systemrdquo Machine Vision and Applications vol 23no 5 pp 831ndash842 2012

[3] A Jazayeri H Cai Y Jiang Zheng andM Tuceryan ldquoVehicledetection and tracking in car video based on motion modelrdquoIEEE Transactions on Intelligent Transportation Systemsvol 12 no 2 pp 583ndash595 2011

[4] L Gao C Li T Fang and X Zhang ldquoVehicle detection basedon color and edge informationrdquo in ICIAR 2008 Vol 5112Springer Berlin Germany 2008

[5] J Li and D Tao ldquoSimple exponential family PCArdquo IEEETransactions on Neural Networks and Learning Systemsvol 24 no 3 pp 485ndash497 2013

[6] P J Cunningham and Z Ghahramani ldquoLinear di-mensionality reductionsurvey insights and generaliza-tionsrdquo Journal of Machine Learning Research vol 16pp 2859ndash2900 2015

[7] Y Tang C Zhang R Gu P Li and B Yang ldquoVehicle de-tection and recognition for intelligent traffic surveillancesystemrdquo Multimedia Tools and Applications vol 76 no 4pp 5817ndash5832 2015

[8] X Wen H Zhao N Wang and H Yuan ldquoA rear-vehicledetection system for static images based on monocular vi-sionrdquo in Proceedings of 9th International Conference onControl Automation Robotics and Vision pp 2421ndash2424Singapore March 2006

[9] W Liu X Wen B Duan et al ldquoRear vehicle detection andtracking for lane change assistrdquo in Proceedings of IEEE In-telligent Vehicles Symposium pp 252ndash257 Istanbul TurkeyJune 2007

[10] M M Moghimi M Nayeri M Pourahmadi andM KMoghimi ldquoMoving vehicle detection using AdaBoost andhaar-like feature in surveillance videosrdquo International Journalof Imaging and Robotics vol 18 no 1 pp 94ndash106 2018

[11] X Wen L Shao Y Xue and W Fang ldquoA rapid learningalgorithm for vehicle classificationrdquo Information Sciencesvol 295 pp 395ndash406 2015

[12] R Lienhart and J Maydt ldquoAn extended set of haarndashlikefeatures for rapid object detectionrdquo in Proceedings of IEEEInternational Conference on Image Processing pp 900ndash903Rochester NY USA January 2002

[13] J Arrospide and L Salgado ldquoLog-gabor filters for image-based vehicle verificationrdquo IEEE Transactions on ImageProcessing vol 22 no 6 pp 2286ndash2295 2013

[14] A Khammari F Nashashibi Y Abramson and C LaurgeauldquoVehicle detection combining gradient analysis and AdaBoostclassificationrdquo in Proceedings of 2005 IEEE IntelligentTransportation Systems pp 66ndash71 Vienna Austria Sep-tember 2005

[15] J Canny ldquoA computational approach to edge detectionrdquo IEEETransactions on Pattern Analysis and Machine Intelligencevol 8 no 6 pp 679ndash698 1986

[16] S-D Wei and S-H Lai ldquoFast template matching based onnormalized cross correlation with adaptive multilevel winnerupdaterdquo IEEE Transactions on Image Processing vol 17no 11 pp 2227ndash2235 2008

[17] I Daubechies ldquo+e wavelet transform time-frequency lo-calization and signal analysisrdquo IEEE Information Ceory So-ciety vol 36 no 5 pp 961ndash1005 1990

[18] I Slimani A Zaarane and A Hamdoun ldquoConvolutionalgorithm for implementing 2D discrete wavelet transformon the FPGArdquo in Proceedings of Computer Systems andApplications (AICCSA) 2016 IEEEACS 13th InternationalConference of IEEE pp 1ndash3 Agadir Morocco Novem-ber-December 2016

[19] Y Freund and R E Schapire ldquoA decision-theoretic gener-alization of online learning and an application to boostingrdquo in

Table 2 Evaluation results of 4 vehicle detection methods

MethodsVideo sequences

1 () 2 () 3 () 4 ()Yana et al [1] 9703 9524 9748 9682Tang et al [7] 9608 9429 9664 9606Ruan et al [22] 9423 9245 9422 9379Proposed method 9802 9619 9831 9762

8 Journal of Electrical and Computer Engineering

Computational Learning Ceory (Eurocolt) Vol 904Springer Berlin Germany 1995

[20] Y Freund and E S Robert ldquoExperiments with a new boostingalgorithmrdquo in Proceedings of Cirteenth International Con-ference pp 148ndash156 Bari Italy July 1996

[21] Caltech Cars Dataset httpwwwrobotsoxacuksimvggdata3html

[22] Yu-S Ruan I-C Chang and H-Y Yeh ldquoVehicle detectionbased on wheel part detectionrdquo in Proceedings of IEEE In-ternational Conference on Consumer Electronics-Taiwan(ICCE-TW) pp 187-188 Taipei Taiwan June 2017

Journal of Electrical and Computer Engineering 9

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom

Page 4: Real-Time Vehicle Detection Using Cross-Correlation and ...downloads.hindawi.com/journals/jece/2019/6375176.pdfvehicles “red bounding box” and hypothesis of nearby ve-hicles “green

positions in the image where vehicles may be found Howevernot all positions detected on the image belong to vehicles+erefore further verification is needed In the verificationstep two major methods are needed feature extractionmethod and classification method +e classifier is used toclassify the extracted features if they correspond to vehicles ornot Seeking the solutions to improve the vehicle detectionaccuracy and reduce the false detection rate while consideringthe real time we propose to use the two-dimensional discretewavelet transform for feature extraction AdaBoost and SVMsto classify these extracted features +e discrete wavelettransform (DWT) has a good location property in frequencyand time domains and it is an efficient method for featuresextraction +e AdaBoost and SVM classifiers are used inseveral studies and they showed a very good result

In this section the discrete wavelet transform and SVMsand AdaBoost classifiers are treated

31 Discrete Wavelet Transform Wavelet transform iswidely used in many applications because it reduces thecomputation cost and provides sharper timefrequency lo-calization [17] in contrary to the Fourier transform +ediscrete wavelet transform (DWT) is any wavelet transformfor which the wavelets are discretely sampled +e principalof DWT is to decompose the input signal into two sub-signals the detail and the approximation +e approxima-tion corresponds to the low frequency of the input signalwhich is the most energy of a signal and the detail corre-sponds to the high frequency of the input signal +istechnique can be repeated at multiple levels by taking theapproximation as an input signal +e same principal isapplied for images and the DWTdecomposes the image intofour subband images LL LH HL and HH subband images[18] as shown in Figure 5 +e LL subband image containsthe low-frequency component of the input image whichcorresponds to the approximation and HL LH and HHsubband images contain the high-frequency components ofthe input image which are the details

As shown in Figure 6 the low-pass filter and the high-pass filter are used first on the lines of the input imageldquoie verticallyrdquo and then on the columns ldquoie horizontallyrdquoFurthermore after each filtering operation a down samplingis used to reduce the overall number of computation +istechnique can be repeated at multiple levels until obtainingthe desired result as shown in Figure 7

In this study we have concentrated on the third level ofthe 2D-DWT +is technique is applied on each generatedcandidate and on the dataset images to extract features Weextract the important features that we need and it helps us toimprove the result of the classification

32 Support Vector Machines (SVMs) SVM is a popularmachine learning algorithm for classification It is a dis-tinctive classifier that defines a separation hyper plane basedon training data with its label (supervised learning) +isalgorithm generates the best hyper plane that classifies newexamples +e SVM algorithm principle is used to find thehyper plane that maximizes the distance between thetraining example classes which is called the margin

Figure 4 +e result of the cross-correlation

(a)

LL LH

HL HH

(b)

Figure 5 (a) First level of DWT (b) Subbands of the first level ofDWT

LL

High pass

Low pass

Low pass

High pass

High pass

2

2

LH

HL

HH

Low pass

Image2

2

2

2

Figure 6 +e structure of forward two-dimensional DWT

4 Journal of Electrical and Computer Engineering

+erefore the optimal separating hyper plane maximizes themargin of the training data

+e separating hyper plane is defined as

f(x) (ω middot x) + b (2)

where ω is known as the weight and b is called the bias+e margin is given as

M 2

ω (3)

According to this expression it is necessary to minimizeω to maximize the margin

+e classification function is given as

Cf 1113944i

ωi middot k x xi( 1113857 + b (4)

where xi is the support vector selected from trainingsamples x is the input vector k(x xi) is the kernel functionand ωi is the support vector weight (xi) which is determinedin the training process

In our paper radial basis function kernel (RBF kernel) isused and it gives good results compared to the other kernels+e RBF kernel function is given as

k x xi( 1113857 exp minusxminusx2

i

2δ21113888 11138891113888 1113889 (5)

+e SVMs are trained using the positive samples andnegative samples +e positive and negative vectors aretrained to be classified with the SVMs X is considered to be amember of class one only if Cf ge 0 otherwise x is considereda member of class two +e flowchart that illustrates theSVM classification is shown in Figure 8

33 AdaBoost Classifier AdaBoost (Adaptive boosting) wasproposed by Freund and Schapire in 1996 [19] It is a

supervised learning algorithm that classifies between positiveand negative examples and it aims at converting an ensembleof weak classifiers into strong classifier a single classifier mayclassify the objects poorly However when multiple classifiersare combined with selection of the training set at every it-eration and assigning right amount of weight in final votingwe can have good accuracy score for the overall classifier +ealgorithmrsquos input is a set of labeled training examples (xi yi)i 1 m where xi is an example and yi is its label thatindicates if xi is a positive or negative example Every weakclassifier is noted as function ht(x) that returns one of the twovalues [+1minus1] ht(x) is +1 if x is classified as a positiveexample and ht(x) is minus1 if x is classified as a negative ex-ample +e AdaBoost algorithm is shown in Algorithm 1according to [20]

Concerning training examples we give m labeled ex-amples (x1 y1) (xm ym) whither the xi isin X and thelabels yi isin minus1 +1 Dt is a distribution calculated on the m

training examples of each value of t 1 T and to find aweak hypothesis ht X⟶ minus1 +1 a weak learning algo-rithm is applied Where the weak learner purpose is to lookfor a weak hypothesis that has a low-weighted error εt

relative to Dt +e weighted combination sign of the weakhypotheses is computed to determineH the final hypothesis

34 Preparation of Input Data

341 Training Process To train the classifier we shouldprepare the templates first by normalizing them to 158 times 154grayscale images then extracting the features using the thirdlevel of 2D-DWT and finally setting them in labeled vectors

342 Classification Process To classify the generated can-didates (zones of interest) we should normalize them to 158times 154 grayscale images and then extract the features usingthe third level of 2D-DWT and finally we construct a vectorusing the extracted features which will be the input of thetrained classifier and then obtain the results of theclassification

Figure 7 +ird level of 2D-DWT

Templates Test image

SVMs training SVMsclassification

Vehicle Nonvehicle

Figure 8 +e flowchart of SVM classification

Journal of Electrical and Computer Engineering 5

4 Experiment Results

41 Experimental Datasets +e database used in the ex-periments contains two parts +e first part was done bycombining the Caltech car database [21] and some imagesthat are captured manually from different situations whichwere used to train the classifier +e second part was col-lecting the videos in real traffic scenes which are utilized totest the hypothesis generation step and hypothesis verifi-cation step Some of the images contain vehicles and otherscontain background objects All images are normalized to158 times 154 pixels +is paper uses MATLAB R2015b as thesoftware development tool to test the proposed method +edevice configuration is 40GB memory DDR4 and 340GHzIntel(R) Core(TM) i5 CPU

+e Caltech car database included 1155 vehicle imagesfrom the rear and 1155 nonvehicle images +e real trafficscenes are captured by a camera mounted on the carwindshield +e real traffic scenes contain much in-terference such as traffic lines trees and billboards Figure 9shows some examples of the database

42 Performance Metrics To test the proposed system wecollected real traffic videos using a camera mounted on frontof a car +e vehicle detection was tested in various envi-ronments and it showed a good rate especially on thehighways

Some results of hypothesis generation using cross-correlation from different image sequences are shown inFigure 10+e trees beside the road and the rear window of acar generate some false hypothesis However the purpose ofthis step was to detect the potential vehicles location re-gardless of the amount of false candidates generated wherethe false candidates would be removed in the hypothesisverification step as shown in Figure 11

To evaluate the performance of the proposed methodthe statistical data and the accuracy of various testing caseswere recorded and are listed in Table 1 +e accuracy isdefined as follows

accuracy Td

Td + Mv + Fdtimes 100 (6)

where Td is the number of true detections Mv is the numberof missed vehicles and Fd is the number of false detections

In order to get the best results we have to look for anefficient classifier where the classification step is the mostimportant step in detection systems +erefore we haveused and compared two classifiers SVMs and AdaBoostwhich are two efficient methods of classification whichhave been used to verify and classify the extracted featuresby using 2D-DWTof the generated hypothesis +e use ofthese two classifiers gave really efficient results Howeverthe AdaBoost classifier gave a high accuracy of classifi-cation and showed more advantages than the SVMclassifier that also showed an important accuracy ofgenerated hypothesis classification +e most missed ve-hicles are missed due to the overlapping However thedetection of overlapping vehicles is done successfullybased on the percentage of vehicle parts hidden behindother vehicles If only small part of a vehicle is hidden itwill be generated in the hypothesis generation step andwill be detected otherwise it will not be detected +isproblem is not very important and the most important

Figure 9 Some vehicle training sample images

Input (x1 y1) (xm ym) is a set of labeled examples where xi belongs to X yi isin minus1 +1 Initialization D1(i) 1m for i 1 mFor t 1 TTrain the weak learner based on distribution DtObtain the weak hypotheses ht X⟶ Y minus1 +1

Select ht with low weighted errorεt 1113936

iht(x)neyDt(i)

If εt gt 12 then set T tminus 1 and abort loopChoose βt εt(1minus εt)Update Dt Dt+1(i) Dt(i)Zt times

βt if ht(xi) yi

1 otherwise1113896

Where Zt is a factor of normalization (chosen in a way that Dt+1 is a distribution)+e final hypothesis is given asH(x) sign (1113936

Tt1ln(1βt)ht(x) )

ALGORITHM 1

6 Journal of Electrical and Computer Engineering

problem is to detect vehicles directly in front of thecurrent vehicle

Table 1 shows the results of our vehicle detection system

43 Evaluation Results To evaluate our proposed work weuse three methods to compare with Yan et al [1] are basedon shadow under vehicle to detect the region of interest andthen used histograms of oriented gradients and the Ada-Boost classifier for vehicle detection Tang et al [7] are basedon the Haar-like features and the AdaBoost classifier todetect vehicles which is a very popular method Ruan et al[22] focused on wheel detection to detect vehicles +ey arebased on the HOG extractor and MB-LBP (multiblock localbinary pattern) with AdaBoost to detect vehiclersquos wheelsTable 2 shows the results of three different methods from

different scenes in different conditions compared to ourproposed method results and this comparison shows thatthe proposed method has the highest accuracy and confirms

(a) (b) (c)

Figure 10 Hypothesis generation result after cross-correlation (a) very close and very far generated candidates (b) very close and fargenerated candidates (c) close and far generated candidates

(a) (b)

(c) (d)

Figure 11 +e results of hypothesis verification step of the generated candidates

Table 1 Vehicle detection rates

Methods Video sequences1 2 3 4

Cross-correlation +2D-DWT + SVMs

TD 98 102 115 121MV 2 2 2 4FD 2 2 1 2

Accuracy () 9608 9623 9746 9527

Cross-correlation +2D-DWT +AdaBoost

TD 99 101 116 123MV 1 2 1 2FD 1 2 1 1

Accuracy () 9802 9619 9831 9762

Journal of Electrical and Computer Engineering 7

that it is able to detect vehicles in different conditions with ahigh accuracy and efficiency

5 Conclusion

A real-time vehicle detection system using a cameramounted on front of a car is proposed in this paper Wehave proposed a solution based on the cross-correlationmethod +e proposed system included two steps the hy-pothesis generation and hypothesis verification steps Firstlyin the hypothesis generation step the initial candidate se-lection is done by using the cross-correlation technique afterapplying the edge detection to improve the result and reducethe processing time +en in the hypothesis verification stepthe two-dimensional discrete wavelet transform has beenapplied on both selected candidates and dataset to extractfeatures Two famous classifier SVM and AdaBoost have beentrained using these extracted features Based on a comparisonof these two classifier results it was concluded that theAdaBoost classifier performed better in terms of accuracy thanSVMs that has also showed an interesting accuracy +e ex-perimental results presented in this paper showed that theproposed approach have good accuracy compared to othermethods

Data Availability

+e data used to support the findings of this study are in-cluded within the article [21]

Additional Points

Our perspectives include the improvement in hypothesisverification step by updating the AdaBoost classifier in orderto reduce the processing time and the distance measurementbetween the detected vehicles and the camera

Conflicts of Interest

+e authors declare that there are no conflicts of interest

References

[1] G Yana Y Ming Y Yang and L Fan ldquoReal-time vehicledetection using histograms of oriented gradients and Ada-Boost classificationrdquo Optik vol 127 no 19 pp 7941ndash79512016

[2] S T Soo and T Braunl ldquoSymmetry-based monocular vehicledetection systemrdquo Machine Vision and Applications vol 23no 5 pp 831ndash842 2012

[3] A Jazayeri H Cai Y Jiang Zheng andM Tuceryan ldquoVehicledetection and tracking in car video based on motion modelrdquoIEEE Transactions on Intelligent Transportation Systemsvol 12 no 2 pp 583ndash595 2011

[4] L Gao C Li T Fang and X Zhang ldquoVehicle detection basedon color and edge informationrdquo in ICIAR 2008 Vol 5112Springer Berlin Germany 2008

[5] J Li and D Tao ldquoSimple exponential family PCArdquo IEEETransactions on Neural Networks and Learning Systemsvol 24 no 3 pp 485ndash497 2013

[6] P J Cunningham and Z Ghahramani ldquoLinear di-mensionality reductionsurvey insights and generaliza-tionsrdquo Journal of Machine Learning Research vol 16pp 2859ndash2900 2015

[7] Y Tang C Zhang R Gu P Li and B Yang ldquoVehicle de-tection and recognition for intelligent traffic surveillancesystemrdquo Multimedia Tools and Applications vol 76 no 4pp 5817ndash5832 2015

[8] X Wen H Zhao N Wang and H Yuan ldquoA rear-vehicledetection system for static images based on monocular vi-sionrdquo in Proceedings of 9th International Conference onControl Automation Robotics and Vision pp 2421ndash2424Singapore March 2006

[9] W Liu X Wen B Duan et al ldquoRear vehicle detection andtracking for lane change assistrdquo in Proceedings of IEEE In-telligent Vehicles Symposium pp 252ndash257 Istanbul TurkeyJune 2007

[10] M M Moghimi M Nayeri M Pourahmadi andM KMoghimi ldquoMoving vehicle detection using AdaBoost andhaar-like feature in surveillance videosrdquo International Journalof Imaging and Robotics vol 18 no 1 pp 94ndash106 2018

[11] X Wen L Shao Y Xue and W Fang ldquoA rapid learningalgorithm for vehicle classificationrdquo Information Sciencesvol 295 pp 395ndash406 2015

[12] R Lienhart and J Maydt ldquoAn extended set of haarndashlikefeatures for rapid object detectionrdquo in Proceedings of IEEEInternational Conference on Image Processing pp 900ndash903Rochester NY USA January 2002

[13] J Arrospide and L Salgado ldquoLog-gabor filters for image-based vehicle verificationrdquo IEEE Transactions on ImageProcessing vol 22 no 6 pp 2286ndash2295 2013

[14] A Khammari F Nashashibi Y Abramson and C LaurgeauldquoVehicle detection combining gradient analysis and AdaBoostclassificationrdquo in Proceedings of 2005 IEEE IntelligentTransportation Systems pp 66ndash71 Vienna Austria Sep-tember 2005

[15] J Canny ldquoA computational approach to edge detectionrdquo IEEETransactions on Pattern Analysis and Machine Intelligencevol 8 no 6 pp 679ndash698 1986

[16] S-D Wei and S-H Lai ldquoFast template matching based onnormalized cross correlation with adaptive multilevel winnerupdaterdquo IEEE Transactions on Image Processing vol 17no 11 pp 2227ndash2235 2008

[17] I Daubechies ldquo+e wavelet transform time-frequency lo-calization and signal analysisrdquo IEEE Information Ceory So-ciety vol 36 no 5 pp 961ndash1005 1990

[18] I Slimani A Zaarane and A Hamdoun ldquoConvolutionalgorithm for implementing 2D discrete wavelet transformon the FPGArdquo in Proceedings of Computer Systems andApplications (AICCSA) 2016 IEEEACS 13th InternationalConference of IEEE pp 1ndash3 Agadir Morocco Novem-ber-December 2016

[19] Y Freund and R E Schapire ldquoA decision-theoretic gener-alization of online learning and an application to boostingrdquo in

Table 2 Evaluation results of 4 vehicle detection methods

MethodsVideo sequences

1 () 2 () 3 () 4 ()Yana et al [1] 9703 9524 9748 9682Tang et al [7] 9608 9429 9664 9606Ruan et al [22] 9423 9245 9422 9379Proposed method 9802 9619 9831 9762

8 Journal of Electrical and Computer Engineering

Computational Learning Ceory (Eurocolt) Vol 904Springer Berlin Germany 1995

[20] Y Freund and E S Robert ldquoExperiments with a new boostingalgorithmrdquo in Proceedings of Cirteenth International Con-ference pp 148ndash156 Bari Italy July 1996

[21] Caltech Cars Dataset httpwwwrobotsoxacuksimvggdata3html

[22] Yu-S Ruan I-C Chang and H-Y Yeh ldquoVehicle detectionbased on wheel part detectionrdquo in Proceedings of IEEE In-ternational Conference on Consumer Electronics-Taiwan(ICCE-TW) pp 187-188 Taipei Taiwan June 2017

Journal of Electrical and Computer Engineering 9

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom

Page 5: Real-Time Vehicle Detection Using Cross-Correlation and ...downloads.hindawi.com/journals/jece/2019/6375176.pdfvehicles “red bounding box” and hypothesis of nearby ve-hicles “green

+erefore the optimal separating hyper plane maximizes themargin of the training data

+e separating hyper plane is defined as

f(x) (ω middot x) + b (2)

where ω is known as the weight and b is called the bias+e margin is given as

M 2

ω (3)

According to this expression it is necessary to minimizeω to maximize the margin

+e classification function is given as

Cf 1113944i

ωi middot k x xi( 1113857 + b (4)

where xi is the support vector selected from trainingsamples x is the input vector k(x xi) is the kernel functionand ωi is the support vector weight (xi) which is determinedin the training process

In our paper radial basis function kernel (RBF kernel) isused and it gives good results compared to the other kernels+e RBF kernel function is given as

k x xi( 1113857 exp minusxminusx2

i

2δ21113888 11138891113888 1113889 (5)

+e SVMs are trained using the positive samples andnegative samples +e positive and negative vectors aretrained to be classified with the SVMs X is considered to be amember of class one only if Cf ge 0 otherwise x is considereda member of class two +e flowchart that illustrates theSVM classification is shown in Figure 8

33 AdaBoost Classifier AdaBoost (Adaptive boosting) wasproposed by Freund and Schapire in 1996 [19] It is a

supervised learning algorithm that classifies between positiveand negative examples and it aims at converting an ensembleof weak classifiers into strong classifier a single classifier mayclassify the objects poorly However when multiple classifiersare combined with selection of the training set at every it-eration and assigning right amount of weight in final votingwe can have good accuracy score for the overall classifier +ealgorithmrsquos input is a set of labeled training examples (xi yi)i 1 m where xi is an example and yi is its label thatindicates if xi is a positive or negative example Every weakclassifier is noted as function ht(x) that returns one of the twovalues [+1minus1] ht(x) is +1 if x is classified as a positiveexample and ht(x) is minus1 if x is classified as a negative ex-ample +e AdaBoost algorithm is shown in Algorithm 1according to [20]

Concerning training examples we give m labeled ex-amples (x1 y1) (xm ym) whither the xi isin X and thelabels yi isin minus1 +1 Dt is a distribution calculated on the m

training examples of each value of t 1 T and to find aweak hypothesis ht X⟶ minus1 +1 a weak learning algo-rithm is applied Where the weak learner purpose is to lookfor a weak hypothesis that has a low-weighted error εt

relative to Dt +e weighted combination sign of the weakhypotheses is computed to determineH the final hypothesis

34 Preparation of Input Data

341 Training Process To train the classifier we shouldprepare the templates first by normalizing them to 158 times 154grayscale images then extracting the features using the thirdlevel of 2D-DWT and finally setting them in labeled vectors

342 Classification Process To classify the generated can-didates (zones of interest) we should normalize them to 158times 154 grayscale images and then extract the features usingthe third level of 2D-DWT and finally we construct a vectorusing the extracted features which will be the input of thetrained classifier and then obtain the results of theclassification

Figure 7 +ird level of 2D-DWT

Templates Test image

SVMs training SVMsclassification

Vehicle Nonvehicle

Figure 8 +e flowchart of SVM classification

Journal of Electrical and Computer Engineering 5

4 Experiment Results

41 Experimental Datasets +e database used in the ex-periments contains two parts +e first part was done bycombining the Caltech car database [21] and some imagesthat are captured manually from different situations whichwere used to train the classifier +e second part was col-lecting the videos in real traffic scenes which are utilized totest the hypothesis generation step and hypothesis verifi-cation step Some of the images contain vehicles and otherscontain background objects All images are normalized to158 times 154 pixels +is paper uses MATLAB R2015b as thesoftware development tool to test the proposed method +edevice configuration is 40GB memory DDR4 and 340GHzIntel(R) Core(TM) i5 CPU

+e Caltech car database included 1155 vehicle imagesfrom the rear and 1155 nonvehicle images +e real trafficscenes are captured by a camera mounted on the carwindshield +e real traffic scenes contain much in-terference such as traffic lines trees and billboards Figure 9shows some examples of the database

42 Performance Metrics To test the proposed system wecollected real traffic videos using a camera mounted on frontof a car +e vehicle detection was tested in various envi-ronments and it showed a good rate especially on thehighways

Some results of hypothesis generation using cross-correlation from different image sequences are shown inFigure 10+e trees beside the road and the rear window of acar generate some false hypothesis However the purpose ofthis step was to detect the potential vehicles location re-gardless of the amount of false candidates generated wherethe false candidates would be removed in the hypothesisverification step as shown in Figure 11

To evaluate the performance of the proposed methodthe statistical data and the accuracy of various testing caseswere recorded and are listed in Table 1 +e accuracy isdefined as follows

accuracy Td

Td + Mv + Fdtimes 100 (6)

where Td is the number of true detections Mv is the numberof missed vehicles and Fd is the number of false detections

In order to get the best results we have to look for anefficient classifier where the classification step is the mostimportant step in detection systems +erefore we haveused and compared two classifiers SVMs and AdaBoostwhich are two efficient methods of classification whichhave been used to verify and classify the extracted featuresby using 2D-DWTof the generated hypothesis +e use ofthese two classifiers gave really efficient results Howeverthe AdaBoost classifier gave a high accuracy of classifi-cation and showed more advantages than the SVMclassifier that also showed an important accuracy ofgenerated hypothesis classification +e most missed ve-hicles are missed due to the overlapping However thedetection of overlapping vehicles is done successfullybased on the percentage of vehicle parts hidden behindother vehicles If only small part of a vehicle is hidden itwill be generated in the hypothesis generation step andwill be detected otherwise it will not be detected +isproblem is not very important and the most important

Figure 9 Some vehicle training sample images

Input (x1 y1) (xm ym) is a set of labeled examples where xi belongs to X yi isin minus1 +1 Initialization D1(i) 1m for i 1 mFor t 1 TTrain the weak learner based on distribution DtObtain the weak hypotheses ht X⟶ Y minus1 +1

Select ht with low weighted errorεt 1113936

iht(x)neyDt(i)

If εt gt 12 then set T tminus 1 and abort loopChoose βt εt(1minus εt)Update Dt Dt+1(i) Dt(i)Zt times

βt if ht(xi) yi

1 otherwise1113896

Where Zt is a factor of normalization (chosen in a way that Dt+1 is a distribution)+e final hypothesis is given asH(x) sign (1113936

Tt1ln(1βt)ht(x) )

ALGORITHM 1

6 Journal of Electrical and Computer Engineering

problem is to detect vehicles directly in front of thecurrent vehicle

Table 1 shows the results of our vehicle detection system

43 Evaluation Results To evaluate our proposed work weuse three methods to compare with Yan et al [1] are basedon shadow under vehicle to detect the region of interest andthen used histograms of oriented gradients and the Ada-Boost classifier for vehicle detection Tang et al [7] are basedon the Haar-like features and the AdaBoost classifier todetect vehicles which is a very popular method Ruan et al[22] focused on wheel detection to detect vehicles +ey arebased on the HOG extractor and MB-LBP (multiblock localbinary pattern) with AdaBoost to detect vehiclersquos wheelsTable 2 shows the results of three different methods from

different scenes in different conditions compared to ourproposed method results and this comparison shows thatthe proposed method has the highest accuracy and confirms

(a) (b) (c)

Figure 10 Hypothesis generation result after cross-correlation (a) very close and very far generated candidates (b) very close and fargenerated candidates (c) close and far generated candidates

(a) (b)

(c) (d)

Figure 11 +e results of hypothesis verification step of the generated candidates

Table 1 Vehicle detection rates

Methods Video sequences1 2 3 4

Cross-correlation +2D-DWT + SVMs

TD 98 102 115 121MV 2 2 2 4FD 2 2 1 2

Accuracy () 9608 9623 9746 9527

Cross-correlation +2D-DWT +AdaBoost

TD 99 101 116 123MV 1 2 1 2FD 1 2 1 1

Accuracy () 9802 9619 9831 9762

Journal of Electrical and Computer Engineering 7

that it is able to detect vehicles in different conditions with ahigh accuracy and efficiency

5 Conclusion

A real-time vehicle detection system using a cameramounted on front of a car is proposed in this paper Wehave proposed a solution based on the cross-correlationmethod +e proposed system included two steps the hy-pothesis generation and hypothesis verification steps Firstlyin the hypothesis generation step the initial candidate se-lection is done by using the cross-correlation technique afterapplying the edge detection to improve the result and reducethe processing time +en in the hypothesis verification stepthe two-dimensional discrete wavelet transform has beenapplied on both selected candidates and dataset to extractfeatures Two famous classifier SVM and AdaBoost have beentrained using these extracted features Based on a comparisonof these two classifier results it was concluded that theAdaBoost classifier performed better in terms of accuracy thanSVMs that has also showed an interesting accuracy +e ex-perimental results presented in this paper showed that theproposed approach have good accuracy compared to othermethods

Data Availability

+e data used to support the findings of this study are in-cluded within the article [21]

Additional Points

Our perspectives include the improvement in hypothesisverification step by updating the AdaBoost classifier in orderto reduce the processing time and the distance measurementbetween the detected vehicles and the camera

Conflicts of Interest

+e authors declare that there are no conflicts of interest

References

[1] G Yana Y Ming Y Yang and L Fan ldquoReal-time vehicledetection using histograms of oriented gradients and Ada-Boost classificationrdquo Optik vol 127 no 19 pp 7941ndash79512016

[2] S T Soo and T Braunl ldquoSymmetry-based monocular vehicledetection systemrdquo Machine Vision and Applications vol 23no 5 pp 831ndash842 2012

[3] A Jazayeri H Cai Y Jiang Zheng andM Tuceryan ldquoVehicledetection and tracking in car video based on motion modelrdquoIEEE Transactions on Intelligent Transportation Systemsvol 12 no 2 pp 583ndash595 2011

[4] L Gao C Li T Fang and X Zhang ldquoVehicle detection basedon color and edge informationrdquo in ICIAR 2008 Vol 5112Springer Berlin Germany 2008

[5] J Li and D Tao ldquoSimple exponential family PCArdquo IEEETransactions on Neural Networks and Learning Systemsvol 24 no 3 pp 485ndash497 2013

[6] P J Cunningham and Z Ghahramani ldquoLinear di-mensionality reductionsurvey insights and generaliza-tionsrdquo Journal of Machine Learning Research vol 16pp 2859ndash2900 2015

[7] Y Tang C Zhang R Gu P Li and B Yang ldquoVehicle de-tection and recognition for intelligent traffic surveillancesystemrdquo Multimedia Tools and Applications vol 76 no 4pp 5817ndash5832 2015

[8] X Wen H Zhao N Wang and H Yuan ldquoA rear-vehicledetection system for static images based on monocular vi-sionrdquo in Proceedings of 9th International Conference onControl Automation Robotics and Vision pp 2421ndash2424Singapore March 2006

[9] W Liu X Wen B Duan et al ldquoRear vehicle detection andtracking for lane change assistrdquo in Proceedings of IEEE In-telligent Vehicles Symposium pp 252ndash257 Istanbul TurkeyJune 2007

[10] M M Moghimi M Nayeri M Pourahmadi andM KMoghimi ldquoMoving vehicle detection using AdaBoost andhaar-like feature in surveillance videosrdquo International Journalof Imaging and Robotics vol 18 no 1 pp 94ndash106 2018

[11] X Wen L Shao Y Xue and W Fang ldquoA rapid learningalgorithm for vehicle classificationrdquo Information Sciencesvol 295 pp 395ndash406 2015

[12] R Lienhart and J Maydt ldquoAn extended set of haarndashlikefeatures for rapid object detectionrdquo in Proceedings of IEEEInternational Conference on Image Processing pp 900ndash903Rochester NY USA January 2002

[13] J Arrospide and L Salgado ldquoLog-gabor filters for image-based vehicle verificationrdquo IEEE Transactions on ImageProcessing vol 22 no 6 pp 2286ndash2295 2013

[14] A Khammari F Nashashibi Y Abramson and C LaurgeauldquoVehicle detection combining gradient analysis and AdaBoostclassificationrdquo in Proceedings of 2005 IEEE IntelligentTransportation Systems pp 66ndash71 Vienna Austria Sep-tember 2005

[15] J Canny ldquoA computational approach to edge detectionrdquo IEEETransactions on Pattern Analysis and Machine Intelligencevol 8 no 6 pp 679ndash698 1986

[16] S-D Wei and S-H Lai ldquoFast template matching based onnormalized cross correlation with adaptive multilevel winnerupdaterdquo IEEE Transactions on Image Processing vol 17no 11 pp 2227ndash2235 2008

[17] I Daubechies ldquo+e wavelet transform time-frequency lo-calization and signal analysisrdquo IEEE Information Ceory So-ciety vol 36 no 5 pp 961ndash1005 1990

[18] I Slimani A Zaarane and A Hamdoun ldquoConvolutionalgorithm for implementing 2D discrete wavelet transformon the FPGArdquo in Proceedings of Computer Systems andApplications (AICCSA) 2016 IEEEACS 13th InternationalConference of IEEE pp 1ndash3 Agadir Morocco Novem-ber-December 2016

[19] Y Freund and R E Schapire ldquoA decision-theoretic gener-alization of online learning and an application to boostingrdquo in

Table 2 Evaluation results of 4 vehicle detection methods

MethodsVideo sequences

1 () 2 () 3 () 4 ()Yana et al [1] 9703 9524 9748 9682Tang et al [7] 9608 9429 9664 9606Ruan et al [22] 9423 9245 9422 9379Proposed method 9802 9619 9831 9762

8 Journal of Electrical and Computer Engineering

Computational Learning Ceory (Eurocolt) Vol 904Springer Berlin Germany 1995

[20] Y Freund and E S Robert ldquoExperiments with a new boostingalgorithmrdquo in Proceedings of Cirteenth International Con-ference pp 148ndash156 Bari Italy July 1996

[21] Caltech Cars Dataset httpwwwrobotsoxacuksimvggdata3html

[22] Yu-S Ruan I-C Chang and H-Y Yeh ldquoVehicle detectionbased on wheel part detectionrdquo in Proceedings of IEEE In-ternational Conference on Consumer Electronics-Taiwan(ICCE-TW) pp 187-188 Taipei Taiwan June 2017

Journal of Electrical and Computer Engineering 9

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom

Page 6: Real-Time Vehicle Detection Using Cross-Correlation and ...downloads.hindawi.com/journals/jece/2019/6375176.pdfvehicles “red bounding box” and hypothesis of nearby ve-hicles “green

4 Experiment Results

41 Experimental Datasets +e database used in the ex-periments contains two parts +e first part was done bycombining the Caltech car database [21] and some imagesthat are captured manually from different situations whichwere used to train the classifier +e second part was col-lecting the videos in real traffic scenes which are utilized totest the hypothesis generation step and hypothesis verifi-cation step Some of the images contain vehicles and otherscontain background objects All images are normalized to158 times 154 pixels +is paper uses MATLAB R2015b as thesoftware development tool to test the proposed method +edevice configuration is 40GB memory DDR4 and 340GHzIntel(R) Core(TM) i5 CPU

+e Caltech car database included 1155 vehicle imagesfrom the rear and 1155 nonvehicle images +e real trafficscenes are captured by a camera mounted on the carwindshield +e real traffic scenes contain much in-terference such as traffic lines trees and billboards Figure 9shows some examples of the database

42 Performance Metrics To test the proposed system wecollected real traffic videos using a camera mounted on frontof a car +e vehicle detection was tested in various envi-ronments and it showed a good rate especially on thehighways

Some results of hypothesis generation using cross-correlation from different image sequences are shown inFigure 10+e trees beside the road and the rear window of acar generate some false hypothesis However the purpose ofthis step was to detect the potential vehicles location re-gardless of the amount of false candidates generated wherethe false candidates would be removed in the hypothesisverification step as shown in Figure 11

To evaluate the performance of the proposed methodthe statistical data and the accuracy of various testing caseswere recorded and are listed in Table 1 +e accuracy isdefined as follows

accuracy Td

Td + Mv + Fdtimes 100 (6)

where Td is the number of true detections Mv is the numberof missed vehicles and Fd is the number of false detections

In order to get the best results we have to look for anefficient classifier where the classification step is the mostimportant step in detection systems +erefore we haveused and compared two classifiers SVMs and AdaBoostwhich are two efficient methods of classification whichhave been used to verify and classify the extracted featuresby using 2D-DWTof the generated hypothesis +e use ofthese two classifiers gave really efficient results Howeverthe AdaBoost classifier gave a high accuracy of classifi-cation and showed more advantages than the SVMclassifier that also showed an important accuracy ofgenerated hypothesis classification +e most missed ve-hicles are missed due to the overlapping However thedetection of overlapping vehicles is done successfullybased on the percentage of vehicle parts hidden behindother vehicles If only small part of a vehicle is hidden itwill be generated in the hypothesis generation step andwill be detected otherwise it will not be detected +isproblem is not very important and the most important

Figure 9 Some vehicle training sample images

Input (x1 y1) (xm ym) is a set of labeled examples where xi belongs to X yi isin minus1 +1 Initialization D1(i) 1m for i 1 mFor t 1 TTrain the weak learner based on distribution DtObtain the weak hypotheses ht X⟶ Y minus1 +1

Select ht with low weighted errorεt 1113936

iht(x)neyDt(i)

If εt gt 12 then set T tminus 1 and abort loopChoose βt εt(1minus εt)Update Dt Dt+1(i) Dt(i)Zt times

βt if ht(xi) yi

1 otherwise1113896

Where Zt is a factor of normalization (chosen in a way that Dt+1 is a distribution)+e final hypothesis is given asH(x) sign (1113936

Tt1ln(1βt)ht(x) )

ALGORITHM 1

6 Journal of Electrical and Computer Engineering

problem is to detect vehicles directly in front of thecurrent vehicle

Table 1 shows the results of our vehicle detection system

43 Evaluation Results To evaluate our proposed work weuse three methods to compare with Yan et al [1] are basedon shadow under vehicle to detect the region of interest andthen used histograms of oriented gradients and the Ada-Boost classifier for vehicle detection Tang et al [7] are basedon the Haar-like features and the AdaBoost classifier todetect vehicles which is a very popular method Ruan et al[22] focused on wheel detection to detect vehicles +ey arebased on the HOG extractor and MB-LBP (multiblock localbinary pattern) with AdaBoost to detect vehiclersquos wheelsTable 2 shows the results of three different methods from

different scenes in different conditions compared to ourproposed method results and this comparison shows thatthe proposed method has the highest accuracy and confirms

(a) (b) (c)

Figure 10 Hypothesis generation result after cross-correlation (a) very close and very far generated candidates (b) very close and fargenerated candidates (c) close and far generated candidates

(a) (b)

(c) (d)

Figure 11 +e results of hypothesis verification step of the generated candidates

Table 1 Vehicle detection rates

Methods Video sequences1 2 3 4

Cross-correlation +2D-DWT + SVMs

TD 98 102 115 121MV 2 2 2 4FD 2 2 1 2

Accuracy () 9608 9623 9746 9527

Cross-correlation +2D-DWT +AdaBoost

TD 99 101 116 123MV 1 2 1 2FD 1 2 1 1

Accuracy () 9802 9619 9831 9762

Journal of Electrical and Computer Engineering 7

that it is able to detect vehicles in different conditions with ahigh accuracy and efficiency

5 Conclusion

A real-time vehicle detection system using a cameramounted on front of a car is proposed in this paper Wehave proposed a solution based on the cross-correlationmethod +e proposed system included two steps the hy-pothesis generation and hypothesis verification steps Firstlyin the hypothesis generation step the initial candidate se-lection is done by using the cross-correlation technique afterapplying the edge detection to improve the result and reducethe processing time +en in the hypothesis verification stepthe two-dimensional discrete wavelet transform has beenapplied on both selected candidates and dataset to extractfeatures Two famous classifier SVM and AdaBoost have beentrained using these extracted features Based on a comparisonof these two classifier results it was concluded that theAdaBoost classifier performed better in terms of accuracy thanSVMs that has also showed an interesting accuracy +e ex-perimental results presented in this paper showed that theproposed approach have good accuracy compared to othermethods

Data Availability

+e data used to support the findings of this study are in-cluded within the article [21]

Additional Points

Our perspectives include the improvement in hypothesisverification step by updating the AdaBoost classifier in orderto reduce the processing time and the distance measurementbetween the detected vehicles and the camera

Conflicts of Interest

+e authors declare that there are no conflicts of interest

References

[1] G Yana Y Ming Y Yang and L Fan ldquoReal-time vehicledetection using histograms of oriented gradients and Ada-Boost classificationrdquo Optik vol 127 no 19 pp 7941ndash79512016

[2] S T Soo and T Braunl ldquoSymmetry-based monocular vehicledetection systemrdquo Machine Vision and Applications vol 23no 5 pp 831ndash842 2012

[3] A Jazayeri H Cai Y Jiang Zheng andM Tuceryan ldquoVehicledetection and tracking in car video based on motion modelrdquoIEEE Transactions on Intelligent Transportation Systemsvol 12 no 2 pp 583ndash595 2011

[4] L Gao C Li T Fang and X Zhang ldquoVehicle detection basedon color and edge informationrdquo in ICIAR 2008 Vol 5112Springer Berlin Germany 2008

[5] J Li and D Tao ldquoSimple exponential family PCArdquo IEEETransactions on Neural Networks and Learning Systemsvol 24 no 3 pp 485ndash497 2013

[6] P J Cunningham and Z Ghahramani ldquoLinear di-mensionality reductionsurvey insights and generaliza-tionsrdquo Journal of Machine Learning Research vol 16pp 2859ndash2900 2015

[7] Y Tang C Zhang R Gu P Li and B Yang ldquoVehicle de-tection and recognition for intelligent traffic surveillancesystemrdquo Multimedia Tools and Applications vol 76 no 4pp 5817ndash5832 2015

[8] X Wen H Zhao N Wang and H Yuan ldquoA rear-vehicledetection system for static images based on monocular vi-sionrdquo in Proceedings of 9th International Conference onControl Automation Robotics and Vision pp 2421ndash2424Singapore March 2006

[9] W Liu X Wen B Duan et al ldquoRear vehicle detection andtracking for lane change assistrdquo in Proceedings of IEEE In-telligent Vehicles Symposium pp 252ndash257 Istanbul TurkeyJune 2007

[10] M M Moghimi M Nayeri M Pourahmadi andM KMoghimi ldquoMoving vehicle detection using AdaBoost andhaar-like feature in surveillance videosrdquo International Journalof Imaging and Robotics vol 18 no 1 pp 94ndash106 2018

[11] X Wen L Shao Y Xue and W Fang ldquoA rapid learningalgorithm for vehicle classificationrdquo Information Sciencesvol 295 pp 395ndash406 2015

[12] R Lienhart and J Maydt ldquoAn extended set of haarndashlikefeatures for rapid object detectionrdquo in Proceedings of IEEEInternational Conference on Image Processing pp 900ndash903Rochester NY USA January 2002

[13] J Arrospide and L Salgado ldquoLog-gabor filters for image-based vehicle verificationrdquo IEEE Transactions on ImageProcessing vol 22 no 6 pp 2286ndash2295 2013

[14] A Khammari F Nashashibi Y Abramson and C LaurgeauldquoVehicle detection combining gradient analysis and AdaBoostclassificationrdquo in Proceedings of 2005 IEEE IntelligentTransportation Systems pp 66ndash71 Vienna Austria Sep-tember 2005

[15] J Canny ldquoA computational approach to edge detectionrdquo IEEETransactions on Pattern Analysis and Machine Intelligencevol 8 no 6 pp 679ndash698 1986

[16] S-D Wei and S-H Lai ldquoFast template matching based onnormalized cross correlation with adaptive multilevel winnerupdaterdquo IEEE Transactions on Image Processing vol 17no 11 pp 2227ndash2235 2008

[17] I Daubechies ldquo+e wavelet transform time-frequency lo-calization and signal analysisrdquo IEEE Information Ceory So-ciety vol 36 no 5 pp 961ndash1005 1990

[18] I Slimani A Zaarane and A Hamdoun ldquoConvolutionalgorithm for implementing 2D discrete wavelet transformon the FPGArdquo in Proceedings of Computer Systems andApplications (AICCSA) 2016 IEEEACS 13th InternationalConference of IEEE pp 1ndash3 Agadir Morocco Novem-ber-December 2016

[19] Y Freund and R E Schapire ldquoA decision-theoretic gener-alization of online learning and an application to boostingrdquo in

Table 2 Evaluation results of 4 vehicle detection methods

MethodsVideo sequences

1 () 2 () 3 () 4 ()Yana et al [1] 9703 9524 9748 9682Tang et al [7] 9608 9429 9664 9606Ruan et al [22] 9423 9245 9422 9379Proposed method 9802 9619 9831 9762

8 Journal of Electrical and Computer Engineering

Computational Learning Ceory (Eurocolt) Vol 904Springer Berlin Germany 1995

[20] Y Freund and E S Robert ldquoExperiments with a new boostingalgorithmrdquo in Proceedings of Cirteenth International Con-ference pp 148ndash156 Bari Italy July 1996

[21] Caltech Cars Dataset httpwwwrobotsoxacuksimvggdata3html

[22] Yu-S Ruan I-C Chang and H-Y Yeh ldquoVehicle detectionbased on wheel part detectionrdquo in Proceedings of IEEE In-ternational Conference on Consumer Electronics-Taiwan(ICCE-TW) pp 187-188 Taipei Taiwan June 2017

Journal of Electrical and Computer Engineering 9

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom

Page 7: Real-Time Vehicle Detection Using Cross-Correlation and ...downloads.hindawi.com/journals/jece/2019/6375176.pdfvehicles “red bounding box” and hypothesis of nearby ve-hicles “green

problem is to detect vehicles directly in front of thecurrent vehicle

Table 1 shows the results of our vehicle detection system

43 Evaluation Results To evaluate our proposed work weuse three methods to compare with Yan et al [1] are basedon shadow under vehicle to detect the region of interest andthen used histograms of oriented gradients and the Ada-Boost classifier for vehicle detection Tang et al [7] are basedon the Haar-like features and the AdaBoost classifier todetect vehicles which is a very popular method Ruan et al[22] focused on wheel detection to detect vehicles +ey arebased on the HOG extractor and MB-LBP (multiblock localbinary pattern) with AdaBoost to detect vehiclersquos wheelsTable 2 shows the results of three different methods from

different scenes in different conditions compared to ourproposed method results and this comparison shows thatthe proposed method has the highest accuracy and confirms

(a) (b) (c)

Figure 10 Hypothesis generation result after cross-correlation (a) very close and very far generated candidates (b) very close and fargenerated candidates (c) close and far generated candidates

(a) (b)

(c) (d)

Figure 11 +e results of hypothesis verification step of the generated candidates

Table 1 Vehicle detection rates

Methods Video sequences1 2 3 4

Cross-correlation +2D-DWT + SVMs

TD 98 102 115 121MV 2 2 2 4FD 2 2 1 2

Accuracy () 9608 9623 9746 9527

Cross-correlation +2D-DWT +AdaBoost

TD 99 101 116 123MV 1 2 1 2FD 1 2 1 1

Accuracy () 9802 9619 9831 9762

Journal of Electrical and Computer Engineering 7

that it is able to detect vehicles in different conditions with ahigh accuracy and efficiency

5 Conclusion

A real-time vehicle detection system using a cameramounted on front of a car is proposed in this paper Wehave proposed a solution based on the cross-correlationmethod +e proposed system included two steps the hy-pothesis generation and hypothesis verification steps Firstlyin the hypothesis generation step the initial candidate se-lection is done by using the cross-correlation technique afterapplying the edge detection to improve the result and reducethe processing time +en in the hypothesis verification stepthe two-dimensional discrete wavelet transform has beenapplied on both selected candidates and dataset to extractfeatures Two famous classifier SVM and AdaBoost have beentrained using these extracted features Based on a comparisonof these two classifier results it was concluded that theAdaBoost classifier performed better in terms of accuracy thanSVMs that has also showed an interesting accuracy +e ex-perimental results presented in this paper showed that theproposed approach have good accuracy compared to othermethods

Data Availability

+e data used to support the findings of this study are in-cluded within the article [21]

Additional Points

Our perspectives include the improvement in hypothesisverification step by updating the AdaBoost classifier in orderto reduce the processing time and the distance measurementbetween the detected vehicles and the camera

Conflicts of Interest

+e authors declare that there are no conflicts of interest

References

[1] G Yana Y Ming Y Yang and L Fan ldquoReal-time vehicledetection using histograms of oriented gradients and Ada-Boost classificationrdquo Optik vol 127 no 19 pp 7941ndash79512016

[2] S T Soo and T Braunl ldquoSymmetry-based monocular vehicledetection systemrdquo Machine Vision and Applications vol 23no 5 pp 831ndash842 2012

[3] A Jazayeri H Cai Y Jiang Zheng andM Tuceryan ldquoVehicledetection and tracking in car video based on motion modelrdquoIEEE Transactions on Intelligent Transportation Systemsvol 12 no 2 pp 583ndash595 2011

[4] L Gao C Li T Fang and X Zhang ldquoVehicle detection basedon color and edge informationrdquo in ICIAR 2008 Vol 5112Springer Berlin Germany 2008

[5] J Li and D Tao ldquoSimple exponential family PCArdquo IEEETransactions on Neural Networks and Learning Systemsvol 24 no 3 pp 485ndash497 2013

[6] P J Cunningham and Z Ghahramani ldquoLinear di-mensionality reductionsurvey insights and generaliza-tionsrdquo Journal of Machine Learning Research vol 16pp 2859ndash2900 2015

[7] Y Tang C Zhang R Gu P Li and B Yang ldquoVehicle de-tection and recognition for intelligent traffic surveillancesystemrdquo Multimedia Tools and Applications vol 76 no 4pp 5817ndash5832 2015

[8] X Wen H Zhao N Wang and H Yuan ldquoA rear-vehicledetection system for static images based on monocular vi-sionrdquo in Proceedings of 9th International Conference onControl Automation Robotics and Vision pp 2421ndash2424Singapore March 2006

[9] W Liu X Wen B Duan et al ldquoRear vehicle detection andtracking for lane change assistrdquo in Proceedings of IEEE In-telligent Vehicles Symposium pp 252ndash257 Istanbul TurkeyJune 2007

[10] M M Moghimi M Nayeri M Pourahmadi andM KMoghimi ldquoMoving vehicle detection using AdaBoost andhaar-like feature in surveillance videosrdquo International Journalof Imaging and Robotics vol 18 no 1 pp 94ndash106 2018

[11] X Wen L Shao Y Xue and W Fang ldquoA rapid learningalgorithm for vehicle classificationrdquo Information Sciencesvol 295 pp 395ndash406 2015

[12] R Lienhart and J Maydt ldquoAn extended set of haarndashlikefeatures for rapid object detectionrdquo in Proceedings of IEEEInternational Conference on Image Processing pp 900ndash903Rochester NY USA January 2002

[13] J Arrospide and L Salgado ldquoLog-gabor filters for image-based vehicle verificationrdquo IEEE Transactions on ImageProcessing vol 22 no 6 pp 2286ndash2295 2013

[14] A Khammari F Nashashibi Y Abramson and C LaurgeauldquoVehicle detection combining gradient analysis and AdaBoostclassificationrdquo in Proceedings of 2005 IEEE IntelligentTransportation Systems pp 66ndash71 Vienna Austria Sep-tember 2005

[15] J Canny ldquoA computational approach to edge detectionrdquo IEEETransactions on Pattern Analysis and Machine Intelligencevol 8 no 6 pp 679ndash698 1986

[16] S-D Wei and S-H Lai ldquoFast template matching based onnormalized cross correlation with adaptive multilevel winnerupdaterdquo IEEE Transactions on Image Processing vol 17no 11 pp 2227ndash2235 2008

[17] I Daubechies ldquo+e wavelet transform time-frequency lo-calization and signal analysisrdquo IEEE Information Ceory So-ciety vol 36 no 5 pp 961ndash1005 1990

[18] I Slimani A Zaarane and A Hamdoun ldquoConvolutionalgorithm for implementing 2D discrete wavelet transformon the FPGArdquo in Proceedings of Computer Systems andApplications (AICCSA) 2016 IEEEACS 13th InternationalConference of IEEE pp 1ndash3 Agadir Morocco Novem-ber-December 2016

[19] Y Freund and R E Schapire ldquoA decision-theoretic gener-alization of online learning and an application to boostingrdquo in

Table 2 Evaluation results of 4 vehicle detection methods

MethodsVideo sequences

1 () 2 () 3 () 4 ()Yana et al [1] 9703 9524 9748 9682Tang et al [7] 9608 9429 9664 9606Ruan et al [22] 9423 9245 9422 9379Proposed method 9802 9619 9831 9762

8 Journal of Electrical and Computer Engineering

Computational Learning Ceory (Eurocolt) Vol 904Springer Berlin Germany 1995

[20] Y Freund and E S Robert ldquoExperiments with a new boostingalgorithmrdquo in Proceedings of Cirteenth International Con-ference pp 148ndash156 Bari Italy July 1996

[21] Caltech Cars Dataset httpwwwrobotsoxacuksimvggdata3html

[22] Yu-S Ruan I-C Chang and H-Y Yeh ldquoVehicle detectionbased on wheel part detectionrdquo in Proceedings of IEEE In-ternational Conference on Consumer Electronics-Taiwan(ICCE-TW) pp 187-188 Taipei Taiwan June 2017

Journal of Electrical and Computer Engineering 9

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom

Page 8: Real-Time Vehicle Detection Using Cross-Correlation and ...downloads.hindawi.com/journals/jece/2019/6375176.pdfvehicles “red bounding box” and hypothesis of nearby ve-hicles “green

that it is able to detect vehicles in different conditions with ahigh accuracy and efficiency

5 Conclusion

A real-time vehicle detection system using a cameramounted on front of a car is proposed in this paper Wehave proposed a solution based on the cross-correlationmethod +e proposed system included two steps the hy-pothesis generation and hypothesis verification steps Firstlyin the hypothesis generation step the initial candidate se-lection is done by using the cross-correlation technique afterapplying the edge detection to improve the result and reducethe processing time +en in the hypothesis verification stepthe two-dimensional discrete wavelet transform has beenapplied on both selected candidates and dataset to extractfeatures Two famous classifier SVM and AdaBoost have beentrained using these extracted features Based on a comparisonof these two classifier results it was concluded that theAdaBoost classifier performed better in terms of accuracy thanSVMs that has also showed an interesting accuracy +e ex-perimental results presented in this paper showed that theproposed approach have good accuracy compared to othermethods

Data Availability

+e data used to support the findings of this study are in-cluded within the article [21]

Additional Points

Our perspectives include the improvement in hypothesisverification step by updating the AdaBoost classifier in orderto reduce the processing time and the distance measurementbetween the detected vehicles and the camera

Conflicts of Interest

+e authors declare that there are no conflicts of interest

References

[1] G Yana Y Ming Y Yang and L Fan ldquoReal-time vehicledetection using histograms of oriented gradients and Ada-Boost classificationrdquo Optik vol 127 no 19 pp 7941ndash79512016

[2] S T Soo and T Braunl ldquoSymmetry-based monocular vehicledetection systemrdquo Machine Vision and Applications vol 23no 5 pp 831ndash842 2012

[3] A Jazayeri H Cai Y Jiang Zheng andM Tuceryan ldquoVehicledetection and tracking in car video based on motion modelrdquoIEEE Transactions on Intelligent Transportation Systemsvol 12 no 2 pp 583ndash595 2011

[4] L Gao C Li T Fang and X Zhang ldquoVehicle detection basedon color and edge informationrdquo in ICIAR 2008 Vol 5112Springer Berlin Germany 2008

[5] J Li and D Tao ldquoSimple exponential family PCArdquo IEEETransactions on Neural Networks and Learning Systemsvol 24 no 3 pp 485ndash497 2013

[6] P J Cunningham and Z Ghahramani ldquoLinear di-mensionality reductionsurvey insights and generaliza-tionsrdquo Journal of Machine Learning Research vol 16pp 2859ndash2900 2015

[7] Y Tang C Zhang R Gu P Li and B Yang ldquoVehicle de-tection and recognition for intelligent traffic surveillancesystemrdquo Multimedia Tools and Applications vol 76 no 4pp 5817ndash5832 2015

[8] X Wen H Zhao N Wang and H Yuan ldquoA rear-vehicledetection system for static images based on monocular vi-sionrdquo in Proceedings of 9th International Conference onControl Automation Robotics and Vision pp 2421ndash2424Singapore March 2006

[9] W Liu X Wen B Duan et al ldquoRear vehicle detection andtracking for lane change assistrdquo in Proceedings of IEEE In-telligent Vehicles Symposium pp 252ndash257 Istanbul TurkeyJune 2007

[10] M M Moghimi M Nayeri M Pourahmadi andM KMoghimi ldquoMoving vehicle detection using AdaBoost andhaar-like feature in surveillance videosrdquo International Journalof Imaging and Robotics vol 18 no 1 pp 94ndash106 2018

[11] X Wen L Shao Y Xue and W Fang ldquoA rapid learningalgorithm for vehicle classificationrdquo Information Sciencesvol 295 pp 395ndash406 2015

[12] R Lienhart and J Maydt ldquoAn extended set of haarndashlikefeatures for rapid object detectionrdquo in Proceedings of IEEEInternational Conference on Image Processing pp 900ndash903Rochester NY USA January 2002

[13] J Arrospide and L Salgado ldquoLog-gabor filters for image-based vehicle verificationrdquo IEEE Transactions on ImageProcessing vol 22 no 6 pp 2286ndash2295 2013

[14] A Khammari F Nashashibi Y Abramson and C LaurgeauldquoVehicle detection combining gradient analysis and AdaBoostclassificationrdquo in Proceedings of 2005 IEEE IntelligentTransportation Systems pp 66ndash71 Vienna Austria Sep-tember 2005

[15] J Canny ldquoA computational approach to edge detectionrdquo IEEETransactions on Pattern Analysis and Machine Intelligencevol 8 no 6 pp 679ndash698 1986

[16] S-D Wei and S-H Lai ldquoFast template matching based onnormalized cross correlation with adaptive multilevel winnerupdaterdquo IEEE Transactions on Image Processing vol 17no 11 pp 2227ndash2235 2008

[17] I Daubechies ldquo+e wavelet transform time-frequency lo-calization and signal analysisrdquo IEEE Information Ceory So-ciety vol 36 no 5 pp 961ndash1005 1990

[18] I Slimani A Zaarane and A Hamdoun ldquoConvolutionalgorithm for implementing 2D discrete wavelet transformon the FPGArdquo in Proceedings of Computer Systems andApplications (AICCSA) 2016 IEEEACS 13th InternationalConference of IEEE pp 1ndash3 Agadir Morocco Novem-ber-December 2016

[19] Y Freund and R E Schapire ldquoA decision-theoretic gener-alization of online learning and an application to boostingrdquo in

Table 2 Evaluation results of 4 vehicle detection methods

MethodsVideo sequences

1 () 2 () 3 () 4 ()Yana et al [1] 9703 9524 9748 9682Tang et al [7] 9608 9429 9664 9606Ruan et al [22] 9423 9245 9422 9379Proposed method 9802 9619 9831 9762

8 Journal of Electrical and Computer Engineering

Computational Learning Ceory (Eurocolt) Vol 904Springer Berlin Germany 1995

[20] Y Freund and E S Robert ldquoExperiments with a new boostingalgorithmrdquo in Proceedings of Cirteenth International Con-ference pp 148ndash156 Bari Italy July 1996

[21] Caltech Cars Dataset httpwwwrobotsoxacuksimvggdata3html

[22] Yu-S Ruan I-C Chang and H-Y Yeh ldquoVehicle detectionbased on wheel part detectionrdquo in Proceedings of IEEE In-ternational Conference on Consumer Electronics-Taiwan(ICCE-TW) pp 187-188 Taipei Taiwan June 2017

Journal of Electrical and Computer Engineering 9

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom

Page 9: Real-Time Vehicle Detection Using Cross-Correlation and ...downloads.hindawi.com/journals/jece/2019/6375176.pdfvehicles “red bounding box” and hypothesis of nearby ve-hicles “green

Computational Learning Ceory (Eurocolt) Vol 904Springer Berlin Germany 1995

[20] Y Freund and E S Robert ldquoExperiments with a new boostingalgorithmrdquo in Proceedings of Cirteenth International Con-ference pp 148ndash156 Bari Italy July 1996

[21] Caltech Cars Dataset httpwwwrobotsoxacuksimvggdata3html

[22] Yu-S Ruan I-C Chang and H-Y Yeh ldquoVehicle detectionbased on wheel part detectionrdquo in Proceedings of IEEE In-ternational Conference on Consumer Electronics-Taiwan(ICCE-TW) pp 187-188 Taipei Taiwan June 2017

Journal of Electrical and Computer Engineering 9

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom

Page 10: Real-Time Vehicle Detection Using Cross-Correlation and ...downloads.hindawi.com/journals/jece/2019/6375176.pdfvehicles “red bounding box” and hypothesis of nearby ve-hicles “green

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom