Closed JoachimUnger closed 5 months ago
With the latest version VietOCR 6.13.1 and the best traineddata I get 'ZALUM'. OcrEngineMode=1. PageSegMode=7. The default PageSegMode 3 gives no result.
The important difference is that my PNG had 8bpp and yours 24 bpp.
So it works!
@JoachimUnger Acknowledged. I right clicked on the attached image, copied and pasted it into VietOCR UI, and got the results.
However, if I saved the image to the local drive, loaded it in the program, and performed OCR on it, it would produce blank output. When I applied either the grayscale or the monochrome filter, I got good output again.
It's possible or likely that Tesseract CLI performs some basic image preprocessing before OCR stage. You may have to perform similar preprocessing yourself when using tess4j.
We may need to debug and trace through the native code to determine what preprocessing is performed for this kind of image.
@JoachimUnger Tesseract OCR engine did not perform any preprocessing on this image. The CLI has used TextRenderer
, not GetUTF8Text
, which doOCR
calls, to create the output text file. If you used the renderer in your program, you'd get the expected matching results. You can verify by using VietOCR's Bulk OCR
function, which uses the renderers.
I am using Tesseract 5.3.4
tesseract v5.3.4.20240503 leptonica-1.84.1 libgif 5.2.1 : libjpeg 8d (libjpeg-turbo 3.0.1) : libpng 1.6.43 : libtiff 4.6.0 : zlib 1.3 : libwebp 1.4.0 : libopenjp2 2.5.2 Found AVX2 Found AVX Found FMA Found SSE4.1 Found libarchive 3.7.4 zlib/1.3.1 liblzma/5.6.1 bz2lib/1.0.8 liblz4/1.9.4 libzstd/1.5.6 Found libcurl/8.7.1 Schannel zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.0
In the tessdata is the best deu.traineddata.
"c:\Program Files\Tesseract-OCR\tesseract" test2.png output2 -l deu
results in output 'ZAUN'.
Result is 'ZALUM'.
Does the tesseract.exe more processing? Or are there fidderent internal settings?