Ask Your Question

Revision history [back]

It is very simple. Just think about your Rect element as a pointer to memory.

// Simply pointer initializing
Rect ROI;

// Pointer initializing and allocating memory
// Rect ROI (rows, cols, type);
Rect ROI (250, 250, CV_8UC1);

It is very simple. Just think about your Rect element as a pointer to memory.

// Simply pointer initializing
Rect ROI;

// Pointer initializing and allocating memory
// Rect ROI (rows, cols, type);
(x, y, width, height);
Rect ROI (250, (0, 0, 250, CV_8UC1);
250);

It is very simple. Just think about your Rect element as a pointer to memory.

// Simply pointer initializing
Rect ROI;

// Pointer initializing and allocating memory
// Rect ROI (x, y, width, height);
Rect ROI (0, 0, 250, 250);

More information about every possible constructor of the Rect element can be found here.