2

I need my app to read text via Camera. I know there's the Tesseract library which does this, but I'd really prefer if there was an app that can handle Intents to read text via Camera, like Xzing does for reading QR codes.

Is there such an app?

2 Answers 2

1

There isn't currently an app on Google Play that does this.

I've thought about making one, but the possible use cases for such an app vary much more than for, say, scanning a QR code. There are different possible scenarios:

  • License plate recognition
  • Recognition for LCD 7-segment displays
  • Korean OCR
  • OCR for stylized text
  • OCR with shadows or uneven illumination

The different scenarios present a challenge for how to handle the image. A request to such an app via Intent would probably need to specify at least the type of thresholding to use for pre-processing the image along with the language/traineddata file to use.

1
  • I just want to recognize a written hour such as "19:45" or such. I've done my own implementation, but it'd be nice to have a standard implementation such as XZing on QR codes. Sep 17, 2012 at 7:13
0

I've just created an app that takes a photo using the Camera, crop the photo, and return the recognized text as result.

In your app, you may use the following code:

    PackageManager pm = getPackageManager();
    try {
        pm.getPackageInfo("sunbulmh.ocr", PackageManager.GET_ACTIVITIES);

        Intent LaunchIntent = pm.getLaunchIntentForPackage("sunbulmh.ocr");
        LaunchIntent.setFlags(0);
        startActivityForResult(LaunchIntent,5);

    } catch (NameNotFoundException e) {
        Uri URLURI = Uri.parse("http://play.google.com/store/apps/details?id=sunbulmh.ocr");
        Intent intent = new Intent(Intent.ACTION_VIEW,URLURI);
        startActivity(intent);
    }

Then, get the result in onActivityResult():

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {

    if (resultCode == RESULT_OK) {
        if(requestCode == 5){
            String ocr_txt = data.getStringExtra(Intent.EXTRA_TEXT);
            // ocr_txt contains the recognized text.




        }
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.