Ask Your Question

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

asked 2020-04-14 09:39:09 -0500

0xjavi gravatar image

updated 2020-04-14 14:29:18 -0500

Hi, Im using a function to resize and remove the noise from the image and I'm left with this: Some 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);

            return "captcha1.png";

Could I use a function to remove these thin lines and dots? 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

edit retag flag offensive close merge delete



@mvuori I'm not using this to damage any system or something. I've seen many people on this forum asking for the same type of help and they got responded. If I came here without saying it was a captcha nothing would have happened neither you would told me that.

0xjavi gravatar image0xjavi ( 2020-04-15 05:53:00 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2020-04-15 02:02:36 -0500

mvuori gravatar image

So, you are asking help in programmatically accessing systems that specifically protect themselves from such access with captchas.

It may be that asking such help or helping with such problem are not without ethical problems.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-04-14 09:39:09 -0500

Seen: 372 times

Last updated: Apr 14 '20