Infinite Data Factory

Neural networks are data-hungry. To train a model that survives a 35-degree tilt, we need thousands of examples. Taking physical photographs is impossible. Instead, we use the Browser-as-a-Generator.

The OffscreenCanvas API

We use the browser's 2D canvas API to programmatically "draw" our 21x21 grid in the background. This allows us to generate thousands of training frames without ever touching the DOM.

Total Randomization

To teach the network that only the Geometry of the corner matters, we randomize everything else. For every frame, we change:

Absolute Ground Truth

When we apply a mathematical Perspective Warp to the canvas, we compute the new floating-point coordinates of the four corners in real-time. This creates a "Perfect Label"—an error-free ground truth that no human annotator could ever achieve.

const context = offscreen.getContext('2d');
applyPerspWarp(pts, ctx, random_theta);
results: [x1, y1, x2, y2, x3, y3, x4, y4]
Corner TL (x,y)
0.12, 0.15
Corner TR (x,y)
0.88, 0.18
Corner BR (x,y)
0.91, 0.92
Corner BL (x,y)
0.08, 0.85
Warping up to 35° Dynamic Range