Find Object

This function block helps you locate a smaller template image inside a larger image using selectable matching methods and an adjustable sensitivity slider. It provides visual feedback and detailed location outputs to help with inspection, counting, and further processing.

πŸ“₯ Inputs

This block accepts the following input sockets:

  • Main Image Accepts the image where the object search will be performed.

  • Object Image Accepts the template image (single or list) of the object to find.

πŸ“€ Outputs

This block provides the following output sockets:

  • Image Any Visual result where detected matches can be highlighted.

  • Object Positions Coordinates of detected object centers (multiple).

  • Object Count Number of detected objects.

  • Rectangle Coordinates Bounding rectangles for each detected object (multiple).

πŸ•ΉοΈ Controls

  • Method Choose the template matching algorithm to use from a list of available methods.

  • Match Threshold % Adjust the slider to control how strict the matching should be. Higher values reduce false positives but may miss faint matches.

  • Result Displays the detected object count for quick feedback.

🎯 Key Features

  • Visual overlay of detections on the input image for fast verification.

  • Multiple output sockets that provide both visual and numeric detection results for downstream processing.

  • Works with a single template or a list of templates to find the best available match.

πŸ“ How to Use

  1. Provide a source image into the Main Image input.

  2. Provide a template or list of templates into the Object Image input.

  3. Select a Method that fits your scene and template characteristics.

  4. Tune the Match Threshold % slider until detection precision is acceptable.

  5. Inspect results using the visual output and numerical sockets.

βš™οΈ What Happens When It Runs

When executed, the block searches the provided Main Image for regions that match the provided Object Image based on the selected method and threshold. It returns a visualization, the center positions of detections, their count, and bounding rectangles.

πŸ’‘ Tips and Tricks

  • To reduce false matches from noisy images, run the image through Blur or Denoising before this block.

  • If templates and main image sizes differ, use Image Resize to standardize sizes for more reliable matching.

  • To focus search only on a specific area, crop the image first using Image ROI Select and feed the cropped image into this block.

  • After detection, use Rectangles in Rectangle to filter out detections outside a region of interest.

  • Visualize and inspect detections with the Show Image block to confirm results interactively.

  • Save interesting frames or failures using Image Logger or Image Write for audit and tuning.

  • For complex scenes or many object classes consider pairing with Object Detection or Object Detection - Custom blocks when template matching becomes unreliable.

πŸ› οΈ Troubleshooting

  • If no objects are found, try lowering the Match Threshold % or improving template contrast with preprocessing like Contrast Optimization or Adjust Colors.

  • If many false positives appear, increase the Match Threshold % and consider filtering the image with HSV Filter or Image Threshold to emphasize the object.

  • If results vary across images, ensure templates are consistent with expected appearance (scale, rotation, illumination) or use multiple templates via the Object Image input list.

Last updated

Was this helpful?