A small lightweight C# client library for the amazing open-ocr project.
All you need is a running instance of open-ocr.
Install the nugetpackage:
Install-Package open-ocr-dotnet -Pre
In minimal config you only need to provide the host url. The default port (9292) will be used. Default language is eng.
var service = new OpenOcrService(ocrhosturl);
var service = new OpenOcrService(ocrhosturl,ocrport);
var service = new OpenOcrService(ocrhosturl,ocrport,options);
string imagetodetect = @"http://bit.ly/ocrimage";
string ocrhosturl = @"http://PLACE_HOST_IP_HERE";
string ocrport = "HOSTPORT";
OpenOcrOptions options = new OpenOcrOptions {
Language = EngineLanguage.eng,
EngineOptions = new EngineOptions {
Engine = OcrEngine.Tesseract
}
OpenOcrService service = new OpenOcrService(ocrhosturl, ocrport, options);
string resultFromUrl = await service.ProgressImageFromUrl(imagetodetect);
byte[] fileBytes = File.ReadAllBytes(@"PATHTOIMAGE\ocr_test.png");
string resultlocalFile = await service.ProgressImage(fileBytes);
It is important that you first enable the preprocessor in your open-ocr instance https://github.com/tleyden/open-ocr/wiki/Stroke-Width-Transform#start-an-additional-worker
OpenOcrOptions optionsSample = new OpenOcrOptions {
Language = EngineLanguage.eng,
EngineOptions = new EngineOptions {
Engine = OcrEngine.Tesseract
},
Preprocessors = new[] {
Preprocessor.StrokeWidthTransform,
"super-fancy-new-preprocessor"
}
};
- provide sample console app
- samples in README
- add credits
- json.net optional integration
- impove ci build
- implement todo's in code