Skip to content

cvtColorTwoPlane

Image processingfunctionOpenCV 5.0.0
import { cvtColorTwoPlane } from '@banou/opencv-wasm'

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

Converts an image from one color space to another where the source image is stored in two planes.

This function only supports YUV420 to RGB conversion as of now.

cvtColorTwoPlane(src1: Mat, src2: Mat, dst: Mat, code: number, hint: number): void;
2 available overloads
cvtColorTwoPlane(src1: Mat, src2: Mat, dst: Mat, code: number): void;
cvtColorTwoPlane(src1: Mat, src2: Mat, dst: Mat, code: number, hint: number): void;
src1

8-bit image (#CV_8U) of the Y plane.

src2

image containing interleaved U/V plane.

dst

Output destination, filled by the native operation. output image.

code

Specifies the type of conversion. It can take any of the following values:

  • #COLOR_YUV2BGR_NV12
  • #COLOR_YUV2RGB_NV12
  • #COLOR_YUV2BGRA_NV12
  • #COLOR_YUV2RGBA_NV12
  • #COLOR_YUV2BGR_NV21
  • #COLOR_YUV2RGB_NV21
  • #COLOR_YUV2BGRA_NV21
  • #COLOR_YUV2RGBA_NV21
hint

Implementation modification flags. See #AlgorithmHint

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.