Get Dimension

This function block returns the dimensions of an input image as a list. It is useful when you need to know image width, height and channel information before applying other image operations.

πŸ“₯ Inputs

Image Any This input accepts any image data from other function blocks.

πŸ“€ Outputs

Dimensions Returns the image dimensions (for example: height, width, channels) as a list of numbers.

πŸ•ΉοΈ Controls

This function block has no controls.

🎯 Features

  • Quick retrieval of image shape information to guide downstream processing.

  • Works with color and grayscale images; output reflects the image shape format provided.

πŸ“ Usage Instructions

  1. Connect an image-producing block (camera, loader or processing block) to the Image Any input.

  2. Read the Dimensions output to get the image shape information.

  3. Use the dimension values to configure other blocks or to validate image sizes in your scenario.

πŸ“Š Evaluation

When evaluated, this block inspects the connected image and outputs a numeric list describing its dimensions (e.g., height, width, channels). If no image is provided, no dimension list will be produced.

πŸ’‘ Tips and Tricks

  • Use Load Image or camera input blocks such as Camera USB and Camera IP (ONVIF) as image sources to quickly check incoming image sizes.

  • If you need to preview the image before checking dimensions, attach a Show Image block to the same image source.

  • To measure a cropped region, connect a cropping block like Image ROI or Image ROI Select before this block β€” the Dimensions output will then reflect the cropped area.

  • When working with very large images, consider feeding a resized version using Image Resize or Image Resizer before asking for dimensions to speed up downstream processing.

  • Use Image Resolution and Channel Value if you also want separate width/height/channel outputs or more detailed channel information.

πŸ› οΈ Troubleshooting

  • No output or empty result: ensure an image source is connected to the Image Any input.

  • Unexpected number of elements in the result: some images are grayscale (height, width) while color images include a channel count (height, width, channels). Use Split Image or Image Resolution and Channel Value if you need per-channel information.

  • If the input may occasionally be missing, use blocks like Is None or Replace None upstream to provide fallback data and avoid interruptions.

Last updated

Was this helpful?