public static double Match(iTemplate a, iTemplate b) { double[] tmp = new double[a.zerCoefficients.Length]; for (int i = 0; i < a.zerCoefficients.Length; i++) { tmp[i] = a.zerCoefficients[i] - b.zerCoefficients[i]; } return(MathUtils.GetAverage(tmp)); }
private void pictureBoxIn_Click(object sender, EventArgs e) { iTemplate template1 = new iTemplate(myImage1); iTemplate template2 = new iTemplate(myImage2); //Stopwatch sw = new Stopwatch(); //sw.Start(); //for (int i = 0; i < 100; i++ ) double res = iTemplate.Match(template1, template2); //sw.Stop(); //MessageBox.Show(String.Format("{0} ms", sw.ElapsedMilliseconds), "Time"); MessageBox.Show(String.Format("{0}", res), "Matching"); // pictureBoxFiltred.Size = new System.Drawing.Size(myImage.Width, myImage.Height); //pictureBoxFiltred.Image = myImage; //pictureBoxFiltred.Refresh(); }
public static double Match(iTemplate a, iTemplate b) { double[] tmp = new double[a.zerCoefficients.Length]; for (int i = 0; i < a.zerCoefficients.Length; i++) { tmp[i] = a.zerCoefficients[i] - b.zerCoefficients[i]; } return MathUtils.GetAverage(tmp); }