Closed TejasPatadiya10 closed 1 year ago
It should work because the code is written in .net core but I never tested it because I don't have any Linux. The only difference between Windows and Linux is that Linux uses the .so as extension for Tesseract so I think you somehow have to install the needed Tesseract libraries yourself because the nuget packag only has Windows DLL's in it with the .dll extension. You could try to rename them but I don't know if that works.
You could try to ask for some help in this issue --> https://github.com/Sicos1977/TesseractOCR/issues/35
I have used Linux in the past but that is ages ago so I don't know if I'm any help to you.
It looks like [RuntimeDllImport]
and the rest of InteropDotNet is a custom reimplementation of P/Invoke and is actually cross-platform. (Our codebase also has one of these, pretty cool stuff.) It may be possible to have one package for both Windows and Linux just by changing these library filenames to leptonica-1.83.0
and tesseract53
:
https://github.com/Sicos1977/TesseractOCR/blob/c1225951128c6c6e59892ea88214eb5bfba33275/TesseractOCR/Interop/Constants.cs#L32-L33
The implementation for Linux wraps the argument to [RuntimeDllImport]
in $"lib{p}.so"
, but doesn't remove .dll
first (IIRC Mono's [DllImport]
implementation is the same—very annoying). And the implementation for Windows will add back the .dll
.
edit: w.r.t. WSL, you should be good to test in e.g. Debian WSL2 instead of a "real" VM.
Uhh? Is this wontfix?
Euh didn't read somewhere that I had to do something? I thought you were answering the question for the original issuer :-)
Hi,
Recently we have been exploring different packages that supports OCR on linux and we have came across your package.
But when we ran it to linux/centos directly we are facing errors
so we want to know whether we need to perform any additional steps to run the same in the linux/centos