EmguCv Match Template Usage ?

03/13/2018 10:13 lenclstr746#1
Hi Guys I need a "EmguCV Match Template" usage tutorial code ?
03/13/2018 10:30 Serraniel#2
Quote:
Emgu CV is a cross platform .Net wrapper to the OpenCV image processing library.
#moved
04/28/2018 18:25 exane^#3
Code:
public static Point SearchOne(Image<Bgr, byte> srcImg, Image<Bgr, byte> smpImg, double treshold, Rectangle roi, out bool success)
{
	srcImg.ROI = roi;
	Image<Gray, float> matched = srcImg.MatchTemplate(smpImg, TemplateMatchingType.CcoeffNormed);

	matched.MinMax(out double[] minValues, out double[] maxValues, out Point[] minLocations, out Point[] maxLocations);
	matched.Dispose();

	if (maxValues[0] > treshold)
	{
		success = true;
		int x = roi.X + maxLocations[0].X;
		int y = roi.Y + maxLocations[0].Y;
		return new Point(x, y);
	}
	success = false;
	return Point.Empty;
}