Skip to main content

This is a module to make specifics OCRs at food products and nutricional tables.

Project description

Nkocr

Python Test Upload Python Package

This is a module to make specifics OCRs at food products and nutricional tables.

As a prerequisite of this project, we have the tesseract library which can be found in more detail at

https://github.com/tesseract-ocr/tesseract

Installation of prerequisites

Tesseract OCR

The installation of tesseract on the Linux system can be done in a few commands:

$ sudo apt install tesseract-ocr tesseract-ocr-por
$ sudo apt install libtesseract-dev

And the same goes for macOS. There is a variation between MacPorts and Homebrew, but in this post I will only quote the version of Homebrew:

$ brew install tesseract

After performing the tesseract installation, it is possible to perform OCR in just one command, thus already extracting some words from the image.

The default language is English, depending on the text, it will not be possible to capture the word/phrase. If you want to work with another language, you need to make some additional installations. (https://github.com/tesseract-ocr/tesseract/wiki#other-languages)


OpenCV

The installation of OpenCV on the Linux system can be done in a command:

$ sudo apt install python3-opencv

To more informations, access: https://docs.opencv.org/master/da/df6/tutorial_py_table_of_contents_setup.html


Installation

You can install this package with:

$ pip install nkocr --user

How to use

To use this package, after do installation, do:

from nkocr import ocr_table, ocr_product

Example

from nkocr import ocr_table

text = ocr_table("paste_image_url_here")
print(text) # or print(text.text)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nkocr-1.0.1.tar.gz (17.1 kB view hashes)

Uploaded Source

Built Distribution

nkocr-1.0.1-py3-none-any.whl (10.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page