Skip to content
CoreSource checked

Lucas-Kanade Optical Flow

Estimates local image motion by solving small least-squares systems over patches.

Quick Facts

Compact metadata for implementation and discovery.

Category
Image Processing
Difficulty
Advanced
Family
Optical Flow
Tier
Core
Status
Verified
Review
Source Checked
Sources
2
Formulas
1
Relationships
3
Code example
Ready
Visualization
Ready

Overview

Lucas-Kanade optical flow assumes nearby pixels move together and solves for the displacement that best matches brightness changes.

Core Concepts

brightness constancylocal patchleast squaresimage gradient

Quick facts

Complexity

Runtime and memory behavior at a glance.

Best

O(pixels)

Average

O(pixels * window)

Worst

O(pixels * window)

Space

O(pixels)

When to Use

  • Use when image enhancement needs brightness constancy.
  • Use when the input matches the assumptions behind optical Flow.

When Not to Use

  • Avoid when image noise, lighting, or scale breaks the algorithm's assumptions.
  • Avoid when a simpler algorithm gives the required result with less setup.

What It Does

  • Estimates local image motion by solving small least-squares systems over patches
  • Uses brightness constancy and local patch to guide the work.
  • Produces processed image.

Use Cases

  • Image enhancement
  • Feature extraction
  • Segmentation and motion analysis

Inputs

  • Image or image sequence
  • Kernel, threshold, or model parameters

Outputs

  • Processed image
  • Mask
  • Feature map or motion field

Key Formulas (1)

Optical flow constraint

Ix · u + Iy · v + It = 0
I_x * u + I_y * v + I_t = 0

Relates image gradients to local motion components.

Pseudocode

  1. 1.Normalize the image and choose border handling
  2. 2.Evaluate the local filter, statistic, model, or response for each relevant pixel or region
  3. 3.Threshold, rank, refine, or combine the responses
  4. 4.Return the mask, transformed image, feature set, or geometric estimate

Canonical Example

Input
a small grayscale image patch with a clear edge, corner, or region
Output
Processed image
Explanation
Lucas-Kanade Optical Flow applies brightness constancy to produce processed image.

Implementation Notes

  • Handle borders and pixel coordinate conventions consistently.
  • Keep the brightness constancy step separate enough to test independently.
  • Keep coordinate conventions, border handling, and image normalization explicit in tests.

Common Pitfalls

  • Applying operations in the wrong color space can distort the result.
  • Test edge cases, not only clean examples.
  • Thresholds tuned on one clean image can fail under different lighting, scale, blur, or noise.

Interactive Mechanism Walkthrough

Spatial Primitive & Sweep-Line Canvas

Show the source image beside masks, filters, or motion vectors produced by the algorithm.

Lucas-Kanade Optical Flow mechanism walkthrough step 1 of 4
Step 1 of 4: Normalize the image and choose border handling
image-processing-mechanism

Notes

Lucas-Kanade Optical Flow should be used with the assumptions and tradeoffs of optical Flow in mind.

Sources (2)

What each reference supports for this entry.

Computer Vision: Algorithms and Applications

Book

Computer-vision textbook support for Lucas-Kanade Optical Flow's feature, matching, flow, or multiscale image-analysis workflow.

Open source

Lucas-Kanade Image Registration

Paper

Original reference for local least-squares image registration underlying Lucas-Kanade optical flow.

Open source

Explore Next

Good next jumps from the relationship graph, ranked for useful discovery.

Pyramidal Lucas-Kanade uses image pyramids to handle larger motions across scales.

Tags

Image ProcessingMotion EstimationLinear AlgebraEstimation