Esempio n. 1
0
        private CheckCode.MatchedChar ScopeMatch(bool[,] source, bool[,] target, int start)
        {
            target.GetLength(0);
            int length = target.GetLength(1);

            source.GetLength(0);
            int    length2 = source.GetLength(1);
            double num     = 0.0;

            CheckCode.MatchedChar matchedChar = new CheckCode.MatchedChar();
            for (int i = -2; i < 6; i++)
            {
                for (int j = -3; j < length2 - length + 5; j++)
                {
                    double num2 = this.FixedMatch(source, target, i + start, j);
                    if (num2 > num)
                    {
                        num              = num2;
                        matchedChar.X    = i + start;
                        matchedChar.Y    = j;
                        matchedChar.Rate = num2;
                    }
                }
            }
            return(matchedChar);
        }
Esempio n. 2
0
 private CheckCode.MatchedChar Match(bool[,] source, int start)
 {
     CheckCode.MatchedChar matchedChar = null;
     foreach (CheckCode.CharInfo current in this.words_)
     {
         CheckCode.MatchedChar matchedChar2 = this.ScopeMatch(source, current.Table, start);
         matchedChar2.Char = current.Char;
         if (matchedChar == null || matchedChar.Rate < matchedChar2.Rate)
         {
             matchedChar = matchedChar2;
         }
     }
     return(matchedChar);
 }
Esempio n. 3
0
        private string ReadImg(Bitmap bmp)
        {
            string text     = string.Empty;
            int    width    = bmp.Width;
            int    arg_13_0 = bmp.Height;

            bool[,] array = this.ToTable(bmp);
            int i = this.SearchNext(array, -1);

            while (i < width - 7)
            {
                CheckCode.MatchedChar matchedChar = this.Match(array, i);
                if (matchedChar.Rate > 0.6)
                {
                    text += matchedChar.Char;
                    i     = matchedChar.X + 10;
                }
                else
                {
                    i++;
                }
            }
            return(text);
        }