Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

ocvMxArrayFromImage_{DataType}

Convert row major cv::Mat to column major mxArray for image

C++ Syntax

#include "opencvmex.hpp"
mxArray *ocvMxArrayFromImage_double(const cv::Mat &in);
mxArray *ocvMxArrayFromImage_single(const cv::Mat &in);
mxArray *ocvMxArrayFromImage_uint8(const cv::Mat &in);
mxArray *ocvMxArrayFromImage_uint16(const cv::Mat &in);
mxArray *ocvMxArrayFromImage_uint32(const cv::Mat &in);
mxArray *ocvMxArrayFromImage_int8(const cv::Mat &in);
mxArray *ocvMxArrayFromImage_int16(const cv::Mat &in);
mxArray *ocvMxArrayFromImage_int32(const cv::Mat &in);
mxArray *ocvMxArrayFromImage_bool(const cv::Mat &in);

Arguments

in

Reference to OpenCV cv::Mat with row major data.

Returns

Pointer to a MATLAB® struct, mxArray, with column major data. Supported data types:

real_T (double)uint8_T (uint8)uint32_T (uint32)int16_T (int16)
real32_T (single)uint16_T (uint16)int8_T (int8)int32_T (int32)

Description

The ocvMxArrayFromImage_{DataType} function creates an mxArray from a cv::Mat object. The mxArray contains column major data and the cv::Mat contains row major data.

This function is not a generic matrix conversion routine. For 3-D images, it takes into account that the OpenCV format uses BGR ordering and manipulates the data to comply with that formatting.

Introduced in R2015a