MatOutput
class NatML.Devices.Outputs.MatOutput : CameraOutput
The MatOutput
converts CameraImage
instances into an OpenCV Mat
.
This class is part of the NatDevice-OpenCV integration library.
Creating the Output
The matrix output is trivially constructed.
Specifying the Orientation
The texture output supports specifying the desired output orientation of the converted matrix.
This property is especially useful on mobile devices where camera images are always returned in the "natural orientation" of the camera device.
This property is only supported on Android and iOS.
Specifying the Color Format
The matrix output supports specifying a color conversion to perform when converting incoming CameraImage
instances. This is useful for implementing computer vision pipelines that operate on greyscale image data, or other non-RGBA
formats.
The format
MUST be one of the Imgproc.COLOR_RGBA2***
constants.
Updating with New Images
The output will upload the CameraImage
into a RenderTexture
. The output supports specifying options that are used when converting the image:
The provided options
can be null
, in which case reasonable defaults are used.
Conversion Options
The ConversionOptions
expose some options that can be used when performing the conversion.
Accessing the Matrix
When the output has been updated with a CameraImage
, the matrix
will contain the converted pixel data in the correct color format and orientation.
Disposing the Output
Refer to the Disposing the Output section of the CameraOutput
class for more information.
Last updated