getContour(grayscaledTexture, textureShape, threshold, winSize, maxNearCount, outTensor): number
Looks for contour points in a grayscale texture, or any one-channel tensor.
grayscaledTexture - Float32Array of size (width * height). Grayscale texture or one-channel tensor to evaluate
textureShape - Should be {width, height, 1}
threshold - Quality value threshold for found contour points
Each contour point found must satisfy these conditions:
The point's quality value should be >= threshold
The number of points which have values < threshold and lie in the rectangle with left corner vec2(x-winSize, y-winSize) and right corner vec2(x+winSize-1, y+winSize-1) should be <= maxNearCount
outTensor - Float32Array where results are written. Found contour points are written in the format: x0, y0, x1, y1, etc.
The number of points found will not exceed outTensor's size / 2.
Looks for contour points in a grayscale texture, or any one-channel tensor.
grayscaledTexture
- Float32Array of size (width * height). Grayscale texture or one-channel tensor to evaluatetextureShape
- Should be {width, height, 1}threshold
- Quality value threshold for found contour pointsEach contour point found must satisfy these conditions:
The point's quality value should be >=
threshold
The number of points which have values <
threshold
and lie in the rectangle with left corner vec2(x-winSize
, y-winSize
) and right corner vec2(x+winSize
-1, y+winSize
-1) should be <=maxNearCount
outTensor
- Float32Array where results are written. Found contour points are written in the format: x0, y0, x1, y1, etc. The number of points found will not exceed outTensor's size / 2.