A square model input does not require stretching every rectangular product photograph into a square. The resize policy determines how shape information reaches the model.
OpenCV documents image-resizing operations and geometric transformations. OpenCV — geometry.
Define the transformation
For a character task, choose an appropriate approach and record whether it changes proportions, adds padding or removes content. A preprocessing default can otherwise become an undocumented design distortion.

Map results back correctly
Coordinates predicted on a transformed image must be interpreted in the correct reference frame. Test that mapping with known examples before displaying annotations on the original. An accurate prediction can appear misplaced when the transformation bookkeeping is wrong.

Source reviewed 25 October 2026. Interpretation and original diagrams: PLUSHIP / Qunhe. Examples are illustrative.
Related reading
A Pipeline Keeps Learned Preprocessing With the Model
A Crop Can Remove the Evidence Needed for a Vision Decision
