繁体   English   中英

如何获取矩形内图像的内容?

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM