本文介紹了在另一個 ROI 內(nèi)復(fù)制一個 cv::Mat的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
我需要將 cv::Mat
圖像(源)復(fù)制到另一個(目標(biāo))cv::Mat
圖像的 ROI.
I need to copy a cv::Mat
image (source) to an ROI of another (Destination) cv::Mat
image.
我找到了這個參考,但似乎它不適用于我的情況.你有什么指示我怎么能用 OpenCV C++ 接口做到這一點?
I found this reference, but it seems that it does not work for my case. Do you have any pointers how could I do this using the OpenCV C++ interface?
推薦答案
OpenCV 2.4:
OpenCV 2.4:
src.copyTo(dst(Rect(left, top, src.cols, src.rows)));
OpenCV 2.x:
OpenCV 2.x:
Mat dst_roi = dst(Rect(left, top, src.cols, src.rows));
src.copyTo(dst_roi);
這篇關(guān)于在另一個 ROI 內(nèi)復(fù)制一個 cv::Mat的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!