Cropping with Half-Open Bounds
A rectangular crop selects a range of rows and a range of columns under a coordinate convention.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
Trace a three-by-two crop
Rows from 1 through before 3 and columns from 2 through before 5 give two rows and three columns. Half-open slices give the size from endpoint differences.
Translate positions into the crop
The global pixel at row 1 and column 2 becomes row zero and column zero in the crop. An operation preserving original positions must keep both starting offsets. See image coordinate roles.[1][2]