imdecode
import { imdecode } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Reads an image from a buffer in memory.
The function imdecode reads an image from the specified buffer in the memory. If the buffer is too short or contains invalid data, the function returns an empty matrix ( Mat::data==NULL ).
See cv::imread for the list of supported formats and flags description.
Note: In the case of color images, the decoded images will have the channels stored in B G R order.
imdecode(buf: Mat, flags: number): Mat;bufInput array or vector of bytes.
flagsFlag that can take values of cv::ImreadModes.
The Mat result. 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.