vertical processing

45 views
Skip to first unread message

Tarık Memil

unread,
Sep 4, 2016, 10:17:46 AM9/4/16
to tesseract-ocr
hi 

i m trying to auto login website with captca like a picture

but why tessnet Changing the location of the letters

 here is my code

 Nesne = wb1.Document.DomDocument.body.createControlRange()
            Nesne.Add(wb1.Document.Images(0).DomElement)
            Nesne.execCommand("Copy")
                Resim = My.Computer.Clipboard.GetImage()
                Dim image As Bitmap = New Bitmap(Resim)
            pb1.Image = image

            Dim img As Bitmap = New Bitmap(image)

            Dim clr As Integer

            For x = 0 To img.Width - 1
                For y = 0 To img.Height - 1
                    clr = (CInt(img.GetPixel(x, y).R) +
                   img.GetPixel(x, y).G +
                   img.GetPixel(x, y).B) \ 3
                    img.SetPixel(x, y, Color.FromArgb(clr, clr, clr))
                Next y
            Next x

            Dim ocr = New Tesseract()
            ocr.SetVariable("tessedit_char_whitelist", "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
            ocr.Init(Application.StartupPath & "\tessdata", "eng", False)
            Dim result = ocr.DoOCR(img, Rectangle.Empty)
            For Each word As Word In result
                guvenlikkodu = guvenlikkodu & word.Text
                'Console.WriteLine("{0} : {1}", word.Confidence, word.Text)
            Next

thanks for help and sorry for my english

screenshot.PNG
Reply all
Reply to author
Forward
0 new messages