问题
I use OCR puma.net and I have a result. But the result not only contains (a b c d
), the result also contains (; / , "
).
I want to output only these characters. How can I use it?
Here is my code:
var puma = new PumaPage(img.ToBitmap());
using (puma)
{
puma.FileFormat = PumaFileFormat.RtfAnsi;
puma.EnableSpeller = false;
puma.Language = PumaLanguage.English;
try{
string t=pumaPage.RecognizeToString();
return t;
}
catch(Exception e)
{
// return e.ToString();
return "i think ! this isnt Plate";
}
}
回答1:
I am not intimately familiar with puma.net, but I believe the answer to your question is generic to any OCR.
puma.Language = PumaLanguage.English;
By setting the recognition language to English, OCR will use all characters commonly found in an English alphabet, including punctuation marks. Imagine a paragraph of English text, which will contain A-Z, 0-9 and all punctuation marks.
If your intention is to constrain and limit yoru character set, then either a specialized language needs to be used (if such is available in that particular OCR technology), or perhaps a custom language with your desired specifications and limited character set needs to be created first, and then set for OCR.
来源:https://stackoverflow.com/questions/33850483/ocr-why-not-find-only-character