Slice Image

This function block splits an input image into a grid of smaller sub-images. Use it to break large images into tiles for individual analysis, parallel processing, or to generate image galleries.

πŸ“₯ Inputs

Image Any - Main image to be sliced.

Horizontal Percentage - Number of horizontal slices (columns). If empty, defaults to 1.

Vertical Percentage - Number of vertical slices (rows). If empty, defaults to 1.

πŸ“€ Outputs

Image Any - The main image with optional visual hints (same as input or annotated version).

Sliced Images - List of the generated sub-images (each tile from the grid).

Sliced Coordinates - List of rectangle coordinates for each slice (useful to map results back to the original image).

πŸ•ΉοΈ Controls

This block uses the above inputs as its adjustable parameters. Provide values for Horizontal Percentage and Vertical Percentage to control the grid layout.

βš™οΈ Running mechanism

  • When evaluated, the block reads the provided Image Any and the two slice number inputs.

  • It divides the image into a grid using the specified number of columns and rows.

  • The block outputs the full image, a list of individual slice images (in reading order), and the coordinates for each slice so you can relate detections back to the original image.

✨ Features

  • Easy grid-based slicing without needing manual cropping.

  • Returns both slice images and their coordinates for downstream processing.

  • Works with any image size; slices are computed to evenly cover the image area.

πŸ“ Usage instructions

  1. Connect an image producer (camera, file loader, etc.) to Image Any.

  2. Set the desired number of columns via Horizontal Percentage.

  3. Set the desired number of rows via Vertical Percentage.

  4. Run the scenario: the block will output the tiled images and their coordinates for further processing.

πŸ’‘ Tips and Tricks

  • Combine with Show Image to preview individual tiles quickly by connecting one element from Sliced Images into a display workflow.

  • Use Image Resize or Image Resizer before slicing if you need uniform tile sizes or want to reduce processing time.

  • Feed each tile into detection blocks such as Find Object, Object Detection, or Mask Detection to run per-tile analysis and then use Sliced Coordinates to map results back to the original image.

  • After per-tile processing, use Collage Images or Image Concatenate to create a single visual summary from the processed tiles.

  • To save results per tile, connect Sliced Images to Image Logger or Multi Image Write for organized export.

(hint) If you only need a single region instead of a grid, consider using Image ROI Select or Image ROI before slicing to limit the area.

πŸ› οΈ Troubleshooting

  • If tiles appear stretched or unexpected, try adding Image Resize before the block to enforce consistent source dimensions.

  • If you receive fewer tiles than expected, check that Horizontal Percentage and Vertical Percentage are set to integers greater than 0.

  • If downstream detectors miss objects at tile borders, add a small overlap by resizing or pre-cropping with Image ROI and then slicing, so objects crossing boundaries are captured in at least one tile.

Last updated

Was this helpful?