Skip to content

imreadWithMetadata

Image codecsfunctionOpenCV 5.0.0
import { imreadWithMetadata } from '@banou/opencv-wasm'

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

ARGUMENTSfilename, metadataTypes, metadata, flags
FUNCTIONimreadWithMetadata
RETURN TYPEMat
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Reads an image from a file along with associated metadata.

This function behaves similarly to cv::imread(), loading an image from the specified file. In addition to the image pixel data, it also attempts to extract any available metadata embedded in the file (such as EXIF, XMP, etc.), depending on file format support.

Note: In the case of color images, the decoded images will have the channels stored in B G R order.

imreadWithMetadata(filename: EmbindString, metadataTypes: IntVector, metadata: MatVector, flags: number): Mat;
filename

Name of the file to be loaded.

metadataTypes

Output destination, filled by the native operation. Output vector with types of metadata chunks returned in metadata, see ImageMetadataType.

metadata

Output destination, filled by the native operation. Output vector of vectors or vector of matrices to store the retrieved metadata.

flags

Flag that can take values of cv::ImreadModes.

Returns

The loaded image as a cv::Mat object. If the image cannot be read, the function returns an empty matrix. Release returned native handles with using or delete(), including handles nested in results.

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.