在处理OCR图像时,任何一个都可以帮助我只从图像中提取URL吗?
我查过了,所有的OCR都是付费版本的。有没有免费图书馆。
发布于 2022-09-13 06:31:23
我使用了IronOCR和解决问题。我创建了GetText函数,当图像转换为文本时,从文本中获取URL。
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();
}https://stackoverflow.com/questions/73684774
复制相似问题