Ask Your Question

Revision history [back]

How I could remove these random points and lines from this captcha?

Hi, Im using a function to resize and remove the noise from the image and I'm left with this: image description

Could I use a function to remove these thin lines and dots? Thanks!

How I could remove these random points and lines from this captcha?

Hi, Im using a function to resize and remove the noise from the image and I'm left with this: image descriptionSome code:

static string screenshot(IWebElement captchaImage)
        {
            Screenshot sc = ((ITakesScreenshot)captchaImage).GetScreenshot();
            var img = System.Drawing.Image.FromStream(new MemoryStream(sc.AsByteArray)) as Bitmap;
            img.SetResolution(800, 600);
            var image = Resize(img, 800, 600);
            image.Save("captcha.png", System.Drawing.Imaging.ImageFormat.Png);
            Mat imageIn = Cv2.ImRead("captcha.png", ImreadModes.Grayscale);
            Mat edges = new Mat();

            Cv2.Canny(imageIn, edges, 100, 100);

            edges.SaveImage("captcha1.png");
            return "captcha1.png";
        }

Could I use a function to remove these thin lines and dots? Thanks!Thanks! It has two issues, first of all tesseract doesn't get the full text, second I get this error: Warning. Invalid resolution 0 dpi. Using 70 instead. Empty page!! Empty page!!

Captcha image after all filters: image description