Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equivalent to cvSetImageROI in the OpenCV C++ interface

Tags:

I'm migrating an old test application from the OpenCV C interface to the new C++ interface (I wish to learn it). What's the equivalent, using the C++ interface, of cvSetImageROI and cvResetImageROI? I couldn't find it in the documentation.

like image 373
Vitor Py Avatar asked Aug 12 '11 14:08

Vitor Py


1 Answers

Actually, it's right on the docs. Shame on me.

//Make a rectangle
Rect roi(10, 20, 100, 50);
//Point a cv::Mat header at it (no allocation is done)
Mat image_roi = image(roi)
like image 107
Vitor Py Avatar answered Sep 19 '22 23:09

Vitor Py