tatmapper-app

Printed-target perspective model

Coordinate spaces

TatMapper retains:

  1. the orientation-normalized original photo;
  2. the four observed target corners in original-photo pixels;
  3. a source-to-working projective transform;
  4. its working-to-source inverse; and
  5. a bounded rectified working image.

All trace strokes and design placement created after rectification are stored in working-image pixels. Printer correction is not part of either transform.

Corner contract

Handles are ordered top-left, top-right, bottom-right, bottom-left. The quadrilateral must:

Invalid geometry is rejected with a recovery action rather than silently reordered.

Homography

The solver maps the observed quadrilateral to a metric rectangle whose width and height come from the target’s authoritative physical square. It solves the eight independent projective coefficients with the final coefficient fixed to one, then computes and stores the matrix inverse.

[x']   [h00 h01 h02] [x]
[y'] = [h10 h11 h12] [y]  divided by w
[w ]   [h20 h21  1 ] [1]

Forward/inverse round-trip tests, known perspective fixtures, degenerate-input tests, persisted-matrix validation, and rectified-pixel fixtures protect the contract. Expensive resampling runs outside the UI isolate and writes the working image atomically.

Limits

The result corrects projective distortion only for one plane. It does not correct lens distortion, a bent target, an off-plane reference, or body curvature. The source photo remains available for audit and recalibration.