# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

# Motion Estimation

Track object motion between video frames

Motion estimation is the process of determining the movement of blocks between adjacent video frames. This toolbox includes motion estimation algorithms, such as optical flow, block matching, and template matching. These algorithms create motion vectors, which relate to the whole image, blocks, arbitrary patches, or individual pixels. For block and template matching, the evaluation metrics for finding the best match include MSE, MAD, MaxAD, SAD, and SSD.

## Functions

 `opticalFlow` Object for storing optical flow matrices `opticalFlowFarneback` Estimate optical flow using Farneback method `opticalFlowHS` Estimate optical flow using Horn-Schunck method `opticalFlowLK` Estimate optical flow using Lucas-Kanade method `opticalFlowLKDoG` Estimate optical flow using Lucas-Kanade derivative of Gaussian method
 `vision.BlockMatcher` Estimate motion between images or video frames `vision.TemplateMatcher` Locate template in image

## Blocks

 Block Matching Estimate motion between images or video frames Optical Flow Estimate object velocities Template Matching Locate a template in an image

## Topics

### MATLAB Workflow

Optical Flow Estimation Using the Farneback Algorithm

Estimate car motion using the Farneback algorithm.

Compute Optical Flow Using Lucas-Kanade derivative of Gaussian

Estimate car motion using the Lucas-Kanade derivative of Gaussian.

Compute Optical Flow Using Horn-Schunck Method

Estimate car motion using the Horn-Schunck method.

Construct Optical Flow Object and Plot Its Velocity

Plot the velocity of a moving object in a quiver plot.

This example shows how to use color information to detect and track road edges set in primarily residential settings where lane markings may not be present.

Lane Departure Warning System

This example shows how to detect and track road lane markers in a video sequence and notifies the driver if they are moving across a lane.

Tracking Cars Using Foreground Detection

This example shows how to detect and count cars in a video sequence using Gaussian mixture models (GMMs).

Tracking Cars Using Optical Flow

This example shows how to detect and track cars in a video sequence using optical flow estimation.