Feature Detector
This function block finds an object in a live or static image by matching features from a provided training image. It compares distinctive points between the training image and the input image, attempts to estimate the object's position and rotation, and provides a visual and numeric result.
π₯ Inputs
Train Image The reference image that contains the object to detect. Provide a clear, well-lit crop of the object.
Input Image From Camera The image where the block will search for the object (live camera frame or loaded image).
These are input sockets.
π€ Outputs
Detected Image The input image annotated with detection graphics (e.g., contour and center) when the object is found.
Detect Status A boolean indicating whether the object was detected (true/false).
Center The (x, y) coordinates of the detected object's center.
These are output sockets.
πΉοΈ Controls
Homography Type Choose the method used for estimating the geometric transform between images.
Compute Type Select the internal computation preference (quality vs performance).
Number of features How many keypoints/features to detect in the training image.
Distance Threshold Tolerance used when matching features (affects match acceptance).
K nearest Number of nearest matches considered when comparing descriptors.
Pyramid Decrease Ratio Controls scale down steps for multi-scale detection.
Pyramid Levels Number of pyramid levels used in multi-scale processing.
Point Compare Type Internal parameter affecting how points are compared.
These are widgets you can tune to adjust detection behavior.
βοΈ How it runs
The block extracts features from the provided
Train Imageusing the chosen feature/computation settings.It then searches the
Input Image From Camerafor matching features and attempts to estimate the object's location and orientation.If a valid transformation is found, the block annotates the input image with a bounding contour and a center point, sets
Detect Statusto true, and outputs the detected center coordinates.If no valid match is found,
Detect Statusis false andCenteris returned as a default coordinate.
The block continuously evaluates when connected to live sources, so tuning controls will update behavior in near real time.
β¨ Key features
Robust feature-based detection that handles rotation and scale changes.
Multi-parameter tuning for quality vs performance trade-offs.
Visual feedback via an annotated
Detected Imageto confirm results.Outputs both a boolean status and exact center position for downstream logic.
π Usage instructions
Provide a clear cropped example of the object to
Train Image. Prefer images with distinct textures or corners.Connect a camera frame or image to
Input Image From Camera.Start with moderate values: set
Number of featuresto a few hundred andDistance Thresholdto a middle value.Run the system and observe the
Detected Image. AdjustHomography Type,Number of features,Distance Threshold, andK nearestto improve reliability.Use the boolean
Detect Statusto trigger actions (logging, saving, counting) or feed theCenterinto other blocks.
π‘ Tips and Tricks
If object and camera scales differ, use
Image Resizebefore this block so the training image and input image are closer in scale.Crop the search area with
Image ROI Selectto speed up detection and avoid false matches from cluttered backgrounds.Improve robustness under noisy conditions with
Blurto remove high-frequency noise, or useContrast Optimizationto enhance contrast before detection.Use
Show Imageto preview detection results interactively while you tune controls.For drawing and reporting results, combine with
Draw Detectionsto overlay detections cleanly on output images.If template-based matching is more suitable for your object, consider trying the
Find Objectblock as an alternative or complementary approach.To store examples or results for offline review, pair with
Image Logger.
(hints above refer to available function blocks you can combine in a flow.)
π οΈ Troubleshooting
No detection: increase
Number of features, relaxDistance Threshold, or provide a clearer training image. Try differentHomography Typevalues.False positives: reduce
Number of featuresor tightenDistance Threshold. Crop the image usingImage ROI Selectto eliminate confusing backgrounds.Slow performance: lower
Number of features, reduce pyramid levels, or run a smaller search region. Preprocess withImage Resizeto reduce input dimensions.Poor results under low contrast: apply
Contrast Optimizationfirst or capture a higher-quality training image.
If results remain inconsistent, iterate: adjust controls incrementally and use Show Image to visually confirm the changes.
Last updated
Was this helpful?