


So I keep getting an error that I have to set the TESSDATA_PREFIX env var which I did do, both in the User Vars and System Var. However after doing that I get another error. I attached screenshots to make my setup and issuse as clear as possible. Im using node-tesseract-ocr - npm (npmjs.com)![]()
--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/ff0dfe5f-969c-412f-bc2b-1bca7358afa0n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/4e67e75a-b3c6-4f95-a168-eb8d9e50d6e3n%40googlegroups.com.
Sorry for the confusion, When I do
tesseract.recognize(`C:\\Users\\osain\\OneDrive\\Desktop\\1992 Spring\\Document_20240109_0014.jpg`, {lang: "eng",oem: 1,psm: 0,})
I get
Command failed: tesseract "C:\Users\osain\OneDrive\Desktop\1992 Spring\Document_20240109_0014.jpg" stdout -l eng --oem 1 --psm 0
Warning, detects only orientation with -l eng
Error, OSD requires a model for the legacy engine
How do I fix this error? I am using it through this wrapper node-tesseract-ocr - npm (npmjs.com). I hear you when you say make sure tesseract (outside of wrapper) is providing expected results. But thats the thing when I set psm to 0 I expect to get back orientation data. However when I set the psm to other numbers like 3 or 1 it returns to me the text from an image.
Something else I tried was thisconst tesseract = require("node-tesseract-ocr")
tesseract.recognize(`C:\\Users\\osain\\OneDrive\\Desktop\\1992 Spring\\Document_20240109_0014.jpg`, {lang: "eng",oem: 1,psm: 0,
})"tessdata-dir": "C:\\Program Files\\Tesseract-OCR\\tessdata"
Thats when I get the error about the Tessdata env var. I have pasted it below:
Command failed: tesseract "C:\Users\osain\OneDrive\Desktop\1992 Spring\Document_20240109_0014.jpg" stdout -l eng --oem 1 --psm 3 --tessdata-dir C:\Program Files\Tesseract-OCR\tessdata
Error opening data file C:\Program/eng.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.
Failed loading language 'eng'
Tesseract couldn't load any languages!
Could not initialize tesseract.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/b9fe984e-97ef-41cf-9c82-5a79df78fbd3n%40googlegroups.com.
Something else I tried was thisconst tesseract = require("node-tesseract-ocr")
tesseract.recognize(`C:\\Users\\osain\\OneDrive\\Desktop\\1992 Spring\\Document_20240109_0014.jpg`, {lang: "eng",oem: 1,psm: 0,
})"tessdata-dir": "C:\\Program Files\\Tesseract-OCR\\tessdata"
Thats when I get the error about the Tessdata env var. I have pasted it below:
Command failed: tesseract "C:\Users\osain\OneDrive\Desktop\1992 Spring\Document_20240109_0014.jpg" stdout -l eng --oem 1 --psm 3 --tessdata-dir C:\Program Files\Tesseract-OCR\tessdata
Error opening data file C:\Program/eng.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.
--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/77f1b6af-6cea-4294-b4fd-5a2ec03ded23n%40googlegroups.com.