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.
- 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.
| Layer | Choice |
|---|---|
| Page | HTML, CSS, JavaScript |
| Visualisations | p5.js (interactive demos) |
This project is licensed under the MIT License.