Preparing search index...

    Function getContour

    • 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:

      1. The point's quality value should be >= threshold

      2. 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.

      Parameters

      • grayscaledTexture: Float32Array
      • textureShape: vec3
      • threshold: number
      • winSize: number
      • maxNearCount: number
      • outTensor: Float32Array

      Returns number