Divide Images

This function block performs a per-pixel division of two images. Use it when you need to compute a ratio image (for example: illumination correction, normalization by a reference image, or computing relative change between two captures).

πŸ“₯ Inputs

Image Any First image (numerator). Image Any Second image (denominator).

Note: Both input sockets must provide images with the same dimensions and channel layout.

πŸ“€ Outputs

Image Any Resulting image after per-pixel division.

πŸ•ΉοΈ Controls

This function block has no user-facing controls; it computes the result directly from the two inputs.

🎨 Features

  • Performs element-wise division between two images.

  • Preserves the input image type and channels when both inputs match.

  • Will report an input-size mismatch if images differ in resolution or channels.

πŸ“ Usage Instructions

  1. Provide the first image to the first input socket (numerator).

  2. Provide the second image to the second input socket (denominator).

  3. The block outputs the divided image on the output socket.

If the input images are not the same size, the block will raise an input mismatch error β€” resample one image first.

πŸ“Š Evaluation

On execution the block checks that both images have identical dimensions. If they match, the block returns the per-pixel divided image. If not, it signals an incorrect input configuration.

πŸ’‘ Tips and Tricks

  • If your images differ in size, add Image Resize or Image Resizer before this block to match resolutions.

  • To avoid visual artifacts from dividing by zero, mask or replace zero-valued pixels in the denominator using Apply Mask (or prepare a small nonzero floor in the denominator).

  • After division, use Normalize Image to rescale the result for visualization or further processing.

  • Use Blur or Denoising before division to reduce noise amplification in the ratio image.

  • Combine with Show Image to preview results and with Image Write or Image Logger to save outputs for later analysis.

πŸ› οΈ Troubleshooting

  • Problem: "Images must be the same size" β€” Solution: insert Image Resize or Image Resizer to match dimensions and channels.

  • Problem: "Black or noisy output / Inf or NaN pixels" β€” Solution: ensure the denominator contains no zeros (use Apply Mask to exclude zeros or replace them), and consider smoothing (Blur) before dividing.

  • Problem: "Unexpected color format" β€” Solution: ensure both inputs are using the same channel layout (both RGB/BGR or both grayscale) before connecting.

Last updated

Was this helpful?