tesseract.js
tesseract.js copied to clipboard
Fix types for setting Tesseract parameters in `recognize`
Since Version 4, Tesseract.js has allowed for setting parameters for a single recognition job (see #665). However, it does not look like the types were ever updated--the following code results in a type error.
const res = await tessScheduler.addJob('recognize', inputImage, {
tessedit_pageseg_mode: "6" // "Single block"
});
Additionally, the api.md file does not clearly describe this capability, so we should make sure this feature is well documented.