当前位置: 首页 > 工具软件 > matImage > 使用案例 >

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

马博学
2023-12-01
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)); 

 类似资料: