Using tesseract in node

74 views
Skip to first unread message

Sandeep Shakya

unread,
Jan 10, 2024, 6:03:00 AM1/10/24
to tesseract-ocr
import tesseract from "node-tesseract-ocr";
import fs from "fs";

const img = fs.readFileSync("./src/extract_user_input/2.jpg");

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

tesseract
  .recognize(img, config)
  .then((text) => {
    console.log("Result:", text);
  })
  .catch((error) => {
    console.log("err");
    console.log(error);
  });

I want to extract the hand writtenn text (for ex. point no.24 )
from the below image. which config should i use (or any other
changes needed to be done in image)??


20231113135539935138000000-6.jpg

Zdenko Podobny

unread,
Jan 10, 2024, 4:44:23 PM1/10/24
to tesser...@googlegroups.com
Tesseract is not trained for handwritten text.

Zdenko


st 10. 1. 2024 o 7:02 Sandeep Shakya <sandeeps...@gmail.com> napísal(a):
--
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/6cf4dc50-ecbd-4110-a6b8-6c29335bee79n%40googlegroups.com.

Tawatchai wichairam

unread,
Jan 12, 2024, 4:35:59 AM1/12/24
to tesser...@googlegroups.com
No Print 
    console.log("Result:", text);
Here not covert file exp .txt


ในวันที่ พ. 10 ม.ค. 2024 เวลา 23:44 Zdenko Podobny <zde...@gmail.com> เขียนว่า:
Reply all
Reply to author
Forward
0 new messages