liveBook · Manning

Standard square

As explained in Geometry for Programmers

A standard square is a normalized square coordinate region used as an intermediate domain for planar transformations.

A standard square is a normalized square coordinate region with side length 1, beginning at (0, 0). It provides a convenient intermediate domain for planar transformations. section 4.4.1

For a rectangular target, scaling maps the rectangle to the standard square. A projective transformation can then map that normalized square to four corresponding points in a photographed source image. section 4.4.1

The normalized coordinates simplify implementation:

  • Use the corners (0, 0), (1, 0), (1, 1), and (0, 1). section 4.4.1
  • Substitute these fixed coordinates into the transformation equations to reduce one large system into smaller solvable pieces. section 4.4.1
  • Reuse the resulting formulas for g and h with each set of four source points. section 4.4.1

Phone-scanned document

To recover a flat rectangular picture from a phone photograph, process each target pixel through the rectangle-to-standard-square scaling step, then map the normalized coordinate into the photographed quadrilateral. section 4.4.1

Figure 4.20 Before and after: undoing the natural perspective in a picture
04-20

Compare the photographed perspective with the corrected rectangular result. section 4.4.1

How Geometry for Programmers covers it

How deep it goes
Defines the region and works through coordinate substitutions and equation reduction, stopping short of broader surface algorithms.
Examples
Demonstrates phone-scanned document correction and gives the four normalized corner coordinates.
What it assumes
Assumes familiarity with rectangular coordinates and introduces normalization through scaling before applying projective equations.
What you can do after
Apply it as an intermediate coordinate domain when computing four-point planar transformations.
How it connects
Connects scaling, projective transformations, perspective correction, planes, and surfaces.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Geometry for Programmers. The section links point to the parts of the book it draws on.