Socket
Socket
Sign inDemoInstall

react-native-tesseract-ocr

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-tesseract-ocr

Tesseract OCR wrapper for React Native


Version published
Maintainers
1
Weekly downloads
129
increased by35.79%
Install size
40.0 kB

Weekly downloads

Readme

Source

react-native-tesseract-ocr 👀

react-native-tesseract-ocr is a react-native wrapper for Tesseract OCR

Version Install Size Downloads PRs Welcome Commitizen friendly MIT License

All Contributors

Watch on GitHub Star on GitHub Tweet

This project uses:

  • tess-two for Android
  • Tesseract-OCR-iOS for iOS ⚠️ (This has NOT been implemented yet) ⚠️

NOTE: It is recommended to use react-native >= 0.60.0

Getting started

$ npm i react-native-tesseract-ocr --save

Mostly automatic installation

$ react-native link react-native-tesseract-ocr

Example

Showcase Android using Picker Showcase Android using Camera

Check the example by yourself here

Usage

tessOptions

PropertyTypeDescription
allowliststringList of characters you want to recognize
denyliststringList of characters you DON'T want to recognize
levelLevelLevel of the tokens of the page hierarchy (only used in recognizeTokens)

Level can be one of the following values 'symbol' | 'block' | 'line' | 'paragraph' | 'word'

recognize

import TesseractOcr, { LANG_ENGLISH } from 'react-native-tesseract-ocr';

const tessOptions = {};
TesseractOcr.recognize(imageSource, LANG_ENGLISH, tessOptions);

recognizeTokens

import TesseractOcr, { LANG_ENGLISH, LEVEL_WORD } from 'react-native-tesseract-ocr';

const tessOptions = { level: LEVEL_WORD };
TesseractOcr.recognizeTokens(imageSource, LANG_ENGLISH, tessOptions);

useEventListener

import React, { useState } from 'react';
import { useEventListener } from 'react-native-tesseract-ocr';

function App() {
  const [progress, setProgress] = useState(0);
  useEventListener('onProgressChange', (p) => {
    setProgress(p.percent / 100);
  });

  // return ...
}

Contributing

How to contribute?

This is a commitizen friendly repository, so instead of creating commits using git commit, please use our custom CLI by running:

$ npm run cz

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Jonathan Palma

💻 📖 💡

Johan Runsten

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT © jonathanpalma

This library wouldn't be possible without these amazing projects:

Keywords

FAQs

Last updated on 25 Jun 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc