Detecting Cars Using Gaussian Mixture Models This example shows how to detect and count cars in a video sequence using foreground detector based on Gaussian mixture models (GMMs). Introduction Step 1 ­ Import Video and Initialize Foreground Detector Step 2 ­ Detect Cars in an Initial Video Frame Step 3 ­ Process the Rest of Video Frames

Introduction Detecting and counting cars can be used to analyze traffic patterns. Detection is also a first step prior to performing more sophisticated tasks such as tracking or categorization of vehicles by their type. This example shows how to use the foreground detector and blob analysis to detect and count cars in a video sequence. It assumes that the camera is stationary. The example focuses on detecting objects. To learn more about tracking objects, see the example titled Motion­Based Multiple Object Tracking.

Step 1 ­ Import Video and Initialize Foreground Detector Rather than immediately processing the entire video, the example starts by obtaining an initial video frame in which the moving objects are segmented from the background. This helps to gradually introduce the steps used to process the video. The foreground detector requires a certain number of video frames in order to initialize the Gaussian mixture model. This example uses the first 50 frames to initialize three Gaussian modes in the mixture model.

foregroundDetector = vision.ForegroundDetector('NumGaussians', 3, ...     'NumTrainingFrames', 50); videoReader = vision.VideoFileReader('visiontraffic.avi'); for i = 1:150     frame = step(videoReader); % read the next video frame     foreground = step(foregroundDetector, frame); end After the training, the detector begins to output more reliable segmentation results. The two figures below show one of the video frames and the foreground mask computed by the detector.

figure; imshow(frame); title('Video Frame');

figure; imshow(foreground); title('Foreground');

Step 2 ­ Detect Cars in an Initial Video Frame The foreground segmentation process is not perfect and often includes undesirable noise. The example uses morphological opening to remove the noise and to fill gaps in the detected objects.

se = strel('square', 3); filteredForeground = imopen(foreground, se); figure; imshow(filteredForeground); title('Clean Foreground');

Next, we find bounding boxes of each connected component corresponding to a moving car by using vision.BlobAnalysis object. The object further filters the detected foreground by rejecting blobs which contain fewer than 150 pixels.

blobAnalysis = vision.BlobAnalysis('BoundingBoxOutputPort', true, ...     'AreaOutputPort', false, 'CentroidOutputPort', false, ...     'MinimumBlobArea', 150); bbox = step(blobAnalysis, filteredForeground); To highlight the detected cars, we draw green boxes around them.

result = insertShape(frame, 'Rectangle', bbox, 'Color', 'green'); The number of bounding boxes corresponds to the number of cars found in the video frame. We display the number of found cars in the upper left corner of the processed video frame.

numCars = size(bbox, 1); result = insertText(result, [10 10], numCars, 'BoxOpacity', 1, ...     'FontSize', 14); figure; imshow(result); title('Detected Cars');

Step 3 ­ Process the Rest of Video Frames In the final step, we process the remaining video frames.

videoPlayer = vision.VideoPlayer('Name', 'Detected Cars'); videoPlayer.Position(3:4) = [650,400];  % window size: [width, height] se = strel('square', 3); % morphological filter for noise removal while ~isDone(videoReader)     frame = step(videoReader); % read the next video frame     % Detect the foreground in the current video frame     foreground = step(foregroundDetector, frame);     % Use morphological opening to remove noise in the foreground     filteredForeground = imopen(foreground, se);     % Detect the connected components with the specified minimum area, and     % compute their bounding boxes     bbox = step(blobAnalysis, filteredForeground);     % Draw bounding boxes around the detected cars     result = insertShape(frame, 'Rectangle', bbox, 'Color', 'green');     % Display the number of cars found in the video frame     numCars = size(bbox, 1);

    result = insertText(result, [10 10], numCars, 'BoxOpacity', 1, ...         'FontSize', 14);     step(videoPlayer, result);  % display the results end release(videoReader); % close the video file

The output video displays the bounding boxes around the cars. It also displays the number of cars in the upper left corner of the video.

TRY OR BUY Contact Sales (http://www.mathworks.com/company/aboutus/contact_us/contact_sales.html? eventid=1148616881&s_iid=cex_sales_VP_tb) Product Trial (http://www.mathworks.com/programs/trials/trial_request.html? prodcode=VP&eventid=592525001&s_iid=cex_trial_VP_tb) Pricing and Licensing (http://www.mathworks.com/pricing­licensing/?prodcode=VP&s_iid=cex_pl_VP_tb)

Detecting Cars Using Gaussian Mixture Models - MATLAB ...

Detecting Cars Using Gaussian Mixture Models - MATLAB & Simulink Example.pdf. Detecting Cars Using Gaussian Mixture Models - MATLAB & Simulink ...

782KB Sizes 6 Downloads 304 Views

Recommend Documents

Non-rigid multi-modal object tracking using Gaussian mixture models
of the Requirements for the Degree. Master of Science. Computer Engineering by .... Human-Computer Interaction: Applications like face tracking, gesture ... Feature Selection: Features that best discriminate the target from the background need ... Ho

Computing Gaussian Mixture Models with EM using ...
email: tomboy,fenoam,aharonbh,[email protected]}. School of Computer ... Such constraints can be gathered automatically in some learn- ing problems, and ...

Non-rigid multi-modal object tracking using Gaussian mixture models
Master of Science .... Human-Computer Interaction: Applications like face tracking, gesture recognition, and ... Many algorithms use multiple features to obtain best ... However, there are online feature selection mechanisms [16] and boosting.

Learning Gaussian Mixture Models with Entropy Based ...
statistical modeling of data, like pattern recognition, computer vision, image analysis ...... Degree in Computer Science at the University of. Alicante in 1999 and ...

Learning Gaussian Mixture Models with Entropy Based ...
statistical modeling of data, like pattern recognition, computer vision, image ... (MAP) or Bayesian inference [8][9]. †Departamento de ... provide a lower bound on the approximation error [14]. In ...... the conversion from color to grey level. Fi

a framework based on gaussian mixture models and ...
Sep 24, 2010 - Since the invention of the CCD and digital imaging, digital image processing has ...... Infrared and ultraviolet radiation signature first appears c. .... software can be constantly upgraded and improved to add new features to an.

Subspace Constrained Gaussian Mixture Models for ...
IBM T.J. Watson Research Center, Yorktown Height, NY 10598 axelrod,vgoel ... and HLDA models arise as special cases. ..... We call these models precision.

Fuzzy correspondences guided Gaussian mixture ...
Sep 12, 2017 - 1. Introduction. Point set registration (PSR) is a fundamental problem and has been widely applied in a variety of computer vision and pattern recognition tasks ..... 1 Bold capital letters denote a matrix X, xi denotes the ith row of

Warped Mixture Models - GitHub
We call the proposed model the infinite warped mixture model. (iWMM). ... 3. Latent space p(x). Observed space p(y) f(x). →. Figure 1.2: A draw from a .... An elegant way to construct a GP-LVM having a more structured latent density p(x) is.

Using Mixture Models for Collaborative Filtering - Cornell Computer ...
Using Mixture Models for Collaborative Filtering. Jon Kleinberg. ∗. Department of Computer Science. Cornell University, Ithaca, NY, 14853 [email protected].

Restructuring Exponential Family Mixture Models
Variational KL (varKL) divergence minimization was pre- viously applied to restructuring acoustic models (AMs) using. Gaussian mixture models by reducing ...

Gaussian mixture modeling by exploiting the ...
or more underlying Gaussian sources with common centers. If the common center .... j=1 hr q(xj) . (8). The E- and M-steps alternate until the conditional expectation .... it can be easily confused with other proofs for several types of Mahalanobis ..

The subspace Gaussian mixture model – a structured ...
Oct 4, 2010 - advantage where the amount of in-domain data available to train .... Our distribution in each state is now a mixture of mixtures, with Mj times I.

Group Target Tracking with the Gaussian Mixture ... -
such as group target processing, tracking in high target ... individual targets only as the quantity and quality of the data ...... IEEE Aerospace Conference, Big.

Dynamical Gaussian mixture model for tracking ...
Communicated by Dr. H. Sako. Abstract. In this letter, we present a novel dynamical Gaussian mixture model (DGMM) for tracking elliptical living objects in video ...

Restructuring Exponential Family Mixture Models
fMMI-PLP features combined with frame level phone posterior probabilities given by .... mation Lφ(fg), can be maximized w.r.t. φ and the best bound is given by.

Panoramic Gaussian Mixture Model and large-scale ...
Mar 2, 2012 - After computing the camera's parameters ([α, β, f ]) of each key frame position, ..... work is supported by the National Natural Science Foundation of China. (60827003 ... Kang, S.P., Joonki, K.A., Abidi, B., Mongi, A.A.: Real-time vi

The subspace Gaussian mixture model – a structured model for ...
Aug 7, 2010 - We call this a ... In HMM-GMM based speech recognition (see [11] for review), we turn the .... of the work described here has been published in conference .... ize the SGMM system; we do this in such a way that all the states' ...

Gaussian Mixture Modeling with Volume Preserving ...
transformations in the context of Gaussian Mixture Mod- els. ... Such a transform is selected by consider- ... fj : Rd → R. For data x at a given HMM state s we wish.

The subspace Gaussian mixture model – a structured ...
Aug 7, 2010 - eHong Kong University of Science and Technology, Hong Kong, China. fSaarland University ..... In experiments previously carried out at IBM ...... particularly large improvements when training on small data-sets, as long as.

Gaussian mixture modeling by exploiting the ...
This test is based on marginal cumulative distribution functions. ... data-sets and real ones. ..... splitting criterion can be considered simply as a transformation.