On this page
vision.contour
Configures native contour/blob extraction and returns a contour value.
Syntax
Atlas Script
vision.contour(lower, upper, roi?, min_area?, enabled?)Parameters
lower- Lower HSV threshold array for the accepted color range.
upper- Upper HSV threshold array for the accepted color range.
roiOptional- Optional region of interest: a four-value [x, y, width, height] array. Pass null when the method accepts a full-frame scan.
min_areaOptional- Minimum detected area to retain. Smaller candidates are ignored.
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 contour.
Remarks
Configures native contour/blob extraction and returns a contour value. Read/set enabled, overlay, roi, lower, upper, min_area; read results, count, target.
Examples
Count contour blobs.atlas
const centerRoi = [0.25, 0.25, 0.50, 0.50];
contour blobs = vision.contour([0, 90, 80], [15, 255, 255], centerRoi, 40, true);
event on_frame() {
ui.status(string.format("Blobs: {}", blobs.count));
}