0
我使用使用过的教程Emgu的网站上用下面的代码的代码:EmguCV/Open CV - 有没有办法多次搜索模板子代码?
using (Image<Gray, float> result = source.MatchTemplate(template, TemplateMatchingType.CcoeffNormed))
{
double[] minValues, maxValues;
Point[] minLocations, maxLocations;
result.MinMax(out minValues, out maxValues, out minLocations, out maxLocations);
// You can try different values of the threshold. I guess somewhere between 0.75 and 0.95 would be good.
if (maxValues[0] > 0.6)
{
// This is a match. Do something with it, for example draw a rectangle around it.
Rectangle match = new Rectangle(maxLocations[0], template.Size);
imageToShow.Draw(match, new Bgr(Color.Red), 3);
}
}
它的伟大工程,以确定其他图像内的单个子图像。但我想知道如何去适应这个代码来识别多个实例。
在此先感谢。