AI Glossary / Computer vision and multimodal AI / Beginner
Motion vector
Definition
A motion vector is a numerical description of movement between positions, usually expressed as horizontal and vertical displacement in an image. In video processing it can indicate how a pixel, feature, or block corresponds to a location in another frame. Its meaning depends on the coordinate system, reference picture, direction convention, and time interval.
What it means
A vector such as (4, −2) is incomplete without context. It might mean four pixels right and two pixels up under an image convention where downward is positive. A codec may instead store a vector in fractional-pixel units or use it to point from a current block toward a reference location.
Motion vectors can be estimated from images, computed from known geometry, or selected for efficient compression. These origins matter. A compression vector can identify a useful prediction block without faithfully following a physical object. The numbers should therefore be interpreted according to the process that produced them.
How it works
Choose a source location and identify its corresponding or predictive location in another image. Subtract coordinates using the defined direction to obtain displacement. A field of vectors can describe many locations, while a single vector may summarize one block or feature.
Algorithms can estimate vectors through block matching, feature correspondence, optical flow, or model-based projection. Subpixel methods permit fractional coordinates using interpolation. To convert displacement into image velocity, divide by the actual elapsed time. Physical velocity requires additional camera geometry and scene information. Invalid matches, occlusion, and uncertain regions should be represented explicitly instead of being silently interpreted as confident zero motion.
Three practical examples
1. A video player decodes a block prediction using a motion vector and a specified reference picture. Residual data then correct the prediction where necessary.
2. A tracking tool draws arrows between a feature's positions in successive frames. The arrows make direction and relative displacement easy to inspect.
3. A rendering pipeline stores screen-space motion vectors for temporal effects. Incorrect vectors at newly visible surfaces can cause ghosting or misplaced reuse of earlier image data.
Think of it this way
Think of a note saying “move three squares right and one square down on this grid.” It describes a displacement, but only if both people agree on the grid and starting point. The same numbers on a map with different scale mean a different distance. Image motion vectors similarly need units and reference conventions before they can be compared or applied.
Worked example
A feature appears at (120, 80) in one frame and (126, 77) in the next. Using forward displacement and coordinates with x increasing rightward and y increasing downward, its vector is (6, −3) pixels. The magnitude is √(6² + 3²), approximately 6.71 pixels.
If the frames are 0.02 seconds apart, the average image velocity is (300, −150) pixels per second, with magnitude about 335.4 pixels per second. This still says nothing definite about meters per second without scene calibration.
Under a simple backward correspondence for this same point, the destination location points back by (−6, 3). That does not mean the object reversed direction; it reflects the changed mapping convention. If a storage format uses quarter-pixel units, the forward vector may be stored as integer components (24, −12), which decode to the same displacement. Reading those integers as whole pixels would introduce a fourfold error.
Illustrative case study
Fictional case: A software team integrates motion vectors from a renderer into a temporal image-processing stage. Moving objects develop trails despite apparently reasonable vector magnitudes. The two components use opposite direction conventions: one supplies previous-to-current displacement while the other expects current-to-previous sampling offsets.
The team tests a single square moving a known number of pixels, checks axis orientation and units, and confirms how disoccluded regions are marked. Once the interface is documented, the test becomes a reusable check for later renderer changes. The scenario illustrates a data-contract failure rather than a need for a more sophisticated motion estimator.
Common misconceptions and mistakes
A motion vector is not necessarily an object's full trajectory. It describes a relationship over a particular interval or between selected references. One block may contain multiple moving surfaces, so its chosen vector can only approximate their combined content.
Do not compare vector magnitudes across videos without accounting for frame timing and image resolution. A zero vector can indicate true lack of image displacement, a coding choice, or missing information represented poorly. Also distinguish an arrow drawn for visualization from the underlying numerical field: arrows may be rescaled, subsampled, or clipped for display.
Business use
Motion vectors support compression, stabilization, temporal filtering, visual effects, and compressed-video analytics. They can offer a compact description of image relationships, but their usefulness depends on compatible definitions throughout the pipeline.
Document vector direction, units, axis orientation, reference index, time interval, and validity information. Test simple known motions before using complex footage. For analytics, validate codec-derived vectors against the intended measurement rather than assuming that coding decisions recover true movement. For rendering, inspect object boundaries and newly visible regions where past-frame information may not exist.
People also ask
Must motion vectors contain integer pixel values?
No. Fractional-pixel values are common, sometimes stored as scaled integers.
Does a longer vector always mean a faster object?
Not across different frame intervals, scales, depths, or coordinate conventions.
Can two valid systems use opposite signs for the same correspondence?
Yes. Forward displacement and backward sampling conventions can reverse the vector direction.
Check your understanding
A stored horizontal component is 12 and the format uses quarter-pixel units. What displacement does it represent?
Answer: Three pixels in the defined horizontal direction. The unit scale must be applied before interpreting the stored number.
Related terms
- Motion field
- Optical flow
- Block matching
- Motion compensation
- reference frame
- subpixel estimation
- displacement
- image velocity
Learn next
Create a short sequence with a square moving exactly four pixels right per frame. Inspect the vectors produced or required by two processing stages, including their direction and scale. Then double the frame interval and separately double image resolution to see why raw vector magnitude alone is not a universal speed measure.
More in Computer vision and multimodal AI
- Motion capture - Motion capture is the recording of a person's or object's movement as digital motion data.
- Motion coding - Motion coding is the representation of motion-related information in a compressed video stream so that a decoder can predict image content from reference...
- Motion estimation - Motion estimation is the process of estimating how image content changes position between frames or views.
- Motion-JPEG - Motion-JPEG, often written MJPEG or M-JPEG, represents video as a sequence of separately JPEG-compressed images.
- Moving least squares (MLS) deformation - Moving least squares (MLS) deformation is a way to warp an image or shape from a set of control handles.
- Moving object detection - Moving object detection is the identification of image regions or objects that are moving over time.
Sources
Primary technical sources: ITU-T H.264 (08/2021), inter-prediction and motion-vector discussion, https://www.itu.int/rec/dologin_pub.asp?id=T-REC-H.264-202108-S!!PDF-E&lang=e&type=items ; MathWorks, tracking and motion estimation, https://www.mathworks.com/help/vision/tracking-and-motion-estimation.html . Relevant returned descriptions were reviewed. The coordinate, quarter-pixel, and integration examples are original illustrations; actual storage conventions depend on the system.
Previous: Motion planning Next: Move generation