Skip to content

gapi_ie_TraitAs

gapiclassOpenCV 5.0.0
import { gapi_ie_TraitAs } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSConstructor or factory
CLASSgapi_ie_TraitAs
RETURN TYPEOwned native handle
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Native object: release it with using or delete(). Factories can return null; check before calling methods.

Specifies how G-API and IE should trait input data

In OpenCV, the same cv::Mat is used to represent both image and tensor data. Sometimes those are hardly distinguishable, so this extra parameter is used to give G-API a hint.

This hint controls how G-API reinterprets the data when converting it to IE Blob format (and which layout/etc is assigned to this data).

Constructors and members

static TENSOR

G-API traits an associated cv::Mat as a raw tensor and passes dimensions as-is

TENSOR: gapi_ie_TraitAsValue<0>,

static IMAGE

G-API traits an associated cv::Mat as an image so creates an "image" blob (NCHW/NHWC, etc)

IMAGE: gapi_ie_TraitAsValue<1>

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.