Maybe we can change the trained data to improve the result. We can filter the returned characters by setting a character whitelist: await tParameters() Since I’m using the OCR for 1D barcodes, the expected outcome should only contain digital numbers. Here is the result: (IMTANMUEARR09602 2010 According to tesseract.js-offline, we can manually download the data file and define the local data path to make the app work offline. The reason is it will trigger the download if there is no language trained data existed. However, you may find that all examples take a long time when running for the first time. To get started with Tesseract.js, we can learn the examples. Install Tesseract.js: npm install tesseract.js When we search for “JavaScript OCR” in Google, the first of returned results is Tesseract.js, which is a JS wrapper, built with Emscripten (A tool compiles C/C++ to WebAssembly), for Tesseract OCR engine. How to Use JavaScript OCR to Recognize 1D Barcode Text In this article, I will change the programming language to JavaScript, creating a JavaScript barcode scan app integrated with Tesseract JavaScript OCR. Previously, I shared an article demonstrating how to use Tesseract Python OCR to recognize the accompanying text of a 1D barcode. How to Build a JavaScript Barcode Scanner with Tesseract.js OCR
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |