[英]How to get the content of an Image inside a Rectangle?
我需要獲取被矩形包圍的圖像的內容。 我正在使用emguCV DetectMultiScale函數,該函數返回一個矩形數組,其中包含獲取內容所需的檢測到的圖像的位置或區域。 謝謝!
results = FindPeople.Find(frameImage, tryUseCuda, tryuseOpenCL, out processingTime, out peopleCount);
foreach (Rectangle rect in results)
{
CvInvoke.Rectangle(frameImage, rect, new Bgr(Color.Red).MCvScalar);
//Get content of the Rectangle here, frameImage = image
}
您需要使用ROI。
CvInvoke.Rectangle(frameImage, rect, new Bgr(Color.Red).MCvScalar);
frameImage.ROI = rect; // Will cut your original image down to your rect
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.