Re: Variables having no effect on C# Tesseract.net 4.0.0.6 wrapper

381 views
Skip to first unread message
Message has been deleted
Message has been deleted
Message has been deleted

Bau auto

unread,
Jan 16, 2018, 9:33:49 PM1/16/18
to tesseract-ocr
i cannot setup Tesseract 4.0 into my project. i install by NuGet console follow guide :
but unsuccessfull. it's give error : "Failed to add reference to pvt.cppan.demo.danbloomberg.leptonica-1.74.4"
how did you do that??? 

Vào 02:15:58 UTC+7 Thứ Sáu, ngày 12 tháng 1 năm 2018, James Q đã viết:
Is anyone else using tesseract 4.0alpha from C# ?

On Wednesday, January 10, 2018 at 1:07:28 PM UTC, James Q wrote:
Here is my code:
string text = "";

string tessDataPath = ConfigurationManager.AppSettings["TessPath"];
using (var engine = new TessBaseAPI(@tessDataPath, @"eng"))
{
    engine
.SetVariable("tessedit_ocr_engine_mode", "0");
    engine
.SetPageSegMode(PageSegmentationMode.SINGLE_LINE);
    engine
.SetVariable("tessedit_char_blacklist", type.GetTesseractOptions().Blacklist());
    engine
.SetVariable("tessedit_char_whitelist", type.GetTesseractOptions().Whitelist());
    engine
.Process(imageFileName, false);
    text
= engine.GetUTF8Text();

}

I'm sending images which represent one or a few words on a single line, but in the above code, the SetPageSegMode(..) method has no effect. On the command line I can use:
   
tesseract.exe input.png result -l eng --psm 7 --oem 1

on the same images and see clearly better results on psm 7. Does anyone know how to configure this option via the wrapper or is it just not suppported?

Also, blacklists and whitelists are having no effect in the wrapper. Whilst I understand that these are not supported in Tesseract 4 LSTM mode yet, they should still work in 'Tesseract Only' mode right? I know the SetVariable method works (as I see its effect on engine mode). Is there another way of setting blacklists and whitelists through this wrapper?

Thanks
James 
Reply all
Reply to author
Forward
Message has been deleted
0 new messages