Interface configuring data from webcam video stream.

interface WebcamConfig {
    centerCrop?: boolean;
    deviceId?: string;
    facingMode?: "user" | "environment";
    resizeHeight?: number;
    resizeWidth?: number;
}

Properties

centerCrop?: boolean

A boolean value that indicates whether to crop the video frame from center. If true, resizeWidth and resizeHeight must be specified; then an image of size [resizeWidth, resizeHeight] is taken from the center of the frame without scaling. If false, the entire image is returned (perhaps scaled to fit in [resizeWidth, resizeHeight], if those are provided).

deviceId?: string

A string used to request a specific camera. The deviceId can be obtained by calling mediaDevices.enumerateDevices().

facingMode?: "user" | "environment"

A string specifying which camera to use on device. If the value is 'user', it will use front camera. If the value is 'environment', it will use rear camera.

resizeHeight?: number

Specifies the height of the output tensor. The actual height of the HTMLVideoElement (if provided) can be different and the final image will be resized to match resizeHeight.

resizeWidth?: number

Specifies the width of the output tensor. The actual width of the HTMLVideoElement (if provided) can be different and the final image will be resized to match resizeWidth.

Generated using TypeDoc