On this page
vision.template
Configures a native template matching tool and returns a template value.
Syntax
Atlas Script
vision.template(image, threshold?, roi?, enabled?)Parameters
image- Template image path or identifier used by the matching tool.
thresholdOptional- Detection or matching threshold. Higher values require a stronger match.
roiOptional- Optional region of interest: a four-value [x, y, width, height] array. Pass null when the method accepts a full-frame scan.
enabledOptional- Optional boolean that turns this configured tool on or off. Use true to process it and false to keep its configuration without running it.
Return value
Returns template.
Remarks
Configures a native template matching tool and returns a template value. Read/set enabled, overlay, roi, threshold, image; read results, count, target.
Examples
Match template and feature images.atlas
template logoTemplate = vision.template("images/logo.png", 0.82, null, true);
feature iconFeatures = vision.feature("images/icon.png", 0.78, null, true);
match menuMatch = vision.match("images/menu.png", 0.78, null, true);
event on_frame() {
ui.status(string.format("Template {} feature {} match {}", logoTemplate.count, iconFeatures.count, menuMatch.count));
}