Close Window

Tracking Cars Using Optical Flow

This demo uses Video and Image Processing Blockset blocks to illustrate how to detect and track cars in a video sequence using optical flow estimation.

Contents

Demo model

The following figure shows the Tracking Cars Using Optical Flow model:

Tracking cars using optical flow results

The model uses an optical flow estimation technique to estimate the motion vectors in each frame of the video sequence. By thresholding and performing morphological closing on the motion vectors, the model produces binary feature images. The model locates the cars in each binary feature image using the Blob Analysis block. Then it uses the Draw Shapes block to draw a green rectangle around the cars that pass beneath the white line. The counter in the upper left corner of the Results window tracks the number of cars in the region of interest.



About this video

The above video was created using the Write AVI File block. When running this Simulink model, you can see the resulting video using a Video Viewer or To Video Display block. You can connect these viewers to any signal in the model, adjust model parameters, and view the results in real time.


Additional information

For more information about the Video and Image Processing Blockset, see the Video and Image Processing Blockset product information page. From here you can download a free 30-day trial, read the documentation and user stories, request more information, and get pricing information.

Also, see the other product demos that illustrate key features of the Video and Image Processing Blockset.