copy a cv::Mat image (source) to a ROI of another (Destination) cv::Mat image

OpenCV 2.4:


src.copyTo(dst(Rect(left, top, src.cols, src.rows));
OpenCV 2.x:


Mat dst_roi = dst(Rect(left, top, src.cols, src.rows);

src.copyTo(dst_roi);

e.g.

bboxImage.copyTo(destImage.colRange(startCol,startCol+bboxImage.cols).rowRange(s‌​tartRow,startRow+bboxImage.rows)); 

你可能感兴趣的:(image,DST)