DriftCapture · function

prepareSamFrame

rgba as MobileSAM's predictor prepares it: [3, square, square], the frame itself in the top left at the size this answers, and zeros after it.

Explained in DriftCapture.

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

Parameters

ParameterTypeDescription
rgbaUint8Array
widthnumber
heightnumber
meanreadonly number[]
deviationreadonly number[]
square?number