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);
}
}
它的偉大工程,以確定其他圖像內的單個子圖像。但我想知道如何去適應這個代碼來識別多個實例。
在此先感謝。