Пример #1
0
 protected Result run(Params param)
 {
     ImagePreparation imagePreparation = new ImagePreparation();
     int[,] ai = imagePreparation.shiftImage(param.image, param.width, param.height, param.m);
     int i = ai.GetLength(0);
     int j = ai.GetLength(1);
     long l;
     try
     {
         l = imagePreparation.insertRedLines(ai, i, j);
     }
     catch (Exception)
     {
         l = 0x7fffffffffffffffL;
     }
     return new Result(ai, i, j, l);
 }
Пример #2
0
        public string GetStringCapcha()
        {
            byte[] uncompressedImage = UncompressedImage();
            Bitmap bmp = new Bitmap(200, 64);
            string result = String.Empty;
            try
            {
                CreateBitmapFromByte(uncompressedImage, bmp);
                ImagePreparation imagePreparation = new ImagePreparation();
                int[][,] ai = imagePreparation.prepare(bmp);

                OpticalCharacterRecognition opticalcharacterrecognition = new OpticalCharacterRecognition();
                result = opticalcharacterrecognition.recognizeCharacters(ai);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }
            finally
            {
                bmp.Dispose();
            }
            return result;
        }