| Home | | | Quick start | | | Cookbook | | | All symbols | | | Analytical index | | | Namespaces | | | Syntax | | | Statements | | | CX | | | Frequency | | | Functions | | | Examples | | | Examples by command |
These statements manipulate image matrices or stacks and create new media objects. They are listed here for users who think in terms of image operations rather than generic statements.
CV.COMPLEX_CONJ complexImage AS dst
Computes the complex conjugate of a complex image by negating the imaginary channel.
CV.COMPLEX_CONJ complexImage AS dstCV.COMPLEX_MAGNITUDE complexImage AS magnitudeImage
Computes per-pixel magnitude sqrt(re^2 + im^2) from a complex image.
CV.COMPLEX_MAGNITUDE complexImage AS magnitudeImageCV.COMPLEX_PHASE complexImage AS phaseImage
Computes per-pixel phase angle atan2(im,re), in radians, from a complex image.
CV.COMPLEX_PHASE complexImage AS phaseImageCV.MERGE_COMPLEX realImage, imagImage AS complexImage
Merges two same-size single-channel images into a CV_32FC2 complex image: channel 0 is real, channel 1 is imaginary.
CV.MERGE_COMPLEX re, im AS zimgCV.SPLIT_COMPLEX complexImage AS realImage, imagImage
Splits a CV_32FC2/CV_64FC2 complex image into real and imaginary single-channel images.
CV.SPLIT_COMPLEX zimg AS re, imCV.CANVAS width, height [, channels [, background]] AS dst
Creates a new 8-bit canvas image with 1 to 4 channels and a constant background value.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
channels | Number of channels to create or process. |
background | Initial canvas background value. |
CV.CANVAS width, height [, channels [, background]] AS dstCV.CHANNEL src, index AS dst
Extracts one channel as a single-channel image or stack.
CV.CHANNEL src, index AS dstCV.CLONE src AS dst
Duplicates the image or stack object.
CV.CLONE src AS dstCV.COLOR src, mode AS dst
Converts between common color spaces such as BGR, HSV, Lab, and gray.
CV.COLOR src, mode AS dstCV.CONVERT src, depth [, alpha [, beta]] AS dst
Converts OpenCV depth with optional scale and offset. Depth tokens include 8U, 16U, 32F, 64F and SAME.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
alpha | Multiplicative scale factor. |
beta | Additive offset after scaling. |
CV.CONVERT img, "32F", 1.0 / 255.0 AS fCV.GRAY src AS dst
Converts to grayscale; on stacks it operates frame-by-frame.
CV.GRAY src AS dstCV.INVERT src AS dst
Inverts pixel intensity; on stacks it operates frame-by-frame.
CV.INVERT src AS dstCV.MERGE ch0, ch1 [, ch2 [, ch3]] AS dst
Merges one to four single-channel images/stacks into a multi-channel result.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
ch2 | Optional parameter. If omitted, the command uses its internal default. |
ch3 | Optional parameter. If omitted, the command uses its internal default. |
CV.MERGE ch0, ch1 [, ch2 [, ch3]] AS dstCV.SCALE_ABS src [, alpha [, beta]] AS dst
Applies OpenCV convertScaleAbs, useful for visualizing gradients and signed/float maps.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
alpha | Multiplicative scale factor. |
beta | Additive offset after scaling. |
CV.SCALE_ABS grad, 2.0 AS visCV.TO32F src [, scale [, beta]] AS dst
Converts to 32-bit float using optional scale and offset.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
scale | Multiplicative scale factor; for geometric transforms it may mean image scale around the center. |
beta | Additive offset after scaling. |
CV.TO32F img, 1.0 / 255.0 AS fCV.TO8U src [, alpha [, beta]] AS dst
Converts to 8-bit unsigned using optional alpha and beta.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
alpha | Multiplicative scale factor. |
beta | Additive offset after scaling. |
CV.TO8U f, 255.0 AS u8CV.ADAPTIVE_THRESHOLD src [, blockSize [, c]] AS dst
Applies an adaptive threshold frame-by-frame.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
blockSize | Local analysis window size used by the algorithm. |
c | Optional parameter. If omitted, the command uses its internal default. |
CV.ADAPTIVE_THRESHOLD src [, blockSize [, c]] AS dstCV.CIRCLE_MASK width, height, cx, cy, radius [, value] AS dst
Creates a single-channel circular mask.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
value | Scalar value written, drawn, or used as foreground/background according to the command. |
CV.CIRCLE_MASK 80, 60, 40, 30, 12 AS maskCV.COMPARE src, op, value AS dst
Creates a mask by comparing pixels with a scalar value. Operators: >, >=, <, <=, ==, !=.
CV.COMPARE img, ">", 128 AS maskCV.FILL_HOLES mask AS dst
Fills internal holes of a binary mask derived from non-zero pixels.
CV.FILL_HOLES mask AS filledCV.INRANGE src, low, high AS dst
Segments pixels whose values fall inside a scalar range; the range is applied to all channels.
CV.INRANGE src, low, high AS dstCV.INRANGE_COLOR src, low0, low1, low2, high0, high1, high2 AS dst
Creates a 3-channel scalar range mask, useful after HSV/Lab conversion.
CV.COLOR img, "BGR2HSV" AS hsv
CV.INRANGE_COLOR hsv, 20, 60, 60, 40, 255, 255 AS maskCV.KEEP_LARGEST mask AS dst
Keeps only the largest connected foreground component of a binary mask.
CV.KEEP_LARGEST mask AS mainObjCV.OTSU src AS dst
Computes an automatic Otsu threshold on the grayscale source.
CV.OTSU src AS dstCV.RECT_MASK width, height, x, y, w, h [, value] AS dst
Creates a single-channel rectangular mask. Legacy command equivalent to MASK.RECT with explicit coordinates.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
value | Scalar value written, drawn, or used as foreground/background according to the command. |
CV.RECT_MASK 80, 60, 10, 12, 20, 15 AS maskCV.THRESHOLD src, CV.THRESHOLD AS dst
Applies a fixed threshold frame-by-frame.
CV.THRESHOLD src, CV.THRESHOLD AS dstCV.WATERSHED src, markers AS labels[, colored]
Runs marker-based watershed. markers must have the same size as src and contain positive labels for seed regions; zero means unknown. labels is CV_32S; colored is an optional visualization.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
colored | Optional parameter. If omitted, the command uses its internal default. |
CV.WATERSHED img, markers AS labels, colored
GUI.SHOW colored, "watershed"CV.WATERSHED_AUTO src [, blurRadius [, distThreshold [, invert]]] AS labels[, colored]
Automatically builds watershed markers using Otsu thresholding, morphology, distance transform and connected components. distThreshold is typically 0.30..0.60; invert=TRUE is useful for dark objects on bright background.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
blurRadius | Optional parameter. If omitted, the command uses its internal default. |
distThreshold | Optional parameter. If omitted, the command uses its internal default. |
invert | Optional parameter. If omitted, the command uses its internal default. |
colored | Optional parameter. If omitted, the command uses its internal default. |
CV.WATERSHED_AUTO img, 1, 0.40 AS labels, colored
GUI.SHOW colored, "auto watershed"CV.BLACKHAT src [, radius [, shape [, iterations]]] AS dst
Computes the black-hat transform frame-by-frame with selectable kernel shape.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
radius | Kernel radius or neighborhood radius used by the filter. |
shape | Optional parameter. If omitted, the command uses its internal default. |
iterations | Number of repeated passes applied by the operation. |
CV.BLACKHAT gray, 4, RECT, 1 AS blackhatMapCV.DILATE src [, radius [, shape [, iterations]]] AS dst
Applies morphological dilation frame-by-frame. shape can be ELLIPSE, RECT, or CROSS. The old numeric third parameter is still accepted as iterations.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
radius | Kernel radius or neighborhood radius used by the filter. |
shape | Optional parameter. If omitted, the command uses its internal default. |
iterations | Number of repeated passes applied by the operation. |
CV.DILATE mask, 2, CROSS, 1 AS dilatedCV.DISTANCE src [, distanceType [, maskSize]] AS dst
Computes the distance transform of a binary mask derived from non-zero pixels.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
distanceType | Distance-transform metric selector. |
maskSize | Distance-transform mask size. |
CV.DISTANCE src [, distanceType [, maskSize]] AS dstCV.DISTANCE_TRANSFORM mask [, distanceType [, maskSize [, normalize]]] AS dst
Computes a distance transform from a binary/non-zero mask. distanceType can be L1, L2 or C; maskSize can be 0, 3 or 5. normalize=TRUE scales the map to 0..255 as 32F.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
distanceType | Distance-transform metric selector. |
maskSize | Distance-transform mask size. |
normalize | Optional parameter. If omitted, the command uses its internal default. |
CV.DISTANCE_TRANSFORM mask, L2, 5, TRUE AS distMapCV.ERODE src [, radius [, shape [, iterations]]] AS dst
Applies morphological erosion frame-by-frame. shape can be ELLIPSE, RECT, or CROSS. The old numeric third parameter is still accepted as iterations.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
radius | Kernel radius or neighborhood radius used by the filter. |
shape | Optional parameter. If omitted, the command uses its internal default. |
iterations | Number of repeated passes applied by the operation. |
CV.ERODE mask, 2, RECT, 1 AS erodedCV.MORPH_CLOSE src [, radius [, shape [, iterations]]] AS dst
Applies morphological closing frame-by-frame with selectable kernel shape.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
radius | Kernel radius or neighborhood radius used by the filter. |
shape | Optional parameter. If omitted, the command uses its internal default. |
iterations | Number of repeated passes applied by the operation. |
CV.MORPH_CLOSE mask, 3, RECT, 1 AS closedCV.MORPH_EX src, operation, kernelType, width, height [, iterations] AS dst
Applies a selectable morphological operation. operation: OPEN, CLOSE, GRADIENT, TOPHAT, BLACKHAT, ERODE, DILATE. kernelType: ELLIPSE, RECT, CROSS.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
iterations | Number of repeated passes applied by the operation. |
CV.MORPH_EX mask, CLOSE, RECT, 15, 5, 1 AS closedHorizontalCV.MORPH_GRADIENT src [, radius [, shape [, iterations]]] AS dst
Computes a morphological gradient frame-by-frame with selectable kernel shape.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
radius | Kernel radius or neighborhood radius used by the filter. |
shape | Optional parameter. If omitted, the command uses its internal default. |
iterations | Number of repeated passes applied by the operation. |
CV.MORPH_GRADIENT mask, 2, CROSS, 1 AS gradCV.MORPH_OPEN src [, radius [, shape [, iterations]]] AS dst
Applies morphological opening frame-by-frame with selectable kernel shape.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
radius | Kernel radius or neighborhood radius used by the filter. |
shape | Optional parameter. If omitted, the command uses its internal default. |
iterations | Number of repeated passes applied by the operation. |
CV.MORPH_OPEN mask, 2, ELLIPSE, 1 AS openedCV.TOPHAT src [, radius [, shape [, iterations]]] AS dst
Computes the top-hat transform frame-by-frame with selectable kernel shape.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
radius | Kernel radius or neighborhood radius used by the filter. |
shape | Optional parameter. If omitted, the command uses its internal default. |
iterations | Number of repeated passes applied by the operation. |
CV.TOPHAT gray, 4, ELLIPSE, 1 AS tophatMapCV.ABSDIFF left, right AS dst
Computes the absolute difference between two images or stacks.
CV.ABSDIFF left, right AS dstCV.ADD left, right AS dst
Adds two images or stacks. A single image can be broadcast across a stack.
CV.ADD left, right AS dstCV.ADDS src, scalar AS dst
Adds a scalar value to every pixel.
CV.ADDS src, scalar AS dstCV.BITAND left, right AS dst
Computes the bitwise AND of two images or stacks. A single-channel mask can be broadcast to match a multi-channel image when size and depth already match.
CV.BITAND left, right AS dstCV.BITNOT src AS dst
Computes the bitwise NOT of the source image or stack.
CV.BITNOT src AS dstCV.BITOR left, right AS dst
Computes the bitwise OR of two images or stacks. A single-channel operand can be broadcast to match a multi-channel image when size and depth already match.
CV.BITOR left, right AS dstCV.BITXOR left, right AS dst
Computes the bitwise XOR of two images or stacks. A single-channel operand can be broadcast to match a multi-channel image when size and depth already match.
CV.BITXOR left, right AS dstCV.DIV left, right AS dst
Performs pixel-wise division between two images or stacks.
CV.DIV left, right AS dstCV.DIVS src, scalar AS dst
Divides every pixel/channel of an image or stack by a non-zero scalar. This is clearer than CV.MULS src, 1/scalar.
CV.DIVS img, 2.0 AS halfCV.MAXIMUM left, right AS dst
Computes the per-pixel maximum of two images or stacks.
CV.MAXIMUM left, right AS dstCV.MINIMUM left, right AS dst
Computes the per-pixel minimum of two images or stacks.
CV.MINIMUM left, right AS dstCV.MUL left, right AS dst
Performs pixel-wise multiplication between two images or stacks.
CV.MUL left, right AS dstCV.MULS src, scalar AS dst
Multiplies every pixel by a scalar value.
CV.MULS src, scalar AS dstCV.NORMALIZE src [, newMin [, newMax]] AS dst
Normalizes the source range into a target range using OpenCV NORM_MINMAX.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
newMin | Output minimum used by normalization. |
newMax | Output maximum used by normalization. |
CV.NORMALIZE src [, newMin [, newMax]] AS dstCV.SUB name([param1 [, param2 ...]])
Starts a named subroutine block. The block is skipped during normal flow and executed only by CALL.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
param1 | First algorithm-specific tuning parameter. |
param2 | Second algorithm-specific tuning parameter. |
CV.SUBCV.SUBS src, scalar AS dst
Subtracts a scalar from every pixel/channel of an image or stack. This is clearer than CV.ADDS src, -scalar.
CV.SUBS img, 25 AS darkerCV.CROP src, x, y, w, h AS dst
Crops a ROI from the image or from all frames in the stack.
CV.CROP src, x, y, w, h AS dstCV.CROP_RECT src, rect AS dst
Crops a half-open RECT geometry from an image or from every frame in a stack. rect can be returned by RECT.CREATE, RECT.FROM_TEXT, RECT.CLIP, RECT.INTERSECT or ROI.RECT.
r = RECT.CREATE(10, 20, 30, 40)
CV.CROP_RECT img, r AS patchCV.FLIP src, mode AS dst
Flips an image or every stack frame. Modes: H/X horizontal, V/Y vertical, BOTH/XY both axes, or numeric OpenCV flipCode -1/0/1.
CV.FLIP img, "H" AS flippedCV.PAD src, top, bottom, left, right [, value] AS dst
Adds a constant border around an image or every stack frame.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
value | Scalar value written, drawn, or used as foreground/background according to the command. |
CV.PAD img, 10, 10, 20, 20, 0 AS paddedCV.PASTE base, patch, x, y AS dst
Pastes a patch image or patch stack into a base image/stack at x,y. Partial out-of-bounds pastes are clipped; single images broadcast across stacks.
CV.PASTE base, patch, 10, 20 AS outCV.PASTE_RECT base, patch, rect AS dst
Pastes a patch into a destination RECT. The patch is resized to RECT.W/H when needed, then clipped to the base image bounds. Works frame-by-frame on compatible stacks.
r = RECT.CREATE(10, 20, 30, 40)
CV.PASTE_RECT base, patch, r AS outCV.REMAP src, flow AS dst OR CV.REMAP src, flowX, flowY AS dst
Warps an image or stack using optical-flow displacement maps. It accepts either a 2-channel FLOW map or separate flowX/flowY maps. When used with a stack and a sequential FARNEBACK flow stack that has one fewer frame, the first frame is copied unchanged and the remaining frames are remapped with the corresponding flow maps.
CV.REMAP src, flow AS dst OR CV.REMAP src, flowX, flowY AS dstCV.RESIZE src, w, h AS dst
Resizes the image or all frames in the stack.
CV.RESIZE src, w, h AS dstCV.ROTATE src, angle [, scale [, borderValue]] AS dst
Rotates around the image center using affine interpolation and a constant border value.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
scale | Multiplicative scale factor; for geometric transforms it may mean image scale around the center. |
borderValue | Constant value used to fill pixels outside the source image after a transform. |
CV.ROTATE img, 12.5, 1.0, 0 AS rotCV.ROTATE90 src, code AS dst
Rotates by exact right angles without interpolation. Codes: 90/CW, 180, 270/CCW.
CV.ROTATE90 img, 90 AS rotCV.TRANSLATE src, dx, dy [, borderValue] AS dst
Translates image content by dx,dy pixels using a constant border value.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
borderValue | Constant value used to fill pixels outside the source image after a transform. |
CV.TRANSLATE img, 4, -2 AS shiftedCV.WARP_AFFINE src, a00, a01, a02, a10, a11, a12 [, w [, h [, borderValue]]] AS dst
Applies a 2x3 affine transform matrix with optional output size and constant border value.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
w | Optional output width, or ROI width when part of x,y,w,h. |
h | Optional output height, or ROI height when part of x,y,w,h. |
borderValue | Constant value used to fill pixels outside the source image after a transform. |
CV.WARP_AFFINE img, 1, 0, 8, 0, 1, 4 AS shiftedCV.WARP_HOMOGRAPHY src, H [, w [, h [, borderValue]]] AS dst
Applies a 3x3 homography stored in a ScriptArray. This is the array-based companion of CV.WARP_PERSPECTIVE and works frame-by-frame on stacks.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
w | Optional output width, or ROI width when part of x,y,w,h. |
h | Optional output height, or ROI height when part of x,y,w,h. |
borderValue | Constant value used to fill pixels outside the source image after a transform. |
CV.FIND_HOMOGRAPHY kpA, kpB, matches, 3.0 AS H, inliers
CV.WARP_HOMOGRAPHY imgB, H AS alignedCV.WARP_PERSPECTIVE src, a00, a01, a02, a10, a11, a12, a20, a21, a22 [, w [, h [, borderValue]]] AS dst
Applies a 3x3 homography/perspective transform matrix with optional output size and constant border value. On stacks it operates frame-by-frame.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
w | Optional output width, or ROI width when part of x,y,w,h. |
h | Optional output height, or ROI height when part of x,y,w,h. |
borderValue | Constant value used to fill pixels outside the source image after a transform. |
CV.WARP_PERSPECTIVE img, 1, 0.15, -18, 0.05, 1, -8, 0.0006, 0.0009, 1, 320, 240, 0 AS warpedCV.ADJUST_COLOR src, brightness, contrastPercent, hueShift, saturationPercent AS dst
Applies brightness/contrast in BGR and hue/saturation in HSV; useful with GUI trackbars in live webcam demos.
CV.ADJUST_COLOR frame, brightness, contrast, hue, saturation AS tunedCV.BG_SUBTRACT stack, method [, history [, varThreshold]] AS dst
Applies MOG2 or KNN background subtraction to a video/stack and returns an 8-bit foreground-mask stack. method can be "MOG2" or "KNN".
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
history | Optional parameter. If omitted, the command uses its internal default. |
varThreshold | Optional parameter. If omitted, the command uses its internal default. |
IO.LOAD "input.avi" AS st
CV.BG_SUBTRACT st, "MOG2", 80, 16 AS fgCV.CAMSHIFT src, roi [, hBins [, sBins [, maxIter [, epsilon]]]] AS rects[, preview]
Tracks the ROI color model with HSV backprojection and OpenCV CamShift, returning both the bounding rect and rotated box geometry in the N x 11 rects table. The optional preview draws rect and rotated box.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
hBins | Optional parameter. If omitted, the command uses its internal default. |
sBins | Optional parameter. If omitted, the command uses its internal default. |
maxIter | Optional parameter. If omitted, the command uses its internal default. |
epsilon | Optional parameter. If omitted, the command uses its internal default. |
preview | Optional parameter. If omitted, the command uses its internal default. |
CV.CAMSHIFT st, rect, 30, 32, 20, 1.0 AS rects, previewCV.CANNY src, low, high AS dst
Runs Canny edge detection frame-by-frame.
CV.CANNY src, low, high AS dstCV.CONNECTED_COMPONENTS src [, connectivity] AS dst
Labels foreground connected components in a binary mask derived from non-zero pixels.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
connectivity | Connected-component connectivity, normally 4 or 8. |
CV.CONNECTED_COMPONENTS src [, connectivity] AS dstCV.CONTOURS mask [, mode [, approx]] AS points, info
Extracts contours as numeric arrays. points columns: contourId, pointIndex, x, y. info columns: contourId, area, perimeter, x, y, w, h, pointCount. Modes: EXTERNAL, ALL/LIST, TREE, CCOMP. Approximation: SIMPLE or NONE.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
mode | Mode selector; accepted values are described in the command text. |
approx | Optional parameter. If omitted, the command uses its internal default. |
CV.CONTOURS mask, EXTERNAL, SIMPLE AS contourPts, contourInfo
PRINT ARRAY.DIMSIZE(contourInfo, 0)CV.CORNER_SUBPIX src, points [, winSize [, maxIter [, epsilon]]] AS refinedPoints
Refines an Nx2 or Nx>=2 point array with OpenCV cornerSubPix and returns a refined Nx2 array.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
winSize | Optical-flow averaging window size; larger values are smoother and less local. |
maxIter | Optional parameter. If omitted, the command uses its internal default. |
epsilon | Optional parameter. If omitted, the command uses its internal default. |
CV.GOOD_FEATURES_POINTS img, 80, 0.01, 10 AS pts
CV.CORNER_SUBPIX img, pts, 5, 40, 0.001 AS refinedCV.DETECT_OBJECTS src, cascadeFile [, scaleFactor [, minNeighbors [, minSizeW [, minSizeH]]]] AS rects[, preview]
Runs an OpenCV Haar/LBP cascade over an image or stack. rects columns: frameIndex, detectionIndex, x, y, w, h, score, classId. A sentinel row frameIndex=-1 means no detections. The optional preview draws rectangles.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
scaleFactor | Optional parameter. If omitted, the command uses its internal default. |
minNeighbors | Optional parameter. If omitted, the command uses its internal default. |
minSizeW | Optional parameter. If omitted, the command uses its internal default. |
minSizeH | Optional parameter. If omitted, the command uses its internal default. |
preview | Optional parameter. If omitted, the command uses its internal default. |
CV.DETECT_OBJECTS img, "haarcascade_frontalface_default.xml", 1.1, 4 AS faces, previewCV.DRAW_FLOW_ARROWS src, flow [, step [, scale [, minMag [, b [, g [, r [, thickness]]]]]]] AS dst
Draws optical-flow vectors as arrows over an image. The flow input must be generated by CV.FARNEBACK mode FLOW. Color uses OpenCV B,G,R order.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
step | Optional parameter. If omitted, the command uses its internal default. |
scale | Multiplicative scale factor; for geometric transforms it may mean image scale around the center. |
minMag | Optional parameter. If omitted, the command uses its internal default. |
b | Optional parameter. If omitted, the command uses its internal default. |
g | Optional parameter. If omitted, the command uses its internal default. |
r | Optional parameter. If omitted, the command uses its internal default. |
thickness | Optional parameter. If omitted, the command uses its internal default. |
CV.DRAW_FLOW_ARROWS frame, flow, 24, 4.0, 0.6, 0, 255, 255, 1 AS arrowsCV.DRAW_MATCHES img1, kp1, img2, kp2, desc1, desc2 [, maxDistance] AS dst
Matches ORB descriptors with a Hamming BFMatcher and draws the selected matches between two images. Kept for compatibility; use CV.MATCH_ORB + CV.DRAW_MATCHES_DATA when the match list must be reused.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
maxDistance | Optional parameter. If omitted, the command uses its internal default. |
CV.DRAW_MATCHES imgA, kpA, imgB, kpB, descA, descB, 64 AS matchesPreviewCV.DRAW_MATCHES_DATA img1, kp1, img2, kp2, matches [, maxDraw] AS dst
Draws matches from a numeric matches/inliers array, useful after CV.FIND_HOMOGRAPHY RANSAC filtering.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
maxDraw | Optional parameter. If omitted, the command uses its internal default. |
CV.DRAW_MATCHES_DATA imgA, kpA, imgB, kpB, inliers, 100 AS inlierPreviewCV.EDGES src AS dst
Computes an edge map frame-by-frame.
CV.EDGES src AS dstCV.FARNEBACK stack [, mode [, pyrScale [, levels [, winsize [, iterations [, polyN [, polySigma]]]]]]] AS dst OR CV.FARNEBACK prev, next [, mode [, pyrScale [, levels [, winsize [, iterations [, polyN [, polySigma]]]]]]] AS dst (robust defaults: pyrScale=0.5, levels=5, winsize=25, iterations=5, polyN=7, polySigma=1.5)
Computes dense Farneback optical flow either between consecutive frames of a stack or between two images/two stacks, returning raw flow, magnitude, angle, or a color visualization. Uses robust defaults and the Gaussian Farneback window for more stable video results.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
mode | Mode selector; accepted values are described in the command text. |
pyrScale | Farneback pyramid scale between image levels. |
levels | Number of pyramid levels used by the optical-flow algorithm. |
winsize | Optical-flow averaging window size; larger values are smoother and less local. |
iterations | Number of repeated passes applied by the operation. |
polyN | Farneback polynomial neighborhood size. |
polySigma | Farneback Gaussian smoothing sigma for polynomial expansion. |
CV.FARNEBACK stack [, mode [, pyrScale [, levels [, winsize [, iterations [, polyN [, polySigma]]]]]]] AS dst OR CV.FARNEBACK prev, next [, mode [, pyrScale [, levels [, winsize [, iterations [, polyN [, polySigma]]]]]]] AS dst (robust defaults: pyrScale=0.5, levels=5, winsize=25, iterations=5, polyN=7, polySigma=1.5)CV.FIND_HOMOGRAPHY kp1, kp2, matches [, ransacThreshold] AS H, inliers
Estimates a 3x3 homography with RANSAC. H maps image-2/keypoints-2 coordinates onto image-1/keypoints-1 coordinates. inliers columns are queryIdx, trainIdx, distance, sourceMatchIndex.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
ransacThreshold | Optional parameter. If omitted, the command uses its internal default. |
CV.FIND_HOMOGRAPHY kpA, kpB, matches, 3.0 AS H, inliersCV.FLOW_COLOR flow [, border] AS dst
Converts a 2-channel CV.FARNEBACK FLOW map to a BGR color visualization: hue is direction and brightness is motion magnitude.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
border | Optional parameter. If omitted, the command uses its internal default. |
CV.FARNEBACK prevGray, gray, "FLOW" AS flow
CV.FLOW_COLOR flow AS flowColorCV.GOOD_FEATURES src [, maxCorners [, quality [, minDistance [, value]]]] AS dst
Draws Shi-Tomasi goodFeaturesToTrack points over an 8-bit BGR diagnostic image.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
maxCorners | Maximum number of features/corners to keep. |
quality | Relative quality threshold used by feature selection. |
minDistance | Minimum distance between accepted features. |
value | Scalar value written, drawn, or used as foreground/background according to the command. |
CV.GOOD_FEATURES img, 100, 0.01, 8 AS ptsCV.GOOD_FEATURES_POINTS src [, maxCorners [, quality [, minDistance]]] AS points
Returns Shi-Tomasi corner coordinates as an Nx2 numeric array: x,y. This is the data-producing companion of CV.GOOD_FEATURES.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
maxCorners | Maximum number of features/corners to keep. |
quality | Relative quality threshold used by feature selection. |
minDistance | Minimum distance between accepted features. |
CV.GOOD_FEATURES_POINTS img, 100, 0.01, 10 AS ptsCV.HARRIS src [, blockSize [, ksize [, k]]] AS dst
Computes a normalized Harris corner response map.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
blockSize | Local analysis window size used by the algorithm. |
ksize | Derivative/kernel aperture size. |
k | Algorithm coefficient, for example the Harris detector free parameter. |
CV.HARRIS img, 2, 3, 0.04 AS cornersCV.HIST_BACKPROJECT src, roi [, hBins [, sBins]] AS dst
Builds an HSV hue/saturation histogram from the ROI on the first frame, then returns a probability/backprojection map for the image or every frame of the stack.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
hBins | Optional parameter. If omitted, the command uses its internal default. |
sBins | Optional parameter. If omitted, the command uses its internal default. |
rect = RECT.CREATE(70, 60, 80, 80)
CV.HIST_BACKPROJECT img, rect, 30, 32 AS prob
GUI.SHOW prob, "backprojection"CV.HOG_DETECT_PEOPLE src [, hitThreshold [, scale [, finalThreshold]]] AS rects[, preview]
Runs OpenCV HOG people detection over an image or stack. rects columns: frameIndex, detectionIndex, x, y, w, h, score, classId. A sentinel row frameIndex=-1 means no detections. The optional preview draws rectangles.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
hitThreshold | Optional parameter. If omitted, the command uses its internal default. |
scale | Multiplicative scale factor; for geometric transforms it may mean image scale around the center. |
finalThreshold | Optional parameter. If omitted, the command uses its internal default. |
preview | Optional parameter. If omitted, the command uses its internal default. |
CV.HOG_DETECT_PEOPLE frame, 0.0, 1.05, 2.0 AS people, previewCV.HOUGH_CIRCLES src [, dp [, minDist [, param1 [, param2 [, minRadius [, maxRadius [, value]]]]]]] AS dst
Detects circular structures with HoughCircles and draws the result over a diagnostic image.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
dp | Inverse accumulator resolution ratio used by HoughCircles. |
minDist | Minimum distance between detected circle centers. |
param1 | First algorithm-specific tuning parameter. |
param2 | Second algorithm-specific tuning parameter. |
minRadius | Minimum circle radius to detect. |
maxRadius | Maximum circle radius to detect; zero may let OpenCV choose automatically. |
value | Scalar value written, drawn, or used as foreground/background according to the command. |
CV.HOUGH_CIRCLES img, 1.2, 20, 100, 30, 5, 80 AS circlesCV.HOUGH_LINES src [, rho [, thetaDeg [, threshold [, value]]]] AS dst
Detects Hough lines from a Canny edge map and draws them over a diagnostic image.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
rho | Hough-line distance resolution in pixels. |
thetaDeg | Hough-line angular resolution in degrees. |
threshold | Detection or segmentation threshold used by the command. |
value | Scalar value written, drawn, or used as foreground/background according to the command. |
CV.HOUGH_LINES img, 1, 1, 50 AS linesCV.KMEANS src, k AS quantized
Quantizes an image or each frame of a stack with k-means clustering in channel space.
CV.KMEANS img, 4 AS quantizedCV.KMEANS_CENTERS src, k AS centersArray
Returns the k-means centers of the first frame as a numeric K x channels array. Channel order follows OpenCV, so color images are B,G,R.
CV.KMEANS_CENTERS img, 4 AS centersCV.LABELS_COLOR labels AS dst
Converts a label image, or a binary mask converted to connected components, into a deterministic color visualization.
CV.CONNECTED_COMPONENTS mask AS labels
CV.LABELS_COLOR labels AS colorLabelsCV.LAPLACIAN src AS dst
Computes the Laplacian frame-by-frame.
CV.LAPLACIAN src AS dstCV.MATCH_ORB desc1, desc2 [, maxDistance [, maxMatches]] AS matches
Matches two ORB descriptor matrices with Hamming distance and cross-check. Output columns are queryIdx, trainIdx, distance, matchRank.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
maxDistance | Optional parameter. If omitted, the command uses its internal default. |
maxMatches | Optional parameter. If omitted, the command uses its internal default. |
CV.MATCH_ORB descA, descB, 64, 200 AS matchesCV.MATCH_TEMPLATE src, templ [, method] AS dst
Computes an OpenCV template-matching response map. Source/template pairs may be broadcast across stacks.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
method | OpenCV method selector accepted by the command. |
CV.MATCH_TEMPLATE src, templ [, method] AS dstCV.MEANSHIFT src, roi [, hBins [, sBins [, maxIter [, epsilon]]]] AS rects[, preview]
Tracks the ROI color model with HSV backprojection and OpenCV meanShift. rects is an N x 11 table: frame,x,y,w,h,cx,cy,boxW,boxH,angle,score/iterations. The optional preview draws the tracked window.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
hBins | Optional parameter. If omitted, the command uses its internal default. |
sBins | Optional parameter. If omitted, the command uses its internal default. |
maxIter | Optional parameter. If omitted, the command uses its internal default. |
epsilon | Optional parameter. If omitted, the command uses its internal default. |
preview | Optional parameter. If omitted, the command uses its internal default. |
CV.MEANSHIFT st, rect, 30, 32, 20, 1.0 AS rects, previewCV.ORB_DETECT src, nfeatures AS keypoints, descriptors
Detects ORB keypoints on the first frame. keypoints is an Nx7 array: x,y,size,angle,response,octave,class_id; descriptors is a CV_8U matrix.
CV.ORB_DETECT img, 800 AS kp, descCV.QR_DETECT src AS text
Detects and decodes the first QR code payload found in an image or stack. Returns an empty string if no QR code is decoded.
CV.QR_DETECT img AS qrText
IF qrText <> "" THEN
PRINT "QR=" + qrText
ENDIFCV.SCHARR src [, dx [, dy]] AS dst
Computes Scharr gradients. Without dx/dy it returns a combined gradient image.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
dx | Derivative order or X displacement, depending on the command. |
dy | Derivative order or Y displacement, depending on the command. |
CV.SCHARR img AS gradCV.SOBEL src AS dst
Computes the Sobel gradient frame-by-frame.
CV.SOBEL src AS dstCV.DRAW_BBOX src, mask [, value [, thickness]] AS dst
Draws the bounding box of the largest mask contour over the source image or stack.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
value | Scalar value written, drawn, or used as foreground/background according to the command. |
thickness | Optional parameter. If omitted, the command uses its internal default. |
CV.DRAW_BBOX img, mask, 255, 2 AS boxedCV.DRAW_CONTOURS src, mask [, value [, thickness]] AS dst
Draws external contours extracted from a binary mask over the source image or stack.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
value | Scalar value written, drawn, or used as foreground/background according to the command. |
thickness | Optional parameter. If omitted, the command uses its internal default. |
CV.DRAW_CONTOURS img, mask, 255, 1 AS overlayDRAW.CIRCLE src, cx, cy, radius [, value [, thickness]] AS dst
Draws or fills a circle over an image or stack.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
value | Scalar value written, drawn, or used as foreground/background according to the command. |
thickness | Optional parameter. If omitted, the command uses its internal default. |
DRAW.CIRCLE src, cx, cy, radius [, value [, thickness]] AS dstDRAW.LINE src, x1, y1, x2, y2 [, value [, thickness]] AS dst
Draws a line over an image or over every frame of a stack and returns the modified media.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
value | Scalar value written, drawn, or used as foreground/background according to the command. |
thickness | Optional parameter. If omitted, the command uses its internal default. |
DRAW.LINE src, x1, y1, x2, y2 [, value [, thickness]] AS dstDRAW.RECT src, x, y, w, h [, value [, thickness]] AS dst
Draws or fills a rectangle over an image or stack.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
value | Scalar value written, drawn, or used as foreground/background according to the command. |
thickness | Optional parameter. If omitted, the command uses its internal default. |
DRAW.RECT src, x, y, w, h [, value [, thickness]] AS dstDRAW.TEXT src, x, y, text [, value [, scale [, thickness]]] AS dst
Draws text using an OpenCV Hershey font over an image or stack.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
value | Scalar value written, drawn, or used as foreground/background according to the command. |
scale | Multiplicative scale factor; for geometric transforms it may mean image scale around the center. |
thickness | Optional parameter. If omitted, the command uses its internal default. |
DRAW.TEXT src, x, y, text [, value [, scale [, thickness]]] AS dstCV.SET_PIXEL src, x, y, value [, channel [, frame]] AS dst
Returns a copy where one pixel sample has been written. channel=-1 writes all channels; frame=-1 writes all frames.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
channel | Zero-based channel index; some commands accept -1 for grayscale/all channels. |
frame | Zero-based frame index; some stack commands accept -1 for all frames. |
CV.SET_PIXEL img, 10, 10, 255 AS marked
CV.SET_PIXEL img, 10, 10, 128, 1 AS greenOnlyCV.SET_PIXEL3 src, x, y, v0, v1, v2 [, frame] AS dst
Returns a copy where channels 0..2 of one pixel have been written. OpenCV color order is B,G,R.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
frame | Zero-based frame index; some stack commands accept -1 for all frames. |
CV.SET_PIXEL3 colorImg, 20, 20, 0, 0, 255 AS redPixelCV.SET_PIXEL4 src, x, y, v0, v1, v2, v3 [, frame] AS dst
Returns a copy where channels 0..3 of one pixel have been written. OpenCV color order is B,G,R,A.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
frame | Zero-based frame index; some stack commands accept -1 for all frames. |
CV.SET_PIXEL4 rgbaImg, 20, 20, 0, 0, 255, 255 AS redPixelPLOT.BAR valuesText, width, height AS dst
Creates a bar-chart image from newline-separated numeric values.
PLOT.BAR valuesText, width, height AS dstPLOT.XY pointsText, width, height AS dst
Creates a chart image from newline-separated X,Y numeric pairs.
PLOT.XY pointsText, width, height AS dstPLOT.Y valuesText, width, height AS dst
Creates a chart image from newline-separated numeric Y values.
PLOT.Y valuesText, width, height AS dstCV.PALETTE src, paletteFile AS dst OR CV.PALETTE var, paletteFile
Applies a .map RGB palette to a grayscale image/stack and returns a BGR color visualization. If paletteFile is not an absolute path, ./sys/palette is searched; the .map extension is optional.
img = CV.DESKTOP_IMAGE()
CV.PALETTE img, "thermal.map" AS colorImg
GUI.SHOW colorImgCV.SHOW imageOrStack [, title]
Compatibility alias of SHOW.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
title | Optional GUI/DataPlot window title. |
CV.SHOWDEMO.HELLO [name]
Library: DemoStats user library 2.0.0 Prints a greeting from the DLL.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
name | Optional parameter. If omitted, the command uses its internal default. |
DEMO.HELLODEMO.TYPES
Library: DemoStats user library 2.0.0 Prints the SDK data types supported by this demo library.
DEMO.TYPESSERIAL.HELLO [name]
Library: Serial user library 1.0.0 Prints a greeting from the DLL.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
name | Optional parameter. If omitted, the command uses its internal default. |
SERIAL.HELLO