Morphological Image Processing Approach of Vehicle Detection for Real-Time Traffic Analysis

DOI : 10.17577/IJERTV3IS051443

Download Full-Text PDF Cite this Publication

Text Only Version

Morphological Image Processing Approach of Vehicle Detection for Real-Time Traffic Analysis

Prutha Y M*1,

Department Of Computer Science and Engineering Affiliated to VTU Belgaum, Karnataka

Rao Bahadur Y Mahabaleswarappa Engineering College, Bellary-583104, India

Anuradha S G#2, Assistant professor Department Of Computer Science and Engineering Affiliated to VTU Belgaum, Karnataka

Rao Bahadur Y Mahabaleswarappa Engineering College, Bellary-583104, India

Abstract-Along with the economical development, traffic has increased enormously these days. Due to the increasing urban population and hence the number of cars, need of controlling the traffic in streets, highways and roads is vital. In this paper, a system that detects the vehicle in real time in highway is done by using image processing. The implementation includes algorithms used for real time vehicle detection, which is based on background differencing and morphological operations. Another image processing technique used is the edge detection technique where the edges of the object is detected and other techniques for calculating traffic parameters such as counting the number of cars, speed of the cars by applying a threshold value .

Keywords: Morphological operations, background subtraction, edge detection, thresholding.

  1. INTRODUCTION

    The application of image processing and computer vision techniques to the analysis of video sequences of traffic flow offers considerable improvements over the existing methods of traffic data collection and road traffic monitoring. Other methods suffer from serious drawbacks in that they are expensive to install and maintain and they are unable to detect slow or stationary vehicles. Video sensors offer a relatively low installation cost with little traffic disruption during maintenance. Most of the city traffic is controlled by sensors and cameras shall be installed in big highways and streets. Such systems can allow extracting information from the bigger traffic issue and helps us decide to improve the traffic policy. The paper aims to render automate control system for traffic on highways and streets.

    A. Motivation

    As the urbanization is increasing, one can see increase in population and usage of cars is increasing day by day, hence traffic control plays an important role in highways. To estimate the size of traffic conditions, image processing approach has been proposed .It helps to analyze traffic flow, speed enforcement, vehicle count, accident investigation, traffic congestion.

  2. LITERATURE SURVEY

    Researches and developments have been performed in image processing techniques which is applied to traffic data collection and analysis. In this paper, it explains computer vision based approach to road monitoring and traffic analysis problem. Approved methods and algorithms are implemented in the intelligent video monitoring system with data transferring over computer networks and archiving in local and central databases. The application is utilizing image-processing and pattern recognition methods designed and modified to the needs and constrains of road traffic analysis. These methods combined together gives functional capabilities of the system to monitor the road, to initiate automated vehicle tracking, to measure the speed [1]. Image detection is heavily dependent on the background updating and threshold selection techniques. An alternative image detection technique used in image processing is based on edge detection techniques. An edge detector extracts the edges of the objects of a scene irrespective of whether it belongs to the background details or the objects [2]. A system that estimates the size of traffic in highways by using image processing has been proposed and as a result a message is shown to inform the number of cars in highway. First, film of highway is captured by a camera has been installed in highway. Then, the film comes in the form of consecutive frames and each frame is compared with the first frame. Later , the number of cars in highways is specified. At the end, if the number of cars is more than a threshold, a message is shown to inform the traffic status [3]. Image processing algorithms are applied for the recognition of environmental and road conditions from real-time camera images. The design and implementation of an automated camera heading detection system to determine the directional components of a cameras position using the current camera image [4]. An efficient simulation model for counting the vehicles from the colored and gray-scale images through image processing techniques in Simulink environment .Video and Image Processing Blockset is a tool used for the rapid design, prototyping, graphical simulation, and efficient code generation of video and image processing algorithms. The approach used is morphological operation (Opening) which

    works very effectively for images captured. The developed process involves object feature identification, detection, and counting objects [5]. To measure queue parameters accurately, traffic queue algorithm is used. It performs two operations: vehicle detection and motion detection. To obtain an instantaneous precise estimation of queue length, the vehicle detection is based on applying edge detection technique on the profiles [6]. Under few challenging conditions feature-based tracking system for detecting vehicles are developed. Vehicle features are tracked to make the system robust to partial occlusion. The system can extract vehicle signatures and match observations of the same vehicle at multiple detector stations [7]. Overall , the references have advantages such as reporting of speed violation , traffic congestion ,accidents,low cost and

    1. Background Subtraction

      Background subtraction, also known as foreground detection, is a technique in the fields of image processing wherein an image's foreground is extracted for further processing (object recognition etc.). Generally an image's regions of interest are objects (human, cars, text etc.) in its foreground. Background subtraction is a widely used approach for detecting moving objects in videos from static cameras. The approach is that of detecting the moving objects from the difference between the current frame and a reference frame, often called background image. Background B(p) is calculated as an average of each RGB values for the same image point p in the selected background frames:

      setup with good accuracy and speed. Some of the disadvantages occurring are variation of ambient light , 3D

      B(p) = (,)

      , where IB(k, p) is pixel color value for point p

      images are not supportive, and it is difficult to detect vehicle features in windy and other weather conditions.

  3. METHODS

    1. Image Processing

      Image processing is the study of any algorithm that takes an image as input and returns an image as output. Image processing is any form of signal processing for which the input is an image, such as a photograph or video frame; the output of image processing may be either an image or a set of characteristics or parameters related to the image.

      1. Morphological Operations

        Local pixel transformations for processing region shapes, most often used on binary images. Logical transformations based on comparison of pixel neighborhoods with a pattern. While point and neighborhood operations are generally designed to modify the look or appearance of an image for visual considerations, morphological operations have been used to understand the structure or form of an image.

        p>Morphological operations take two arguments:

        • A binary image

        • A structuring element

There are three primary morphological functions for achieving these objectives: 1) erosion 2) dilation and 3) hit-or-miss. Morphological operations usually have been performed on binary images where the pixel has two values; 0 or 1 . Value of zero has been considered as black and value of 1 as white. Most of the morphological functions operate on 3×3 pixel neighborhoods. The pixel neighborhood is identified into one of two ways; sometimes interchangeably. The pixel of interest lies at the center of the neighborhood and has been labeled x. The surrounding pixels are referred to x , or by their compass coordinate E,NE,N,NW,W,SW and SE. Some morphological operations have been done on binary images. After subtraction, certainly some additional points on the image in order to subtraction have been left and with morphological operation in these parts remove additional points have been removed. Initially, the objects on the image resulting from subtraction must be removed and then interior and border areas of mark cars in the image resulting from subtraction have been traced.

in frame k. Background removal from traffic scene image I(k,

p) generates a color RGB image D(k, p) = _I(k, p) B(p), as an Euclidean distance {.} between I(k, p) and B(p).

Fig 1 : Image Subtraction

  1. Edge detection

    An edge is area of significant changing the image intensity. Edge detection is locating areas with strong intensity contrasts. Edge detection is used for extracting information about the image. Different edge detection techniques:

    1. Marr-hildreth edge detector

    2. Roberts operator

    3. Prewitt operator

    4. Sobel operator

    5. Boolean edge detector

    6. Canny edge detector

  2. Thresholding

Thresholding is the simplest method of image segmentation. From a grayscale image, thresholding can be used to create binary images. Image thresholding is a simple, yet effective, way of partitioning an image into a foreground and background.

Fig 2: a) gray-scale image

b) Thresholded image

VI. PROBLEM STATEMENT

Fig 3:

  1. image of highway when there is no cars

  2. image of highway when there are cars

  3. image of background subtraction with object detection on foreground

    1. Flow diagram

      The application of image processing to the analysis of video sequences of traffic flow offers considerable improvements over the existing methods of traffic data collection and road traffic monitoring. Other methods including the inductive loop, the sonar and microwave detectors suffer from serious drawbacks in that they are expensive to install and maintain and they are unable to detect slow or stationary vehicles. Video sensors offer a relatively low installation cost with little traffic disruption during maintenance. Furthermore, to provide wide area monitoring allowing analysis of traffic flows, speed measurement, multiple point vehicle counts, vehicle classification and highway state assessment(eg: congestion, incident detection). Morphological image processing is applied and vehicle is detected in real-time traffic. Problem occurring in this method is extreme sensitivity to light. For example,

      Image acquisition

    2. Algorithm

      1-start

      RGB to

      Grayscale transformation

      Vehicle tracking

      Fig 4 : flow diagram

      Image enhancement

      Morphological operations

      when installed in the road, changes in sun light potentially cause interference with the camera.

      1. PROPOSED SYSTEM

        Proposed method consists of two phases which is shown in the fig 3.

        Phase 1:

        1. First images are captured by camera shown in fig 3(a) where, images of highway when there is no traffic will be taken.

        2. The first images of highway is considered as a reference file and stored in a specific location in the program.

        3. RGB to Grayscale Conversion in order to achieve image enhancement is done.

        Phase 2:

        1. At first, images are captured from the highway shown in fig 3(b). RGB to Grayscale Conversion is done on the hierarchy of the images.

        2. Then, morphological operation is applied on each gray images as in fig 3(c).

        3. Later, vehicle tracking is done. Vehicle tracking includes two parts: 1) Background elimination; 2) lane masking.

        2-receive the first frame of video 3-RGB to grayscale conversion 4- for {

        vehicle tracking on the image; 5- if {number of cars> threshold}

        print traffic is heavy; Else

        Write the number of frames under the video;

        End End

        6- Go to 4 End

    3. Flowchart of the algorithm

Start

Receive first frame of video

RGB to gray scale

1

Receive nth frame

RGB to gray scale

New image= n- first frame

Vehicle tracking on new image

Number of cars>threshold

Write the number of frames

Write traffic is heavy

1

stop

Fig 5: Flowchart of Proposed Method

  1. RESULTS

    The algorithm is tested under various traffic conditions, using MATLAB various methods are applied which gives the output and is shown in the figure 6(a) and (b). In figure 6(a) the leftmost figure shows the image of the highway when initially there is no traffic and the middle image shows the background subtracted image where no object is present and the rightmost image shows the edge detector applied and the bottom figure shows 0km/h which is the speed of the cars as there is no traffic movement so the arrival rate is also 0 here.

    Fig 6 : (a) output shown when there is no traffic in highway.

    In the figure 6(b) the leftmost figure shows the image of the highway when there is traffic and cars travelling on the road and the middle image shows the background subtracted image where objects are detected hence it is in white patch and the background is made black and the rightmost image is the edge detector applied which has different edge detection techniques applied to it and optimal detector is selected and the figure in the bottom shows the objects being tracked and masked with rectangular boxes and numbered as the object arrives which is considered as frames. The speed and the arrival rates of the cars are estimated by setting a threshold value. As the speed n arrival rate changes the values are shown on the screen. The bottom figure shows the performance graph of the traffic flow where the x-axis is the number of blocks and the y-axis the percentage of motion of the vehicles, it varies as the traffic movement changes

    (b) output shown when there is traffic in highway

  2. CONCLUSION

    In this paper, a method for estimating the traffic using Image Processing is presented. This is done by using the camera images captured from the highway and videos taken are converted to the image sequences. Each image is processed separately and the number of cars has been counted. If the number of cars exceeds a specific threshold, warning of heavy traffic will be shown automatically. The advantages of this new method include such benefits as: 1) Non-use of sensors

    2) Low cost and easy setup and relatively good accuracy and speed. Because this method has been implemented using Image

    Processing and Matlab software, production costs are low while achieving high speed and accuracy. In this respect, the method is superior to previously published designs.

  3. FUTURE WORK

The method presented in this paper is simple and there is no need to use sensors that have been commonly used to detect traffic in the past. However, one of the most important disadvantages of this method is extreme sensitivity to light. This problem cn be overcome by using specific filters during Image Processing or changes in Matlab code. With some improvements, this method can be used to detect road accidents and identify violations of the spiral movements of cars.

ACKNOWLEDGMENT

I Prutha Y M would like to thank my guide Mrs.Anuradha S G, Assistant professor who have been a great source of inspiration and provided her right balance of suggestions, criticism in preparing this paper .

REFERENCES

  1. E. Atkociunas1, R. Blake2, A. Juozapavicius1,M. Kazimianec1 Image processing in road traffic analysis Nonlinear Analysis: Modelling and Control, 2005, Vol. 10, No. 4, 315332

  2. M. Fathy a, M.Y. Siyal b An image detection technique based on morphological edge detection and background differencing for real-time traffic analysis. Pattern Recognition Letters 16 (1995) 1321-1330

  3. Pejman Niksaz Automatic traffic estimation using image Processing International Journal of Signal Processing, Image Processing and Pattern Recognition Vol. 5, No. 4, December, 2012

  4. James G. Haran,1 John Dillenburg2 and Peter Nelson3Real-time image processing algorithms for the detection of road and environmental conditions [5] Pratishtha Gupta 1, G.N Purohit 2, Adhyana Gupta 3 Traffic Load Computation using Matlab Simulink Model Blockset International Journal of Advanced Research in Computer and Communication Engineering Vol. 2, Issue 6, June 2013

  1. P.D. Kamble*, 2S.P. Untawale and 3S.B. Sahare Application of image processing for traffic queue length VSRD-MAP, Vol. 2 (5), 2012, 196- 205

  2. Benjamin Coifmana, David Beymerb,1, Philip McLauchlanb,2,Jitendra Malikb,3 A real-time computer vision system for vehicle tracking and traffic surveillance Transportation Research Part C 6 (1998) 271-288

  3. Suresh Babu Changalasetty1, Ahmed Said Badawy1, Wade Ghribi1, Haytham Ibrahim Ashwi1, Identification and classification of moving vehicles on road Computer Engineering and Intelligent Systems, ISSN 2222-179(paper)Vol.4,No8,2013.

Leave a Reply