# Introduction ision based traffic surveillance system has become an active area of research interest over the past decade in the developed countries. This is a potential area of research as it has some significant applications. In Bangladesh traffic jam is very common an unpredictable. Due to limitation of work force, authorities are unable to find the reason and control this. It is of interest to digitally process and analyze these videos in real-time in order to extract reliable data on traffic flow and to detect traffic events. For example, because of such video analysis, traffic density in major arteries can be estimated and the least congested routes and travel time estimates can be computed. This information can be achieved by counting vehicles passing through the roads. By implementing this, the authority can have the information of traffic flow on a particular road on a particular time, measure rush and reduce the problem. This type of traffic surveillance system is becoming popular in many countries. The proposed method needs two major things to be implemented: i) Detecting and counting vehicles, ii) Generate necessary information to be used to maintain the traffic. Many approaches have been introduced for vehicle detection. Some available methods uses lidar, radar and computer vision. As camera is cheaper than radar or lidar, vision based vehicle detection and classification has become more popular than lidar or radar based detection system. Though computational power has increased dramatically, vehicle detection and classification is not an easy task. The problem is the dynamic environment of the road. The condition of the road cannot be predicted. There can be many human made infrastructures; pedestrians, which makes this, task a difficult one. In addition, there are change in background, illusion and heterogeneity of vehicles. # II. # Related Works Background subtraction based method is used by [1] for detection. Deep neural network based detection and classification model [2] is very expensive in terms of computational resources and time and is not suitable in real time. Niluthpalet. al. [3] generates time spatial images from video frames and gain a very good speed and accuracy in detection. Vehicle detection approaches can be divided into two broad categories: appearance based and motion based methods. Camera placement plays a significant role in video-based vehicle detection. Camera can be moving or static. As occlusion is the main problem in vision based detection system, camera should be placed in some position that minimizes the probability of occlusion. Camera placement depends on the appearance of the vehicles. In [3] camera is placed in an over bridge for taking both incoming and outgoing vehicles. It takes both front and rear view of vehicles. Broggi et al. [4] placed a camera to capture the side view of vehicles. Sivram and Trevedi [5] mounted camera in front of the moving vehicles that capture the rear view of front side vehicles. For static camera, good choice is some higher position than the level of vehicles that reduces the chances of occlusion. This decreases the chance of partial occlusion caused by vehicles but vehicles appearance changes from first lane to third len or fourth len. Yong Tang [6] placed the camera in a high position like over bridge and capture the front view of the vehicles To detect vehicles from a frame, features are extracted from the frames. Many types of features have been introduced for vehicle detection so far. Sivram and Trevedi [7] used edge features to highlight the side of a vehicle and cast shadow. In recent years, some strong features due to the robustness and reliability replace simple features like edges or corners. These features are commonly used in computer vision for both detection and classification. Histogram of oriented gradient (HOG) was extremely well represented for vehicle detection as well as object detection. Inspired by human detection method [8] of Dalal and Triggs [9] has used HOG features nicely to detect vehicles. At first they compute gradients from the images and extract HOG features. A linear SVM classifier trains the extracted features. Though HOG features provide a very good detection rate, the main drawback is its calculation speed. As classification will be done after detection, its speed should be good. Haar-like features have been used nicely for face detection. Haar-like features are calculated with the help of integral image. Integral image can be calculated at a very fast speed. Due to its calculation speed and successful use in face detection, it has been also used for vehicle detection in [10] and [11] successfully. Scale invariant feature transform (SIFT) [12] was used in [13] to detect rear faces of vehicles. Though this feature cannot provide better performance than HOG or Haar, it is considerably good in case of occlusion. Lin et al. [14] used a combination of SURF [15] and edge features to detect vehicles in the blind spot. Support vector machine (SVM) is a strong binary classifier. It has been widely used for vehicle detection. The combination of HOG features and SVM classifier have been used for vehicle detection in [9] and [16]. AdaBoost [17] is also widely used in real time vehicle detection. As the classification speed of AdaBoost classifiers is high, it has become popular in real time classification applications. A combination of Haar-like features and AdaBoost classification is used in [18] and [19] for vehicle's rear face detection and perform very good in real time. The purpose of the AdaBoost algorithm is to use the feature to discover the best weak classifiers to form a strong classifier, and has shown its capability to improve the performance of various detection and classification applications. Actually the strong classifier is an ensemble classifier composed of many weak classifiers that just better than a random guess. Tang et al. [6] also used this method successfully. This method is very fast and provide high accuracy. However, the main drawback of this method is high false positive rate. The method proposed in [18] and [19] achieve a accuracy of 98% with 3%-5% false positive rate which is not tolerable in these type of applications. Yong Tang [6] used this method and achieved good accuracy but had a false positive rate of 3%. This method is very fast and applicable in real time. But false positive rate can cause inapplicable in some sectors. In recent year deep neural network and model, based classification is being used to detect 3D vehicles. Both need high computational resources and execution time. Researchers have done some motion-based approaches. In [4], an adaptive background model was constructed, with vehicles detected based on motion that differentiated them from the background. Adaptive background modeling was also used in [20], especially to model the area where overtaking vehicles tend to appear in the cameras end of view. In [3] they used three virtual detection lines and generate time spatial image (TSI) from three frames. The vehicles present in a time spatial image is called TSI object blobs (TOBs). Then canny edges of TOB is generated. After that binary masks of the TOBs are obtained. Then vehicles are detected from multiple TOBs. This method generates a very good result with a good calculation speed and applicable in real time application. However, it is not suitable in conditions where there is heavy rush on the road and vehicles are moving in a low speed. After detecting the vehicles, we count the total number of vehicles. Bas, Erhan and Tekalp [21] proposed adaptive background subtraction and Kalman filtering based model to count vehicle. However, their method provides a very good accuracy but it is comparatively slow to compute. Unzueta, Luis, et al. [22] propose a robust adaptive multi cue segmentation strategy that detects foreground pixels corresponding to moving and stopped vehicles, even with noisy images due to compression. This method is also reliable and provides satisfactory result in various conditions. # III. # Proposed Method Our method is proposed targeting real time applications. Therefore, the execution time must be faster in both detection, counting and analysis. We are proposing a cost effective and faster model that can easily be implemented for real time traffic surveillance. In the next sub sections, we will discuss about the approaches and methods we use for detection and counting vehicles from a video and then generate the information about traffic. # a) Detection # i. Camera placement: At the very first stage of detection, we have to select a suitable place to set camera. We propose our method targeting to run on videos taken by some static camera. ii. Feature Extraction: As we propose our method for real time application, we need so select a feature that is fast to compute. In proposed method, haar-like features are chosen for vehicle detection. The detection is done using Viola-Jones object detection framework. A window of the target size is moved over the input image, and for each subsection of the image, the Haarlike feature is calculated. Sub-window that remains positive after going through some steps are said to be positive and the area covering by some joined sub-window is detected as vehicles. # b) Counting As a vehicle can appear in multiple frames, it will be detected multiple times also. However, we have to count only once. Therefore, we cannot count each vehicle of all the frames. To count a vehicle only once, we use two virtual detection lines (VDL). The classifier only computes the region of the virtual detection line. So when vehicles appear on the region within virtual detection lines, only then they are detected. When a vehicle appears in the VDL its full rear view must be seen and for this no chance of false detection. As a vehicle must appear within the region of VDL, there will be no possibility to miss any vehicle. Still there is possibility of counting a vehicle more than once. Therefore, we count vehicle after each three frames. The length of the VDL is set in such a way that no vehicle can go past the VDL within these three frames. The difference of the two VDL is the length a vehicle can cover within five frames at an average of 40km/h. Therefore, the faster vehicle like bus or car cannot disappear within five frames and the slower vehicle like rickshaw won't appear twice within the frame as we count after each three frames. This provides a very good accuracy in counting. # c) Classifying Road Condition After counting the vehicles passing through a road, we generate some useful information that can be used to operate traffic smartly and design an efficient traffic model. We experiment the proposed method in the videos taken from a road then we count the number of vehicles passing through that road in a certain amount of time. Suppose there is a busy road where a large number of vehicles go through within 9.00 am to 9.30 am. However, this road can be free at another time. We count the number of vehicles for every 20 minutes. According to that number and the width of the road, we classify the condition of the road. We make four categories of the condition of the road i) free ii) moderate iii) busy and iv) heavy. We generate ratio of vehicle and the lane by following equation. The value number of vehicles is found by counting vehicles in every 20 minutes. If the density is less than or equal 200, then we say the condition of the road is free. If it is between 200 and 300 then the condition of the road is moderate. If it is between 300 and 400 then the road is busy and after that, the condition of the traffic of the road is heavy. # Experimental Result Multiple experiments have been done to generate the result of the method. All the experiments have been done on different videos. # a) Data Set Collection There are 15 videos taken from Kalshi Road, Mirpur, Dhaka, Bangladesh from the side of the roads. Videos are taken on different environments including sunny, cloudy weather in different times. Some videos are taken in and opposite direction of sunlight. Another 10 videos taken by MVDL [3] authors is used to test the proposed method. For training we take two instances of each image thus the positive image set for detection contains almost 5000 images of vehicles. For negative image set, we use 1300 negative images of Caltech car data set and 700 images of local roads. The negative image set contains almost 2000 images. Those images are resized and used for training. # b) Result Extensive experiments have been carried out to generate the result of the proposed method. Without considering occlusion, the average detection rate is 97.81%. Average false positive rate is reduced to 1.8%. The accuracy of counting is also satisfactory. The proposed method provides 93.11% counting accuracy. The Roads where After counting the vehicles for a particular time (20 minutes), the proposed method provides the information about the condition of the roads. The results are generated by calculating the density. We have carried out experiments in our collected videos taken from different place of Dhaka city. We find that the method provides accurate result about the condition of the roads. V. # Conclusion Traffic monitoring by analysing videos of the road is a very challenging task. It is more difficult on the busy roads like 12![Fig. 1: Left is the view from over bridge and right side shows the view from side iii. Classifier: SVM is faster in training stage than AdaBoost classifiers. SVM becomes quite slower in test stage. We need our method to perform faster in testing. Some weak classifiers are trained in AdaBoost learning algorithm and then combine them to make a strong classifier. A cascade of 25 classifier is made in proposed method. The first two classifier](image-2.png "Fig. 1 :Fig. 2 :") 34![Fig. 3: Left: Detected vehicles from video taken from over bridge, Right: Detected vehicles from a video taken from the side of the road](image-3.png "Fig. 3 :Fig. 4 :") 5![Fig. 5: System Architecture of the Proposed Method](image-4.png "Fig. 5 :") IDensityRoad Condition0-200Free201-300Moderate301-400Busy401-RestHeavy IIYear 2 019G ( ) Volume XIX Issue II Version ITraffic Extract Frame from a Video Analyze the Traffic Condition by Computing the Density of theDetect Vehicles Using Haar Feature based AdaBoost Classifier Count Vehicle Using VDLsGlobal Journal of Computer Science and TechnologyPlace Kalshi Road, Mirpur, Dhaka Kalshi Road, Mirpur, Dhaka Kalshi Road, Mirpur, Dhaka Kalshi Road, Mirpur, Dhaka Cantonment Fly Over Road, Dhaka Shahbagh, Dhaka Shahbagh, DhakaNo. of Videos 4 4 5 2 3 5 3Position Side Side Side Side Side 11.00 AM Time 9.00 AM 12.00 PM 4.00 PM 2.00 PM Over Bridge 10.00 AM Over Bridge 2.00 PMDuration (Mins) 6.36 6.23 9.25 5.17 3.11 22.54 12.21Environment Sunny Cloudy Sunny Sunny Against Sun-light Sunny CloudyShahbagh, Dhaka2Over Bridge4.00 PM9.46Partially SunnyBUET, Dhaka2Over Bridge10.00 PM8.35SunnyBUET, Dhaka2Over Bridge12.00 PM4.49Cloudy IIIData SetDetection AccuracyFalse Positive RateData Set 197.81%1.25%MVDL [3](Data Set 2)97.23%1.67%Zhang [1]97.37%2.5%rickshaws are plenty, there the accuracy of the methoddecreases. The rickshaws are very slow compared toothers vehicle and for this one rickshaw may appeartwice in the VDL region. We can see the result of thevideo taken from BUET. Most of the vehicles there arerickshaws and the total count is greater than theactual count. IVRoad NameDuration of Video (Mins)Actual CountCount by Method ProposedAccuracyKalshi Road6.2328827093.75%Kalshi Road9.2539637594.70%Matikata Overbridge3.2311410592.10%Shahbagh5.5224423194.64%BUET4.49879689.65% Vthe roads ofRoad NameDuration of Video (Mins)TimeTraffic ConditionKalshi Road6.2312.00 PMModerateKalshi Road20.219.00 AMHeavyMatikataOver-3.2312.00 PMFreebridgeShahbagh5.522.00 PMBusyShahbagh5.524.00 PMHeavy © 2019 Global JournalsComputer Vision based Traffic Monitoring and Analyzing from On-Road Videos * A Video-based Vehicle Detection and Classification System for Real-time Traffic Data Collection Using Uncalibrated Video Cameras RyanPGuohuizhang YinhaiAvery Wang TRB 2007 annual meeting * On certain integrals of Lipschitz-Hankel type involving products of Bessel functions GEason BNoble INSneddon Phil. Trans. Roy. Soc. London 247 April 1955 * Detection and Classication of Vehicles from Video Using Multiple Time-Spatial Images NafiNiluthpol Chowdhury Mithun SMUr Rashid Mahbubur Rahman IEEE transactions on intelligent trasportation systems September 2012 13 * Lateral vehicles detection using monocular high resolution cameras on TerraMax ABroggi ACappalunga SCattani PZani Proc. IEEE Intell. Veh. Symp IEEE Intell. Veh. Symp Jun. 2008 11431148 * Integrated Lane and Vehicle Detection, Localization, and Tracking: A Synergistic Approach MohanManubhaiSayanansivarama Trivedi IEEE transactions on intelligent trasportation systems June 2013 14 * Vehicle detection and recognition for intelligent traffic surveillance system YongTang CongzheZhang PengRenshugu BinLi Yang Multimedia tools and applications 2017 76 * Deep Nural Network MohanManubhaiSayanansivarama Trivedi IEEE transactions on intelligent trasportation systems June 2013 14 * Histograms of oriented gradients for human detection BillNavneetdalal Triggs Computer Vision and Pattern Recognition IEEE 2005. 2005. 2005 1 * Symmetry-based monocular vehicle detection system. Mach STeoh TBrunl Vis. Appl 23 5 831842 * Real-time side vehicle tracking using parts-based boosting W.-CChang C.-WCho IEEE Int. Conf. SMC 33703375 2008 * Rear vehicle detection and tracking for lane change assist WLiu XWen BDuan HYuan NWang Proc. IEEE Intell. Veh. Symp IEEE Intell. Veh. Symp Jun. 2007 252257 * Object recognition from local scaleinvariant features DLowe Proc. Int. Conf. Comput. Vis Int. Conf. Comput. Vis 1999 11501157 * Vehicle detection using an extended hidden random eld model XZhang NZheng YHe FWang Proc. 14th Int. IEEE Conf. ITSC 14th Int. IEEE Conf. ITSC Oct. 2011 15551559 * Integrating appearance and edge features for sedan vehicle detection in the blind-spot area B.-FLin Y.-MChan L.-CFu P.-YHsiao L.-AChuang S.-SHuang M.-FLo IEEE Trans. Intell. Transp. Syst 13 2 737747 Jun. 2012 * Road vehicle classication using support vector machines ZChen NPears MFreeman JAustin Proc. IEEE Int IEEE IntShanghai, China 2009 214218 * Active learning for on road vehicle detection: A comparative study MohanManubhaiSayanansivarama Trivedi Mach. Vis. Appl 113 Dec. 2011 Special Issue Car Navigation and Vehicle Systems * A short introduction to boosting YoavFreund RobertSchapire NaokiAbe Journal-Japanese Society for Artificial Intelligence 14 1612 771780. 1999 * Vehicle localization using a single camera JCui FLiu ZLi ZJia Proc. IEEE IV IEEE IV Jun. 2010 871876 * Learning algorithm for real-time vehicle tracking DWithopf BJahne Proc. IEEE ITSC IEEE ITSC Sep. 2006 516521 * Overtaking vehicle detection using dynamic and quasi-static background modeling JWang GBebis RMiller Proc. IEEE CVPR IEEE CVPR Jun. 2005 64 * Automatic vehicle counting from video for traffic flow analysis ErhanBas AMurat Tekalp FSibel Salman IEEE 2007. 2007 Ieee Intelligent Vehicles Symposium * Adaptive multicue background subtraction for robust vehicle counting and classification LuisUnzueta IEEE Transactions on Intelligent Transportation Systems 13 2012