zapolnoch / node-tesseract-ocr

A Node.js wrapper for the Tesseract OCR API
MIT License
304 stars 38 forks source link

Error: cannot open input file: stdin #43

Open m-maaz-azhar opened 1 year ago

m-maaz-azhar commented 1 year ago

CODE:

const tesseract = require("node-tesseract-ocr");

const config = {
    lang: "eng",
    oem: 1,
    psm: 3,
};

tesseract
.recognize("https://tesseract.projectnaptha.com/img/eng_bw.png", config)
.then((text) => {
    console.log("Result:", text);
})
.catch((error) => {
    console.log(error.message);
});

ERROR:

Command failed: tesseract stdin stdout -l eng --oem 1 --psm 3
read_params_file: Can't open 1
read_params_file: Can't open -psm
read_params_file: Can't open 3
Tesseract Open Source OCR Engine v3.02 with Leptonica
Cannot open input file: stdin

ADDITIONAL INFORMATION:

Platform: Windows 11 Node Version: v18.12.1 node-tesseract-ocr Version: ^2.2.1 Tesseract Version: 3.02

I am trying to extract text from images using NodeJS but getting this error what I am doing wrong here?