DriftCapture · function

prepareSam2Frame

rgba as SAM 2's processor prepares it: [3, square, square], each axis scaled on its own, and normalised by mean and deviation in 0–1.

Explained in DriftCapture.

function prepareSam2Frame(rgba: Uint8Array, width: number, height: number, mean?: readonly number[], deviation?: readonly number[], square?: number): PreparedFrame
import { prepareSam2Frame } from '@driftengine/capture';

Parameters

ParameterTypeDescription
rgbaUint8Array
widthnumber
heightnumber
mean?readonly number[]
deviation?readonly number[]
square?number