ocvMxArrayToSize_{DataType}

Convert 2-element mxArray to cv::Size.

C++ Syntax

#include "opencvmex.hpp"
cv::Size ocvMxArrayToSize_single(const mxArray * in, bool rcInput = true);
cv::Size ocvMxArrayToSize_int32(const mxArray * in, bool rcInput = true);

Arguments

in

Pointer to a MATLAB® mxArray having 2 elements. Supported data types:

single
int32

rcInput

Boolean flag that indicates if input mxArray is of the format [r c] or [x y].

rcInputin
true (default) [r c] (height, width)
false[x y] (width, height)

Returns

OpenCV cv::Size

Description

The ocvMxArrayToSize_{DataType} function converts a 2-element mxArray to cv::Size. Empty input ([]) returns cv::Size(0,0);

See Also

mxArray, C Matrix API (MATLAB), C MEX File Applications (MATLAB)

Introduced in R2015a