The Pathology of Distortion

Traditional computer vision (CV) is built on a foundation of Heuristics—hand-crafted rules designed to solve geometric problems in ideal conditions. But the real world is rarely ideal.

The Centroid Perspective Shift

When you tilt a physical grid, the Centroid of a square is no longer its geometric center. In a perspective projection, the edge closer to the camera appears larger than the edge further away.

Calculating the center of mass using cv.moments on a tilted contour pull the coordinate toward the "fat" edge. This shift—sometimes just 1 or 2 pixels—is enough to make a high-density 21x21 grid extraction fail entirely.

Aliasing and Stochastic Jitter

Our digital sensors are discrete grids. When an edge falls "between" pixels, the intensity values are averaged (Aliasing). Traditional peak-finding logic often snaps to the closest integer pixel.

The Ripple Effect: A homography matrix derived from 4 corners is extremely sensitive. If your corner estimates are off by just 1.5 pixels, by the time the sampler reaches the center of a 21x21 grid, the drift can exceed 5 pixels—pulling colors from the black grid lines instead of the intended RGB cell.

Adjust the tilt in the visualizer to observe how the visual "center" deviates from the projection's true mathematical center.

Perspective Stress Test
Camera Tilt (X-Axis) 20°
CV SAMPLING ERROR @ CENTER:
Drift: 2.14px (CRITICAL)