Divide Images

This function block performs a pixel-wise division of two images to produce a new image. It is useful for normalization, ratio measurements, defect highlighting and other image arithmetic tasks where one image is used to scale or correct another.

πŸ“₯ Inputs

Image Any First image input (numerator). Provide a regular image to be divided.

Image Any Second image input (denominator). Provide an image with the same dimensions as the first.

Note: sockets above are inputs and both must be connected with images of matching size and channel layout.

πŸ“€ Outputs

Image Any Resulting image after pixel-wise division of the first input by the second input.

πŸ•ΉοΈ Controls

This block has no interactive widgets. Configure inputs upstream before evaluation.

🎨 Features

  • Pixel-wise division result with proper image range handling suitable for visualization or further processing.

  • Direct replacement in pipelines where comparative or normalized images are required.

  • Designed to work with images that share identical dimensions and channels.

βš™οΈ Running mechanism

When the block runs it takes the two connected images and computes a pixel-wise division of the first image by the second. The block expects both images to match in size and channel layout; if they do not match, the block cannot perform the operation and will require you to correct the inputs before successful evaluation.

πŸ“ Usage instructions

  • Connect the image you want to divide to the first Image Any input.

  • Connect the image you want to divide by to the second Image Any input.

  • Ensure both images have identical width, height and channels before running the block.

  • Read the output from the Image Any output to continue processing or to view the result.

πŸ’‘ Tips and Tricks

  • If the two images are different sizes, use the Image Resize block upstream to resample one image to match the other.

  • To avoid problems with zero or near-zero pixels in the denominator, add a small constant image before division. Create a small-value image with Make Image and combine it with the denominator using Add Images or Add Images Weighted.

  • Normalize inputs first (for example with Normalize Image) if you expect wide dynamic range differences between the two images.

  • For visualization after division, use Auto Contrast or Adjust Colors to make subtle differences more visible.

  • Preview intermediate or final images with the Show Image block and save results using Image Logger or Image Write if needed.

πŸ› οΈ Troubleshooting

  • Mismatched image sizes: Ensure both inputs have the same dimensions. Use Image Resize to fix mismatches.

  • Unexpected artifacts or blown-out pixels: Check for zero or very small values in the denominator and add a small constant if necessary. Also consider normalizing the inputs first.

  • Strange color shifts: Confirm both images share the same channel order (e.g., BGR/RGB) and channel count. Use color conversion or channel operations upstream if needed.

Last updated