Reputation: 4230
I am using TeserractJs to build a simple OCR. It only works on images where the text is horizontal or vertically written top to down and does not work when the text is at an angle or written bottom to up. I am setting the auto rotation and orientation detection setting already but still does not work.
Example image it is unable to detect.
My code looks like the following:
const storedLangCodeList: string[] = await (window as any).electronApi.sendLangCodeList();
const newWorker = await createWorker(storedLangCodeList, 1);
await newWorker.setParameters({
tessedit_pageseg_mode: PSM.AUTO_OSD,
});
setWorker(newWorker);
...
const extractText = async (base64Url: string) => {
if (worker) {
const ret = await worker.recognize(base64Url);
return ret.data.text;
}
}
Upvotes: 2
Views: 38