Structural Similarity

This function block is designed to evaluate the similarity between two images using the Structural Similarity Index (SSIM). It outputs a similarity percentage indicating how closely the two images match.

📥 Inputs

Image Any The first image for comparison.

Image Any The second image to compare against the first image.

📤 Outputs

Similarity Percentage A numeric output representing the similarity percentage between the two input images. The closer this value is to 100%, the more similar the images are.

🕹️ Controls

This block does not have any controls for user input; it operates based on the connected images.

🎨 Features

Grayscale Conversion Automatically converts color images to grayscale for similarity computation, thus simplifying the process.

Similarity Scoring Outputs a percentage that quantifies the similarity, making it easy to gauge the match quality.

📝 Usage Instructions

  1. Connect Images: Link two images to the inputs. Ensure both images are of the same size for the comparison to be valid.

  2. Evaluate: Run the block. It will compute the similarity and provide the output percentage.

📊 Evaluation

Upon execution, this function block will compare the two input images and give a similarity score. If the images match closely, the output will be near 100%.

💡 Tips and Tricks

Handling Different Sizes

Ensure that both images have the same dimensions. If they do not, consider using the Image Resize function block to adjust their sizes before using this block.

Image Quality Considerations

Higher quality images typically yield better similarity scores. When working with images of varying quality or compression levels, results may vary.

Using Preprocessing

To improve similarity results for images with noise or other artifacts, consider using a Denoising function block before applying the structural similarity comparison.

🛠️ Troubleshooting

Invalid Input Sizes

If you encounter an error about image size, verify that both input images are of identical dimensions. You may need to resize one or both images using the Image Resize function.

No Similarity Output

If the output is None, ensure both input images are provided and are valid. Additionally, check the shapes of the input images to confirm they match.

Last updated