0

Can any one help me to extract only URL from image when doing images processing OCR.

I checked, all OCR dll are in paid version. Is there any free libraries.

Maytham Fahmi
  • 31,138
  • 14
  • 118
  • 137

1 Answers1

0

I used IronOCR and problem solve. I created GetText Function which fetch URL from text when image converted to text.

 IronTesseract IronOcr = new IronTesseract();
            var Result = IronOcr.Read(Path.GetTempPath() +  "image.png");
            string _url = GetText(Result.Text);


 private string GetText(string myString)
    {
       Match url = Regex.Match(myString, @"[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@%_\+.~#?&//=]*)");
        return url.ToString();
    }