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 Anyinput.Connect the image you want to divide by to the second
Image Anyinput.Ensure both images have identical width, height and channels before running the block.
Read the output from the
Image Anyoutput to continue processing or to view the result.
π‘ Tips and Tricks
If the two images are different sizes, use the
Image Resizeblock 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 Imageand combine it with the denominator usingAdd ImagesorAdd 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 ContrastorAdjust Colorsto make subtle differences more visible.Preview intermediate or final images with the
Show Imageblock and save results usingImage LoggerorImage Writeif needed.
π οΈ Troubleshooting
Mismatched image sizes: Ensure both inputs have the same dimensions. Use
Image Resizeto 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