vipstabilize
Open this model

# Video Stabilization

This demo uses the Computer Vision System Toolbox™ to remove the effect of camera motion from a video stream. In the first video frame, the model defines the target to track. In this case, it is the back of a car and the license plate. It also establishes a dynamic search region, whose position is determined by the last known target location. The model only searches for the target within this search region, which reduces the number of computations required to find the target. In each subsequent video frame, the model determines how much the target has moved relative to the previous frame. It uses this information to remove unwanted translational camera motions and generate a stabilized video.

## Contents

- Demo Model
- Estimate Motion Subsystem
- Display Results Subsystem
- Video Stabilization Results
- Available Demo Versions

## Demo Model

The following figure shows the Video Stabilization model:

## Estimate Motion Subsystem

The model uses the Template Matching block to move the target over the search region and compute the Sum of Absolute Differences (SAD) at each location. The location with the lowest SAD value corresponds to the location of the target in the video frame. Based on the location information, the model computes the displacement vector between the target and its original location. The Translate block in the Stabilization subsystem uses this vector to shift each frame so that the camera motion is removed from the video stream.

## Display Results Subsystem

The model uses the Resize, Compositing, and Insert Text blocks to embed the enlarged target and its displacement vector on the original video.

## Video Stabilization Results

The figure on the left shows the original video. The figure on the right shows the stabilized video.

## Available Demo Versions

Floating-point versions of this demo:

Windows® only: vipstabilize_win.mdl

Platform independent: vipstabilize_all.mdl

Fixed-point versions of this demo:

Windows only: vipstabilize_fixpt_win.mdl

Platform independent: vipstabilize_fixpt_all.mdl

Fixed-point versions of this demo that simulate row major data organization:

Windows only: vipstabilize_fixpt_rowmajor_win.mdl

Platform independent: vipstabilize_fixpt_rowmajor_all.mdl

Windows-only demo models might contain compressed multimedia files or To Video Display blocks, both of which are only supported on Windows platforms. The To Video Display block supports code generation, and its performance is optimized for Windows.