C# 如何获取矩形内图像的内容?
我需要得到一个被矩形包围的图像的内容。我正在使用emguCV DetectMultiScale函数,该函数返回一个矩形数组,其中包含获取内容所需的检测图像的位置或区域。谢谢C# 如何获取矩形内图像的内容?,c#,opencv,emgucv,C#,Opencv,Emgucv,我需要得到一个被矩形包围的图像的内容。我正在使用emguCV DetectMultiScale函数,该函数返回一个矩形数组,其中包含获取内容所需的检测图像的位置或区域。谢谢 results = FindPeople.Find(frameImage, tryUseCuda, tryuseOpenCL, out processingTime, out peopleCount); foreach (Rectangle rect in results) { CvInvoke.Rectangle(
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
谢谢有可能制作一个frameImage数组吗?因为它将根据检测到的人数返回多个矩形