[英]Converting old Opencv code to the new C++ API, replacement for cvGetSubRect?
我正在使用C api將一些舊的OpenCV代碼轉換為OpenCV 2.3中的新C ++ API。 我想知道替換cvGetSubRect
調用的方法是什么?
我有以下, cvGetSubRect(some_cv_mat_pointer, another_cv_mat_pointer, some_cv_rect);
C ++ api中的等價物是什么?
您在源圖像上創建一個roi,它會為您提供一個新圖像 - 沒有實際像素復制它會自動發生
Mat image(.....) // original image
Rect roi(10, 20, 100, 50); // shape of roi
Mat image_roi = image(roi); /// really a window into image, copy it if you need to change it
http://opencv.willowgarage.com/documentation/cpp/c++_cheatsheet.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.