Adi
Adi

Reputation: 4230

TesseractJS Unable to detect text when aligment is not 0 or 90

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.

enter image description here

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

Answers (0)

Related Questions