Video-Based Detection, Counting and Classification of Vehicles Using OpenCV

: In this era people using vehicles is getting increased day by day. To plan, monitor and also controlling of these vehicles is becoming a big challenge. A system is to be implemented without altering the infrastructure, so a video-based vehicle capturing and analysis of that video without affecting the traffic is required, by which traffic accidents and congestion can be determined. In this paper, we have come up with a solution for the above problem using the video surveillance considering the video data from the traffic cameras. We have used adaptive thresholding method, Gaussian based background subtraction with tracking methods such as blob tracking and virtual detector. The implementation was done using OpenCV Python as a tool. Our proposed system can identify, track the congestion and help in counting the objects precisely.


I. INTRODUCTION
The roads are becoming over crowded due to increasing vehicle count.An Intelligent transport system (ITS) is needed to manage the congestion in traffic and to give smooth planning for drivers.Contrasted with different strategies, the video-put together with arrangements based on the observation camera mounted outside are handily affected by situations, for example, climate, enlightenment, shadow, and so on.
Be that as it may, in light of the fact that videobased frameworks can offer a few favourable circumstances over different techniques, for example, traffic stream undisturbed, effectively introduced, helpfully changed, and so on., they object.
Initially the video is considered as frames and the absolute difference between two frames will be determined to separate the foreground from background by continued frame subtraction method removing the artefact's giving clear and neat image, so that vehicles can be detected easily and non-vehicles can be eliminated by thresholding and morphological operation.
To overcome previous drawbacks a thresholding method called Otsu is used in which adaptive thresholding will be done for background modelling.Here we have also concentrated on false alarms due to shadow, so shadow elimination was also done to get the clear object.
The first one is virtual object finding, this method will describe rectangular areas for detecting the have drawn noteworthy consideration from scientists in the previous decade.With respect to constant vehicle following framework, the essential issue is starting a track naturally.Here we depict two methodologies in which the issue can be sorted in an intelligent away.[10] depending on the area of the object with respect to the distance of it from camera point.Based on the objects within the frame a boundary will be considered to detect the moving objects that is Region of Interest (ROI).Despite the fact that the calculation is improved to manage some climate conditions it can't follow vehicles when they change their bearings.
In the other proposed method, the idea of optical flow was introduced.Here the vectors will be generated with respect to the object moment and the complex conjugate values will be determined.These vectors give us the congestion from one object to other.If more vectors are generated it refers to more congestion.
In certain works, for example, forward and in reverse picture differencing technique used to extricate moving vehicles in a street view.A few examinations demonstrated that the utilization of highlight vectors from picture district can be amazingly productive for vehicle recognitions objectives.Some others spoke about the exact vehicle measurement estimation utilizing a lot of facilitate planning capacities as it very well may be seen in.Besides, a few investigations have built up an assortment of boosting calculations for object recognition utilizing AI strategies which can identify and characterize moving items by both kind and shading.

III. ADAPTIVE CATEGORIZING ALGORITHM
The structure programming oversees picture traces read from video game plans, with the objective that we can make picture banalizations.The whole picture of the flowchart is shown up in Figure 2.
Initially, our estimation scrutinizes picture diagrams from video, breaks down the basic 85 images traces into RGB channels, loads typical of the principle 85 images, and gets a one of a kind establishment pictures.If the objects are in motion then there may be errors in defining a particular background as it will be changing with respect to the moving objects, but the background will remain constant when the system is provided large number of frames which will be called as "Background updating".

IV. PROPOSED METHODOLOGY
A couple of computations have been introduced for the conditions; some of them are executed in OpenCV, for instance, Background Subtraction MOG background modelling will be done using Gaussian method.The background subtraction uses 2 to 4 distributions in clearing small artefact's.Other method for removing separating foreground and background is Background Subtract or GMG in OpenCV which relies upon and unites the establishment picture estimation methodology with Bayesian division.
The count used in the use of proposed structure is called establishment Subtractor MOG2.It relies upon two assessments and by Zikovic.One of the huge features of this count is that not under any condition like where amount of disseminations for the modelling of establishment methods are portrayed, Background Subtractor MOG2 uses a robotized prospect and picks a relevant amount of the Gaussian mixes for pixel.1. Tracking with the identified counters with respect to the moving vehicles are shown in Figure 4 and its implementation is shown in Figure 5.
All product programs are created in python OpenCV stage.OpenCV, representing from image processing tool box Computer Vision package which is open source, capacities chiefly focused on constant computer vision.
There is a camcorder mount on footbridge going across a central avenue to screen three paths at the same time and keep away from incorrect including brought about with cars covering the picture.The consequences from the two distinct methodologies with their particular exactness accuracies are recorded in the Table 1.
Precision value compasses to 96% for virtual locator strategy, and 98% for mass following technique.It can be seen that this framework can identify, track, and check most vehicles effectively from comparison.

Figure 1 :
Figure 1: Block Diagram of ROI Figure 2: Detection and Tracking Flow Figure 4: Blob Detection and Tracking