1.2 KiB
1.2 KiB
KIE Grid Slice
Slice a grid image into equal tiles, with optional border cropping and gutter removal.
Inputs
- IMAGE: Grid image batch (BHWC float32 0–1).
- grid: Layout (
2x2or3x3). - outer_crop_px: Pixels trimmed from each side before slicing.
- gutter_px: Pixels removed between tiles inside the grid.
- order:
row-major(top-left → right, then down) orcolumn-major(top-left → down, then right). - process_batch:
firstto slice only the first image in the batch,allto slice every image and concatenate tiles. - log: Enable console logging.
Outputs
- IMAGE: Tile batch (4 tiles for
2x2, 9 tiles for3x3per processed image), BHWC float32 in[0, 1].
Behavior
- Applies outer crop, then removes gutters, then slices into tiles.
- Uses floor sizing when dimensions are not perfectly divisible; extra pixels on the right/bottom are dropped.
- Validates crop/gutter to avoid zero or negative tile sizes; raises readable errors when impossible.
- Ordering controls the tile sequence in the output batch. For example,
row-majoron2x2produces tiles in this order:- Top-left
- Top-right
- Bottom-left
- Bottom-right