Pattern Matching

This demo uses the Video and Image Processing Blockset to illustrate the use of 2-D normalized cross-correlation for pattern matching and target tracking. When you run the model, you can change the pyramiding factor. By increasing it, you can match the target template to each video frame more quickly.

Contents

Demo Model

The following figure shows the Pattern Matching model:

Pattern Matching Results

The Overlay window shows a rectangular region of interest (ROI) tracking the target template. The X-corr window shows the result of cross-correlating the template and a frame of video. Note that a yellow region is present whenever a rectangular ROI is drawn in the video frame. The Match metric window shows the variation of the match metric (yellow line). The model determines that the target template is present in a video frame when the match metric exceeds a threshold (magenta line). The model displays the rectangular ROI only when the target template is detected in a video frame.

Overlay window


X-corr window


Match metric window


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.