Match Shapes

This function block is used to compare two shapes by analyzing their contours, outputting a resemblance score that indicates how similar the shapes are.

📥 Inputs

Contour The first contour that you want to compare against another.

Contour The second contour for similarity comparison.

📤 Outputs

Resemblance A numerical output (between 0 and 1) indicating the degree of similarity between the two given shapes, where 1 means they match exactly, and 0 means they do not match.

🕹️ Controls

Resemblance A label that displays the calculated resemblance score between the two input shapes.

🎨 Features

Contour Analysis The block performs contour analysis to accurately compare and measure the similarity of shapes based on their geometric properties.

Dynamic Output The score updates in real-time as inputs change, providing immediate feedback.

📝 Usage Instructions

  1. Input Contours: Make sure to connect two contours to the inputs of this function block for comparison.

  2. Run the Block: Execute the block to analyze the shapes.

  3. View Results: Observe the resemblance score displayed in the Resemblance label.

📊 Evaluation

When the block is run, it compares the two shapes and returns a resemblance score based on their relative shapes and features.

💡 Tips and Tricks

Ideal Use Cases

This block works best for detecting shapes like circles, rectangles, and other well-defined contours. For irregular shapes, ensure contours are extracted well beforehand.

Preprocessing Shapes

Before feeding contours into this block, use Contour Filter or Contour Simplification to ensure contours are clean and well-defined, which helps in achieving better resemblance scores.

Working with Multiple Shapes

When working with multiple shapes, consider looping through each shape and comparing it to a reference shape for robust detection.

🛠️ Troubleshooting

Inaccurate Resemblance Scores

If you're receiving unexpected resemblance scores, verify the contours input. Ensure they represent the correct shapes and are preprocessed as necessary.

Contour Input Issues

If you see errors related to contour inputs, check to ensure that both inputs are indeed contours. Any mismatch can lead to incorrect processing.

Last updated