Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV 2.4:

src.copyTo(dst(Rect(left, top, src.cols, src.rows));

OpenCV 2.4:

src.copyTo(dst(Rect(left, top, src.cols, src.rows));

or

cv::Mat img = ...;
cv::Mat subImg = img(cv::Range(0, 0), cv::Range(100, 100));

OpenCV 2.4:

src.copyTo(dst(Rect(left, src(Rect(left, top, src.cols, src.rows));
src.rows)).copyTo(dst);

or

cv::Mat img = ...;
cv::Mat subImg = img(cv::Range(0, 0), cv::Range(100, 100));
100)).clone();