[英]Tesseract c# : Find nothing in my case
I've add the C# wrapper for tesseract : TesseractEngine 我为tesseract添加了C#包装器: TesseractEngine
I've two types of images to read : 我有两种图像要读取:
And the second type (one letter only) : 第二种类型(仅一个字母):
But in both case, Tesseract return empty string. 但是在两种情况下,Tesseract返回空字符串。
Here is my code (found in docs) : 这是我的代码(在docs中找到):
public static void Main(string[] args)
{
var testImagePath = @"C:\plate\ExtractLicensePlate-0.jpg";
if (args.Length > 0)
{
testImagePath = args[0];
}
try
{
using (var engine = new TesseractEngine(@"./tessdata", "eng", EngineMode.Default))
{
engine.SetVariable("tessedit_char_whitelist", "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
using (var img = Pix.LoadFromFile(testImagePath))
{
using (var page = engine.Process(img))
{
var text = page.GetText();//<-- empty :(
}
}
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
Console.Read();
}
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
Maybe I miss an option or something else? 也许我错过了选择权或其他?
EDIT : I've try this kind but no success to : 编辑:我已经尝试过这种方法,但没有成功:
EDIT 2 : I've try Gray and Black and White and Tesseract Give me : EEEEEEE 编辑2:我已经尝试过灰色,黑白和Tesseract给我:EEEEEEE
I don't know what I can do better... : 我不知道我能做得更好...:
Try setting the PageSegMode
to SingleChar
or SingleWord
尝试将
PageSegMode
设置为SingleChar
或SingleWord
using (var page = engine.Process(img, PageSegMode.SingleChar)) { var text = page.GetText(); }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.