Automatic Real-time Vehicle Classification
by Image Colour Component Based Template Matching
Ahmet Orun*
De Montfort University, Faculty of Computing, Engineering and media,
Leicester UK Email: aorun@dmu.ac.uk. Phone: +44(0)116 3664408
Abstract
Selection of appropriate template matching algorithms to run effectively on real-time low-cost systems is
always major issue. This is due to unpredictable changes in image scene which often necessitate more
sophisticated real-time algorithms to retain image consistency. Inefficiency of low cost auxiliary hardware
and time limitations are the major constraints in using these sorts of algorithms. The real-time system
introduced here copes with these problems utilising a fast running template matching algorithm, which makes
use of best colour band selection. The system uses fast running real-time algorithms to achieve template
matching and vehicle classification at about 4 frames /sec. on low-cost hardware. The colour image sequences
have been taken by a fixed CCTV camera overlooking a busy multi-lane road.
Keywords : Vehicle classification, template matching, CCTV, colour image
1. Introduction
Template matching is a simple method for achieving the fast classification of vehicles in image sequences
taken by a CCTV camera. A description of template matching and the underlying theory can be found in
Ballard and Brown (1982) or Davies (1997). The advantage of template matching over other more elaborate
methods for vehicle classification is that it can be applied in real-time using only low cost hardware. Many
authors describe methods for segmenting vehicles in image sequences. Rittscher et al. (2000) describe a
Markov random field model for pixel grey levels. The model is used to find pixels which have a high
probability of being contained within a vehicle. Beymer et al. (1997) group feature points to locate the image
of a vehicle. Koller et al. (1994) initialise a vehicle tracking algorithm by detecting regions in which the
current image in a sequence differs from the background image. They fit a spline contour about each region
and track using two Kalman filters, one for the motion of the vehicle and the other for the control points of
the spline contour. Cucchiara et al. (1999) implement a vehicle detection and tracking system on low cost
hardware, namely SRAM based Field Programmable Gate Arrays. A moving vehicle is detected by frame
image differencing. This yields a ‘blob’ approximating to the apparent shape of the vehicle. The apparent shape
is recovered more accurately by adjusting the blob such that its boundaries coincide with image regions with
high grey level gradients. Rajagopalan et al. (1999) detect vehicles by modelling the higher order moments
of the grey level values within vehicle outlines. In contrast with the many papers on segmenting images of
vehicles, there are far fewer papers on vehicle classification. Sullivan (1992) uses wire frame models to
locate and classify vehicles in single image. Lim et al. (1995) present a vehicle classification system for
electronic road pricing. There are many other general methods for object classification, for example methods
based on simple properties of regions segmented out of the image. These properties include area, perimeter,
semi-major axis, semi-minor axis (Kitchen and Pugh 1983). Such methods are not useful in this application
because the blobs corresponding to vehicles are poorly structured, for example as shown in Figure 1. However
none of the above papers deal with the use of colour to improve classification results.
The main contributions of this paper are two related techniques; one which achieves vehicle classification by
a real-time fast template matching, and the other colour band selection technique which exploits the colour
properties of sequential video imagery to enhance the quality of templates. At present Colour band selection
technique is implemented off line because of the amount of processing needed. There are more