Giter VIP home page Giter VIP logo

react-native-tesseract-ocr's People

Contributors

allcontributors[bot] avatar aphex3k avatar jonathanpalma avatar jrunestone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-tesseract-ocr's Issues

SDK Error

Hi
I have problem with sdk.
Do you update sdk in project?

com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to finalize session : -26: Package com.example new target SDK 22 doesn't support runtime permissions but the old target SDK 25 does.

doesn't read properly

I tried this in android project but it doesn't read properly. And also it reads black font only.any comments?

Unmet peer dependency

Hi, when I tried to install the library with npm install react-native-tesseract-ocr --save, I got an error:

├── UNMET PEER DEPENDENCY [email protected]
└── [email protected] 

my react-native version was 0.34, so I've updated it to 0.34.1, and the result is the same.

Math formulas

is it possilble to use it with math formulas? Or should i train my own data?

TesseractOCR/TesseractOCR.h Not found

This issue has been filed before here, but I wondering if anyone has faced this issue lately.

I'm using RN 0.55.4 and react-native-tesseract-ocr 4.0.0.

In file included from /Users/gmaggess/dev/oracle/amce/omce_demos/aria_ocr/node_modules/react-native-tesseract-ocr/ios/RNTesseractOcr.m:2:
/Users/gmaggess/dev/oracle/amce/omce_demos/aria_ocr/node_modules/react-native-tesseract-ocr/ios/RNTesseractOcr.h:3:9: fatal error: 'TesseractOCR/TesseractOCR.h' file not found
#import <TesseractOCR/TesseractOCR.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.



** BUILD FAILED **


The following build commands failed:

	CompileC /Users/gmaggess/dev/oracle/amce/omce_demos/aria_ocr/ios/build/Build/Intermediates.noindex/RNTesseractOcr.build/Debug-iphonesimulator/RNTesseractOcr.build/Objects-normal/x86_64/RNTesseractOcr.o RNTesseractOcr.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

RNTesseractOcr is undefined

Hello,
I have expo app. I've detatched project to get Android files. After, I used link command.
Now in my MainApplication.java i have proper code lines for import and returning new RNTesseractOcrPackage(). Now when i'm trying to use it in my app RNTesseractOcr is undefined. I have proper impoer statement and it is still not working, please help.

Error: Data file not found at /storage/emulated/0/com.dvastarter/tessdata/eng.traineddata at createErrorFromErrorData (blob:http://localhost:8081/b8ee2c8d-43f7-44e7-98c8-695305b775bf:3663:17) at blob:http://localhost:8081/b8ee2c8d-43f7-44e7-98c8-695305b775bf:3615:27 at MessageQueue.__invokeCallback (blob:http://localhost:8081/b8ee2c8d-43f7-44e7-98c8-695305b775bf:4057:18) at blob:http://localhost:8081/b8ee2c8d-43f7-44e7-98c8-695305b775bf:3802:18 at MessageQueue.__guardSafe (blob:http://localhost:8081/b8ee2c8d-43f7-44e7-98c8-695305b775bf:3970:11) at MessageQueue.invokeCallbackAndReturnFlushedQueue (blob:http://localhost:8081/b8ee2c8d-43f7-44e7-98c8-695305b775bf:3801:14) at http://localhost:8081/debugger-ui/debuggerWorker.js:72:58 {framesToPop: 1, code: An error occurred, stack: Error: Data file not found at /storage/emulated/0/…ocalhost:8081/debugger-ui/debuggerWorker.js:72:58, message: Data file not found at /storage/emulated/0/com.dvastarter/tessdata/eng.traineddata}

RNTesseractOcr is undefined after import

Hey,

I managed to get react native tesseract ocr run for iOS. But: When I use your example I can't use RNTesseractOcr as it is still undefined after I imported it:
import RNTesseractOcr from 'react-native-tesseract-ocr';
Does anyone has a clue how to proceed here?

Probably the same issue here but this time it's with iOS.

Undefined is not a function

Hi,

I am trying to implement this in a project I am doing and I can't run it. It always shows me this error:

screenshot_20180322-143702

I did all the steps you specified to use this but I can't seem to be able to get this to work.

Hope you can help and thanks in advance.

[Error: Failed to read bitmap]

i'm getting this error as log with english traineddata
the complete error is
'OCR Error: ', { [Error: Failed to read bitmap] framesToPop: 1, code: 'An error occurred' }

Cannot use OCR

Hello to all.

I just downloaded the example and did:

  • npm install
  • npm link
  • react-native link

also, I had an issue because the mainapplication.java inside of library was overriding a method which does not derive from superclass, I just commented override keyword so i can compile it.

The below code never executes .then(result) or .catch(err)
RNTesseractOcr.recognize(path, 'LANG_ENGLISH', tessOptions) .then((result) => { this.setState({ isLoading: false, ocrResult: result }); console.log('OCR Result: ', result); }) .catch((err) => { console.log('OCR Error: ', err); }) .done();

but when i change 'LANG_ENGLISH' to "eng" then it throws an error Attempt to invoke virtual method 'java.lang.String ljava.lang.Object.toString()' on a null object reference.

Also, I want to use only ocr in english so i have copied eng.traindata in assets folder only and it does exists on my phone when i check.

Also, even if i get result sometime, it takes around 5 minutes and there are only random words that dont have to do anything with the content i have scanned.

(OCR Result: .. ‘I
”wilmwlgi‘yl I I I “IIIIIII‘I II
.. I. mgfuaslig‘IM . I‘ I In IIIII I
I MIMI?” fig I I ‘I’IIIIIIIIIIIEI‘SIIIIIIIIIéégis .
I ,M . . Hi I ~ I IIII’IfiEIIIsr‘II‘EIiM’IrféIgiii‘g‘ésifiéfié§I I I I
aIIIIIIIIIIIIIII I IIIIIIIs’.‘””Igugsigggfi II I I I I
I WazéiwifszInciIrIIIIIIIIIu.uI I I II‘I‘II"II““‘I‘II‘IIIIIII
‘ IIIIHI‘III II IIIII“II‘“IIIIIIIIIIIIIj
I III “ ‘ ““III“IIIIIagézeiZIfMII.’I
II ‘q?IffiWIIIIIgr.I I u I . W“IgIiifigggémiigzgyngagaitj,’
I w I I “‘IIII’IIIIIITIIII I IIIIIIIIIIIIIIIIIIIIIIIIIII I
lngIQEIIIIIM..?§£? ZIIIIEI’I ‘ ‘ EQIIEIZQ“II.IIE‘,IIII TV,“ I j I ‘ ~ . I “III VIIIIIIIIIIIIIIIIIII I I IIIIIIIIIIIIIIII I
wagifIze“ my hf‘ng‘iflfiffiiu mo‘ IiIIIIIIIIm‘EHIIiI‘II.jIw ’ I ‘i’ ‘ “I ”I ‘ ‘ i ‘ II’leiIIfliIIIII I I j “I IIIIII‘IIIIIIIIIIIIIC“ ..
I i‘lfim‘l’m”~ M I I I I I I I I I I I I I IIIIIIIIIIIIII I IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII I
“I III“???MI,”I .. I , I I I IIIIIIIIIIIIIIIIIIIIIIIII IIIIIIIIIIIIIIIIIII
‘ W IIIII‘IIIIIIIIIs I I I I I IIIIIIIIIIIIIIIIIIIIII I ’ IIIIIIIIIIIIIIIIIII
,I.»zgisz‘i‘IIIéIIIIiI MI.“IIIIIIIIIIIIIIIIiiivx’ifl“ ‘ ‘ I I ‘I”IIIIIJIIIIIIIII. .II IIIIIIIIIIIIIIIIIIIIIIIII
W III” "iIIIIIIIIIIIIIII”III . ,IIIIII III‘II IIIIIIIIIIII,
” ‘ “I’“““‘““IIIIII“IIIIIII IIIIIIIII ff‘fI‘gIII I IIIIIIIIIIIIIIIIIW ‘ ‘ W‘IIIIIII III I I IIIIIIII
‘ “III I IIIIIIIIII I... “I I IIIIMIII I. I MI‘III, II MsIz‘IzImzi‘ .
U “I’ I ‘ .“I .w I IIIIIIIIIIJ M ‘I‘IIMII‘IIIIII , IiIIIIIIIIMIIIMI,I
I “’III‘IIIIIII ‘ III II...“ I III‘ I i g I III I . IIIIIIIII
I I“I”“‘II‘IIIIIIIEI?I , I I I mum. I~.I,MI.‘I.MI “I, I M ‘ ,IWII I I I’M
j WINSmy ‘ I lie IIEIII ’gIe IIIMIII “‘n M I I i“i II?“ III LII III‘I‘ . M
I‘“I““‘IIIIIIIIIII II I I III II“ . II IIIIIIIIIIIIfinal’
I ‘. Inz’III‘III , ‘ . I I ’IIIIIII‘IIIIIIIIIIIIIII .if‘ II ‘ III WI‘III‘HI‘I ’ xIIiII..¥iIz”EiJf I
I jzIIIIIIIIIIIIIIIIIII?IIIfiIIIII I I III III“ “IIIiII’IIIIIIIII‘IilIIII“ II I I f ‘I‘I II IIIIIIIIIIII’fiIIIé‘I’““y‘
MI ‘éé‘fII‘iJII‘IL‘TII’I IIII I «In. I IIIIIIIIISIH‘IIQ I u ‘ MI HINDI“ III‘WIIIIIII III‘IIIII’IIIIIIIIII,I.II
s‘a Ii“ IIIIII‘IIIIIIEIIIIIIIiIIIIiI”r I ’I II ,...» IIIIIIjIIIIIu .‘wII I I ‘ IIII‘II III I“ IIII‘MI‘II‘MI ‘ IIEIIIIIIIi‘IziIIJIIr. I
I, IWIM I I I II I w i“III‘III‘gI“‘ ‘ I «Ij‘III‘I‘II I I
IIIII‘IIIIIIIII ’ IIIIIII II I..IIIII..IIII“IIXIM‘ n. ~ III I IIIIIIIIIIIEI
WWII” ”It JIM“ I II I I ’ WIIIIIIIIIM I M‘ I II I I IIIIIII II IIIIIIII III IIIII IIIIIIIIIIIIIIIIIIIIII
aIf"§IJ‘‘§ IIIiIIIIIIIIIII IIIIIIIIII II I II I mIm‘I’. » ‘ IIIIIIIIIIII
III’IIIII ‘HIII‘IIIJIII I III IN” I‘ III m .I II I IIIIIIII
II IIIIIIIIIIII V jIIIIIIIIIIIIIIIII II III II...“ M , I I I IIIIIIIIIIIIIIIIIII
zéIIIEI‘Vz “I” I x I’III ‘, I ‘ ’ I I‘C’I III‘I I“ II ‘ I II I ‘IIIII‘IIM‘IIIIMIII III IIIIQIIIIII I I II IIIINHIIII II
IIIIII‘IINIl HII I‘ I M .IIIIIIIIIPII II I IIIIIIII“‘I‘II I‘ ‘ “ M II I II ’y‘IvIIII, I‘ II IIIIIIIIIIIIII I I
W IIIII V IIWIIIIII I I MIIILM‘ it?» . I I III
I IIIiIII‘ M IIIinIiIIIIIIIIIIIII I II WINN‘ I . I I I I III II
II ‘IIIIII x, IIIIIIIII,I III I IIIIIII‘W M M I III
“M IMIII , IIIIIII III ,M IWI I I I ‘ I ,IIII‘JIIIsII III I III
M III III. IIIIIIII. .I’I” gr, MM M I M , I IIIIIIIIIIIIIIIIIIIIIII
II‘III IIIII’IIII I I I III‘II‘I I I’MWI’IIIIIIIIII’IKII ”.MijIIs‘m I‘IIIIIIII’II IIIIIIIII I
IIIII I II II IIIWIIII’I‘III III
I II I I I I I ,M I
III IIIII‘IIIIIIII ’ II I I mar IIII IIIIIIIIIIII WW II IIIIIIIIIIIIIII II
liilIIiIiraf“ IIIII M mm IIII’IIIII m ’IIIIII.IIIIIIIIIIIII I I IIIIIII
IIIIIIIIIH m II“ III I’I‘IVIIIIIIIII u
MI IIIE‘II M H» II II IJII I I, » I
égfglizr . M‘ . I um I Ig‘f‘IIIIIIIIIIIIIII
IIKIIIIIIIIII II I I IIIIIIII‘ ”MEI IIIIIII IHIIIIIIIIIIIIIIIII v IIIII‘II“
III’ITIII’IIII‘IIV ’ I I III II III” ~ I IIi
if I IMI‘Ij’flf‘I‘IiIIIithIIEII . v III‘IIIIIIII I “II , I I II ‘zIIg’IIII‘zIQIII,
‘ IMII‘IIII , I IIIIIIIIIIIIIIII IIIIIII IIIIIIIEII IIIIIIIIIIIIII III III IIIIIIIIIIIIII
Ii I i,”III‘IIUIIQI’IIIIIIII’EI F» , . II‘III‘II .. “ IIII’rIII’Iu II who
. IifTarsiIIIIIIEIIIIIIIM ~ . I I IIIIIII I“??? IaIIIIISIIIIIII’IIIIIII I .I
I I IMIXTIIEI‘IIIH“an” ”E I Ii Ire “ I‘M hauliidInnIUII,» ‘i IIIIII L
I z ix“‘fI“““IEIE‘IIIIés§.III£IIIIII I a IIII’IIIM’W ngifIgi’»,
‘Ivg.I£IW i‘UIIIMIIIII I ‘
,M r ‘I’llI‘IS‘IIZIIIIII’II‘IIIIIII II IN? IIIIIIIIIII‘
I II II I. I?“Ii‘IIIEIEIIIVIiééII‘I§.§“Iis“ ‘z , I . a. .. IIIII,eMIEIIIIIIIIiMzIL .
’ IIII‘ISIIIIIIIIIIIIIII IIIIIIHMIIMI.)

Poor text outcome

Hello, I am getting extremely poor text outcome, something like 10%, pure gibberish, when running on Android. I must have placed the wrong eng.traineddata file OR in the wrong folder. I am running the tesseractOcrSample, demo, and added the eng.traineddata file here:
tesseractOcrSample/node_modules/react-native-tesseract-ocr/android/src/main/assets/tessdata/eng.traineddata
I took this eng.traineddata file from tesseract.js nodeJS module (located in tesseract.js-core/examples/canvas/eng.traineddata)
do I need to place it in another folder? Or do I need another file altogether? What Tesseract version is running in this Android module? Do I need to 'extract' anything?
Thanks very much in advance, also for your work.
John

App getting crashed

My app is getting crashing on using this module. Tried everything. Image path was also correct. Help..

Error: Data path don't exist, even if data path is correct

OCR Error: Error: Data path does not exist!
at createErrorFromErrorData (C:\reactnativeapp\ocr\node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:146)
at C:\reactnativeapp\ocr\node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:95
at MessageQueue.__invokeCallback (C:\reactnativeapp\ocr\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:414)
at C:\reactnativeapp\ocr\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:127
at MessageQueue.__guard (C:\reactnativeapp\ocr\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:314)
at MessageQueue.invokeCallbackAndReturnFlushedQueue (C:\reactnativeapp\ocr\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:126)
at debuggerWorker.js:72

Data path is : file:///storage/emulated/0/documents/a.jpg which is absolutely correct
Inside document folder there is an image called "a.jpg" still there is error

"Data file not found at " keep getting this error.

I was trying your sample, And i keep getting this error for file not found.

PATH - /storage/emulated/0/Pictures/image-ea1f7b95-141a-4d44-bc8f-8b76552833ed.jpg
Timeline: Activity_idle id: android.os.BinderProxy@c792cf time:191950033
25747-25918/com.ammobile D/RNTesseractOcr: Preparing tesseract enviroment
25747-25918/com.ammobile I/RNTesseractOcr: Created directory /storage/emulated/0/com.ammobile/tessdata
25747-25918/com.ammobile D/RNTesseractOcr: Start ocr images
25747-25918/com.ammobile E/RNTesseractOcr: Data file not found at /storage/emulated/0/com.ammobile/tessdata/eng.traineddata
25747-25917/com.ammobile I/ReactNativeJS: 'OCR Error: ', { [Error: Data file not found at /storage/emulated/0/com.ammobile/tessdata/eng.traineddata] framesToPop: 1, code: 'An error occurred' }

Cannot find protocol declaration for 'G8TesseractDelegate'

I installed package with required steps such as installing pods and linking but still getting this error. I have no idea how to solve it.
This error occurs in RNTesseractOcr.xcodeproj/RNTesseractOcr.h/RNTesseractOcr

#import "RCTBridgeModule.h"
#import "RNTesseractOcr.h"

@interface RNTesseractOcr : NSObject <RCTBridgeModule, G8TesseractDelegate>

@EnD

any ideas how to solve it?

:app:installdebug error

Hi i followed all the steps

image

i was waiting more than 25 min also no result

and also the apk file size is more than 500 MB

image

also my code is easy and understood!
image

any one can help
im using react-native last version

and i got this screen in my phone

53636618_474698376398751_4881456294428409856_n

and this is my image

image

OCR Blocking the UI

Seems RNTesseractOcr is blocking the UI.

I tried with TesseractOcrSample you have provided, 'cancel recognition' Button not respond.
(it should be able to run in background)

Blocks the app when running on Nexus 6p

I have the following problem when running directly on my mobile phone (Nexus 6p):

  • I am using the following code:
import RNTesseractOcr from 'react-native-tesseract-ocr';
/**
 * @param {string} imgPath - The path of the image.
 * @param {string} lang - The language you want to process.
 */
RNTesseractOcr.startOcr(imgPath, lang)
  .then((result) => {
    this.setState({ ocrResult: result });
    console.log("OCR Result: ", result);
  })
  .catch((err) => {
    console.log("OCR Error: ", err);
  })
  .done();
  • Everything works good till the startOcr method. I have replaced the imgPath "file://" with "" and managed to have it going forward
  • But, it never reaches then or catch when using with my mobile phone (Nexus 6p)
  • It works well on my emulator (running Nexus 6p as well).

Any idea what to do for this? Or how can I troubleshoot? Once the issue happens, I cannot do anything on my app anymore...all links are not working. Not sure what is the problem.

Thanks!
Bogdan

OCR error Error: Failed to read bitmap

OCR error Error: Failed to read bitmap
at createErrorFromErrorData (E:\reactNativeProjects\MassFrame\node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:152)
at E:\reactNativeProjects\MassFrame\node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:104
at MessageQueue.__invokeCallback (E:\reactNativeProjects\MassFrame\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:442)
at E:\reactNativeProjects\MassFrame\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:127
at MessageQueue.__guard (E:\reactNativeProjects\MassFrame\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:343)
at MessageQueue.invokeCallbackAndReturnFlushedQueue (E:\reactNativeProjects\MassFrame\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:126)
at debuggerWorker.js:80

App getting crashed when use LANG_CUSTOM

I have to translate the Gujarati language text, So i change to LANG_CUSTOM in RNTesseractOcr.recognize, and add custom.traineddata into android/app/src/main/assets/tessdata.
Now when I try to pick Gujarati text image the app is crashed.

import React, { Component } from 'react';
import {
  ActivityIndicator,
  Image,
  Platform,
  Text,
  TouchableNativeFeedback,
  TouchableOpacity,
  View,
  PixelRatio
} from 'react-native';
import ImagePicker from 'react-native-image-picker';
import RNTesseractOcr from 'react-native-tesseract-ocr';
import styles from '../../styles';

const Button = (Platform.OS === 'android') ? TouchableNativeFeedback : TouchableOpacity;
const imagePickerOptions = {
  quality: 1.0,
  maxWidth: 500,
  maxHeight: 500,
  storageOptions: {
    skipBackup: true,
  },
};
const tessOptions = {
  whitelist: null,
  blacklist: null
};

class ImagePickerScreen extends Component {
  constructor(props) {
    super(props);
    this.state = {
      errorMessage: null,
      extractedText: null,
      hasErrored: false,
      imageSource: null,
      isLoading: false,
    };
    this.selectImage = this.selectImage.bind(this);
  }

  selectImage() {
    this.setState({ isLoading: true });
    console.log("imagepic");
    
    ImagePicker.showImagePicker(imagePickerOptions, (response) => {
      console.log('response',response);
      
      if (response.didCancel) {
        this.setState({ isLoading: false });
      } else if (response.error) {
        this.setState({ isLoading: false, hasErrored: true, errorMessage: response.error });
      } else {
        const source = { uri: response.uri };
        this.setState({ imageSource: source, hasErrored: false, errorMessage: null }, this.extractTextFromImage(response.path));
      }
    });
  }

  extractTextFromImage(imagePath) {
    console.log('imgpath', imagePath)
    RNTesseractOcr.recognize(imagePath, 'LANG_CUSTOM', tessOptions)
      .then((result) => {
        console.log('result',result);
        
        this.setState({ isLoading: false, extractedText: result });
      })
      .catch((err) => {
        console.log('error',err);
        
        this.setState({ hasErrored: true, errorMessage: err.message });
      });
  }

  render() {
    const { errorMessage, extractedText, hasErrored, imageSource, isLoading } = this.state;
    return (
      <View style={styles.container}>
        <Button onPress={this.selectImage} >
          <View style={[styles.image, styles.imageContainer, !imageSource && styles.rounded]}>
            {
              imageSource === null
                ? <Text>Tap me!</Text>
                : <Image style={styles.image} source={imageSource} />
            }
          </View>
        </Button>
        {
          isLoading
            ? <ActivityIndicator size="large" />
            : (
              hasErrored
                ? <Text>{errorMessage}</Text>
                : <Text>{extractedText}</Text>
            )
        }
      </View>
    );
  }
}

ImagePickerScreen.navigationOptions = {
  title: 'Image Picker Example',
};

export default ImagePickerScreen;

"react": "16.6.3",
"react-native": "0.57.8",
"react-native-gesture-handler": "^1.0.12",
"react-native-image-picker": "^0.28.0",
"react-native-tesseract-ocr": "^1.0.10",
"react-navigation": "^3.0.9"

Please help me,

Thanks in advance

Build error

Hi when i run the run-android command i have this error

What went wrong:
Execution failed for task ':react-native-image-picker:processReleaseResources'.

com.android.ide.common.process.ProcessException: Failed to execute aapt

Getting jibberish when using LANG_SWEDISH

Hi, which files are neccessary for the OCR to work with Swedish? I downloaded the swe... file but it seems it doesn't work. Do I need the whole /tessdata folder with every language - or is it enough to just use a couple of them?

Incompatibility with image-picker@latest

My package.json

...
  "dependencies": {
    "react": "16.3.1",
    "react-native": "0.55.4",
    "react-native-image-picker": "^0.27.1",
    "react-native-tesseract-ocr": "^1.0.10"
  },
  "devDependencies": {
    "babel-jest": "23.6.0",
    "babel-preset-react-native": "4.0.1",
    "jest": "23.6.0",
    "react-test-renderer": "16.3.1"
  },
  "jest": {
    "preset": "react-native"
  }
...

Using this dependency
com.android.tools.build:gradle:2.2.3

When I run
react-native run-android
I get this error
Could not expand ZIP 'D:\Progetti\Vari\ReceiptScannerTesseract2\node_modules\react-native-image-picker\android\build\outputs\aar\react-native-image-picker-release.aar

Which image-picker version shoul I use instead?

[Error: Failed to read bitmap]

Keep getting error
03-22 07:04:04.571 3226 3353 I ReactNativeJS: 'OCR Error: ', { [Error: Failed to read bitmap] framesToPop: 1, code: 'An error occurred' }

It is a simple project. react-native init, and then just installed react-native-tesseract-ocr.
And then I added text.png image in /images/ directory under project root directory and called below code in componentDidMount function.

RNTesseractOcr.startOcr('./images/text.png', 'LANG_ENGLISH')
.then((result) => {
console.log("OCR Result: ", result);
})
.catch((err) => {
console.log("OCR Error: ", err);
})
.done();

Any suggestions?

Use this project to license plate recognition

Hi!

I need to develop a module in React Native that does license plate recognition. I'm from Brazil. Can i use this project to do this? My input is a photo from an android device.

sorry my bad English,
Thanks :)

Error : Data path does not exist

What this can happened ?

this is my code

takePicture = async function() { if (this.camera) { const options = { quality: 0.5, base64: true }; const data = await this.camera.takePictureAsync(options) console.log(data.uri); this.setState({path: data.uri}); const tessOptions = { whitelist: null, blacklist: '1234567890\'!"#$%&/()={}[]+*-_:;<>' }; RNTesseractOcr.recognize(data.uri, 'LANG_ENGLISH', tessOptions) .then((result) => { // this.setState({ ocrResult: result }); console.log("OCR Result: ", result); }) .catch((err) => { console.log("OCR Error: ", err); }) .done(); } };

this is the error

OCR Error: Error: Data path does not exist!
at createErrorFromErrorData (D:\React Native\alternote\node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:121)
at D:\React Native\alternote\node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:78
at MessageQueue.__invokeCallback (D:\React Native\alternote\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:398)
at D:\React Native\alternote\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:137
at MessageQueue.__guardSafe (D:\React Native\alternote\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:314)
at MessageQueue.invokeCallbackAndReturnFlushedQueue (D:\React Native\alternote\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:136)
at debuggerWorker.js:70

i put my tess data in src/main/assets/tessdata but not working

cannot read property 'recognize' of undefine in ios

Screenshot at May 06 13-01-55

this error shows after selecting the image on the library.
in android is work fine but in ios throw this error.

extractText(imgPath) {
console.log('image---->>>>>>', imgPath)
Ocr.recognize(imgPath, 'LANG_ENGLISH', tessOptions)
.then((res) => this.setState({ text: res }));
console.log('text', res)
}

my app Crashed EveryTime I Use RNTesseractOcr.recognize

my app Crashed EveryTime I Use RNTesseractOcr.recognize.
this is my code:

ImagePicker.openCamera({
		cropping: false,
		compressImageMaxWidth: 1600,
	}).then(image => {
		console.log(image);
		const imagePath = image.path;
		this.setState({ 
			url: imagePath
		});
		const tessOptions = {
			whitelist: null, 
			blacklist: '1234567890\'!"#$%&/()={}[]+*-_:;<>'
		  };
		  path = imagePath.replace('file://', '');
		  console.log('data path', path);
		  RNTesseractOcr.recognize(path, 'LANG_ENGLISH', tessOptions)
			.then((result) => {
			  this.setState({ ocrResult: result });
			  console.log("OCR Result: ", result);
			})
			.catch((err) => {
			  console.log("OCR Error: ", err);
			})
			.done();
			
	}).catch(e => {
		console.log(e);
	});

OCR Example App

hi,
i tried to run the example app. I take a photo, but the spinner is always loading. It doesnt get ready. Why?

Working with Expo

Does this project or will this project work with Expo? I'm building my app in Expo and the setup guide says I need to add things in xCode and the Android Manifest file. I'm not familiar with that process since I use Expo so I'm curious if this does or will work with Expo in the future. Thanks!

Error: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference

Running on Android 6.0.1 I get the above error

OCR Error:  Error: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference

when invoking

            RNTesseractOcr.startOcr(data["path"], "eng")
            .then((result) => {
                console.log("OCR Result: ", result);
            })
            .catch((err) => {
                console.log("OCR Error: ", err);
            })
            .done();

my data object looks like this

{path: "file:///data/user/0/com.scanocr/cache/IMG_20170914_1521561881209554.jpg"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.