Last line which sets the picturebox's.image property gives me an error, error is
Cannot implicitly convert type 'Emgu.CV.Image' to 'System.Drawing.Image'
I have tried to use toBitmap() but it said there was no such a thing which belongs to imageToShow. Any help would be great..
Image<Bgr, byte> source = new Image<Bgr, byte>(@"C:\\Users\\ereno\\OneDrive\\Masaüstü\\TRButton.png");
Image<Bgr, byte> template = new Image<Bgr, byte>(@"C:\\Users\\ereno\\OneDrive\\Masaüstü\\Screenshot_2.png");
Image<Bgr, byte> imageToShow = source.Copy();
using (Image<Gray, float> result = source.MatchTemplate(template, Emgu.CV.CvEnum.TemplateMatchingType.CcoeffNormed))
{
double[] minValues, maxValues;
Point[] minLocations, maxLocations;
result.MinMax(out minValues, out maxValues, out minLocations, out maxLocations);
if (maxValues[0] > 0.9)
{
Rectangle match = new Rectangle(maxLocations[0], template.Size);
imageToShow.Draw(match, new Bgr(Color.Red), 3);
}
}
pictureBox1.Image = imageToShow;