Main Content

ocvCvRectToMxArray

Convert OpenCV CvRect to a MATLAB struct

C++ Syntax

#include "opencvmex.hpp"
mxArray *ocvCvRectToMxArray(const CvRect *in);

Arguments

in

Pointer to OpenCV CvRect.

Returns

Pointer to a MATLAB® structure, mxArray, that represents a rectangle. The structure must have four scalar-valued fields, x, y, width, and height. The (x, y) fields represent the upper-left corner of the rectangle.

Description

The ocvCvRectToMxArray function converts a rectangle data structure from an OpenCV KeyPoint vector to a MATLAB struct.

Version History

Introduced in R2015a