Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Installation/Setup Process of Plugin #14

Open
zindelluib opened this issue Dec 2, 2016 · 6 comments
Open

Update Installation/Setup Process of Plugin #14

zindelluib opened this issue Dec 2, 2016 · 6 comments

Comments

@zindelluib
Copy link

Can you update the installation/setup process directions in the ReadMe sir @gustavomazzoni . I hope you can have a new instruction of using this plugin with the "LATEST" ionic version

@one-geek
Copy link

Work for me:

  1. Download or clone the cordova-plugin-tesseract and install it
    $ git clone https://github.com/gustavomazzoni/cordova-plugin-tesseract
    $ ionic plugin add path-to-your/cordova-plugin-tesseract

  2. Refresh platform folders
    $ ionic platform rm android
    $ ionic platform add android

// Follow all gustavomazzoni steps, but 2.3
2.3 Edit your-project/platforms/android/build.gradle file and add 'tess-two' like this

Original Recommantion at original tess-two github (https://github.com/rmtheis/tess-two) is

dependencies {
// SUB-PROJECT DEPENDENCIES END
compile 'com.rmtheis:tess-two:6.1.1'
}

instead of ...

dependencies {
// SUB-PROJECT DEPENDENCIES END
compile project(':tess-two')
}

2.4 Forget this shity step

// If it build, everything good :)
$ ionic build android

// Then, dont forget the code

    $scope.testScanOCR = function() {

        var language = 'eng'; //fra

        TesseractPlugin.loadLanguage(language, function(response) {
            console.log('language', response);
        }, function(reason) {
            console.log('Error on loading OCR file for your language. ' + reason);
        });
        
    
        cordovaService.takePicture().then(function (imageData) {
            if (!imageData){
                return;
            }

			$timeout(function() {
				TesseractPlugin.recognizeText(imageData, language, function(recognizedText) {
					alert(recognizedText);
				}, function(reason) {
					console.log('Error on recognizing text from image. ' + reason);
				});
			}, 200);

        });
    }

2.5
$ ionic run android

@zindelluib
Copy link
Author

thank you @Guerson . I just want to ask you sir. Do you have a simple working app using this plugin? Can I have a copy of it.It will be very helpful to me if you can give . I will put your name as a credit for your help in our project

@one-geek
Copy link

No i dont have this kind of project.

But, after I testing "cordova-plugin-tesseract with tess-two" for android and "cordova-plugin-tesseract with CocoaPods" with IOS.
I can assure you that your are not missing anything Good about this plugin.
It is not so good.
I'm looking for something more powerfull like the native app on Play Store : OCR textScanner, Text Fairy, etc.

But sadly, their are not Cordova apps :(

@filimo
Copy link

filimo commented Jan 13, 2017

@zindelluib I've made test app for android. You can try it(https://github.com/filimo/tesseract-ocr-cordova.git).

@marko1943
Copy link

marko1943 commented Feb 13, 2017

It builds succesfully following what guerson said, just check the latest tess-two project you're including on their official doc https://github.com/rmtheis/tess-two

At the time of writting this, you have to

    // SUB-PROJECT DEPENDENCIES END
    compile 'com.rmtheis:tess-two:6.2.0'

by the way, tesseract is not bad, you just have to train it

@marko1943
Copy link

marko1943 commented Feb 14, 2017

Also, you can skip the steps of downloading tess-two library and editing anything:

  1. Just grab and install the plugin.
  2. Insert tess-two as sub-project dependency (as above)

Good to go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants