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 Anyand 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
Connect an image producer (camera, file loader, etc.) to
Image Any.Set the desired number of columns via
Horizontal Percentage.Set the desired number of rows via
Vertical Percentage.Run the scenario: the block will output the tiled images and their coordinates for further processing.
π‘ Tips and Tricks
Combine with
Show Imageto preview individual tiles quickly by connecting one element fromSliced Imagesinto a display workflow.Use
Image ResizeorImage Resizerbefore 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, orMask Detectionto run per-tile analysis and then useSliced Coordinatesto map results back to the original image.After per-tile processing, use
Collage ImagesorImage Concatenateto create a single visual summary from the processed tiles.To save results per tile, connect
Sliced ImagestoImage LoggerorMulti Image Writefor 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 Resizebefore the block to enforce consistent source dimensions.If you receive fewer tiles than expected, check that
Horizontal PercentageandVertical Percentageare 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 ROIand then slicing, so objects crossing boundaries are captured in at least one tile.
Last updated
Was this helpful?