Structural Similarity
This function block compares two images and returns a similarity score (percentage) that reflects how structurally similar they are. It is designed for quick visual comparison tasks such as change detection, quality check, or validation of image processing steps.
π₯ Inputs (sockets)
Image Any First image to compare.
Image Any Second image to compare.
Note: Both input images must have the same resolution and channels for a valid comparison.
π€ Outputs (sockets)
Similarity Percentage Numeric value between 0 and 100 representing the structural similarity of the two inputs.
πΉοΈ Controls
This function block has no interactive controls. It runs when inputs are available.
π― Features
Provides a single numeric similarity score that is easy to use for thresholds and decision logic.
Works directly with color or grayscale images (requires same dimensions).
Simple integration into inspection flows for automated pass/fail checks.
βοΈ Running mechanism
When both image inputs are present and match in size, the block computes a structural similarity score and outputs it as a percentage.
If the images differ in size, the block reports an error and does not produce a valid score.
Designed to be used as a lightweight comparison step inside continuous image-processing pipelines.
π Usage
Provide two images to the input sockets.
Ensure both images have identical dimensions and channel count.
Read the
Similarity Percentageoutput and use it for logging, decision making, or downstream logic.
π‘ Tips and Tricks
To ensure images match in size, use
Image ResizeorImage Resizerbefore this block.If images might be rotated or shifted, add
Auto Alignmentto align them first for more meaningful comparison.To focus comparison on a specific area, crop with
Image ROI Selectand feed the cropped images to this block.Normalize intensity or contrast differences with
Normalize ImageorContrast-Brightness-Gammato reduce false differences caused by lighting.Use
Image AutoRotatorif input orientation may differ between sources.Visualize inputs with
Show Imageto inspect what is being compared.Log or save comparison images and results with
Image LoggerorImage Writefor traceability.Use
Mean Value of ImageorImage Resolution and Channel Valueto quickly check brightness and size before comparison.
π οΈ Troubleshooting
If you see an error about image size, confirm both inputs have the same width, height, and channel count. Consider using
Image Resize.Unexpectedly low similarity despite visually similar images may indicate misalignment, color-range differences, or different crop regions β try
Auto Alignment,Normalize Image, or cropping withImage ROI Select.If no output appears, check that both input sockets are connected and not sending
None. UseShow Imageor debugging blocks to verify incoming data.
Last updated
Was this helpful?