Skip to content

About

Interactive visual guide to Principal Component Analysis (PCA) for object tracking in computer vision, with animations in p5.js.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

PCA Image Tracking - Find an object's direction with PCA

PCA Image Tracking is an interactive article that explains Principal Component Analysis from first principles and applies it to computer vision: finding an object's position and orientation in an image, then tracking both over time in a video. It is a static website with live p5.js demos, no backend.

Live demo →

What it does

  • Isolates the object. Surveys classic segmentation methods (Otsu thresholding, k-means, Canny, blob detection), and for videos with a static background uses simple motion detection: grayscale conversion, absolute difference between consecutive frames, then thresholding.
  • Builds the math step by step. Variance, covariance, matrices as linear maps, eigenvectors and eigenvalues, and the spectral theorem. Optional "Further explanations" blocks give the formal definitions.
  • Derives the direction. The pixel blob is treated as two joint distributions (x and y coordinates). Its covariance matrix is symmetric, so its eigenvectors are orthogonal and give the object's principal axes, i.e. its direction.
  • Lets you play with it. Interactive widgets let you draw a distribution and read its covariance, apply a matrix to a circle and watch the shape change, highlight eigenvectors, and draw a filled shape to see its direction computed live.

Tech stack

Layer Choice
Page HTML, CSS, JavaScript
Visualisations p5.js (interactive demos)

License

This project is licensed under the MIT License.

About

Interactive visual guide to Principal Component Analysis (PCA) for object tracking in computer vision, with animations in p5.js.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages