Ejemplo n.º 1
0
        public static void RunTest()
        {
            while (true)
            {
                Console.Write("string A:");
                string strA = Console.ReadLine().Trim();
                if (strA.Equals("q", StringComparison.OrdinalIgnoreCase))
                {
                    break;
                }
                Console.Write("string B:");
                string strB = Console.ReadLine().Trim();
                if (strB.Equals("q", StringComparison.OrdinalIgnoreCase))
                {
                    break;
                }
                int times = 1;

                double similar = 0;
                var    dt1     = DateTime.Now;
                for (int i = 0; i < times; i++)
                {
                    similar = Similar.SimilarityBy_LD_LCS(strA, strB);
                }
                var dt2 = DateTime.Now;

                Console.WriteLine("similar:{2}-{3},The similar is:{0},time:{1}", similar, (dt2 - dt1).TotalMilliseconds, strA.Length, strB.Length);

                Console.WriteLine();
            }
        }
        public static double SimilarImage(Image aImage, Image bImage)
        {
            string sa = ReadPix(aImage);
            string sb = ReadPix(bImage);

            Console.WriteLine(sa.Length);
            Console.WriteLine(sb.Length);
            return(Similar.SimilarityBy_LD_LCS(sa, sb));
        }