How to extract only selected text fields from image with OCR in android [on hold]











up vote
0
down vote

favorite












Am new to android programming i have developed one application in which i need to extract text from image/scanned image etc. i achieved that using Google OCR api below is the sample code.



In my case i want to extract only name, email,mobile, address etc, how can i achieve that can anyone please look into it and also is it possible to extract telugu language text?



Here is my sample code.



This code is for getting text from image using OCR.



@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.actionCamera:
OCRCapture.Builder(this)
.setUseFlash(false)
.setAutoFocus(true)
.buildWithRequestCode(CAMERA_SCAN_TEXT);
break;
case R.id.actionPhoto:
if (hasPermission()) {
pickImage();
} else {
getPermission();
}
break;
}
return super.onOptionsItemSelected(item);
}


And this code is to display the extracted text on ActivityResult:



@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (data != null) {
if (requestCode == CAMERA_SCAN_TEXT) {
if (resultCode == CommonStatusCodes.SUCCESS) {
textView.setText(data.getStringExtra(TextBlockObject));
}
} else if (requestCode == LOAD_IMAGE_RESULTS) {
Uri pickedImage = data.getData();
String text = OCRCapture.Builder(this).getTextFromUri(pickedImage);
textView.setText(text);
}
}
}









share|improve this question













put on hold as too broad by rmtheis, Cindy Meister, Ron Srebro, EdChum, Gerhard Barnard Nov 12 at 11:19


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.



















    up vote
    0
    down vote

    favorite












    Am new to android programming i have developed one application in which i need to extract text from image/scanned image etc. i achieved that using Google OCR api below is the sample code.



    In my case i want to extract only name, email,mobile, address etc, how can i achieve that can anyone please look into it and also is it possible to extract telugu language text?



    Here is my sample code.



    This code is for getting text from image using OCR.



    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.actionCamera:
    OCRCapture.Builder(this)
    .setUseFlash(false)
    .setAutoFocus(true)
    .buildWithRequestCode(CAMERA_SCAN_TEXT);
    break;
    case R.id.actionPhoto:
    if (hasPermission()) {
    pickImage();
    } else {
    getPermission();
    }
    break;
    }
    return super.onOptionsItemSelected(item);
    }


    And this code is to display the extracted text on ActivityResult:



    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (data != null) {
    if (requestCode == CAMERA_SCAN_TEXT) {
    if (resultCode == CommonStatusCodes.SUCCESS) {
    textView.setText(data.getStringExtra(TextBlockObject));
    }
    } else if (requestCode == LOAD_IMAGE_RESULTS) {
    Uri pickedImage = data.getData();
    String text = OCRCapture.Builder(this).getTextFromUri(pickedImage);
    textView.setText(text);
    }
    }
    }









    share|improve this question













    put on hold as too broad by rmtheis, Cindy Meister, Ron Srebro, EdChum, Gerhard Barnard Nov 12 at 11:19


    Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Am new to android programming i have developed one application in which i need to extract text from image/scanned image etc. i achieved that using Google OCR api below is the sample code.



      In my case i want to extract only name, email,mobile, address etc, how can i achieve that can anyone please look into it and also is it possible to extract telugu language text?



      Here is my sample code.



      This code is for getting text from image using OCR.



      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
      switch (item.getItemId()) {
      case R.id.actionCamera:
      OCRCapture.Builder(this)
      .setUseFlash(false)
      .setAutoFocus(true)
      .buildWithRequestCode(CAMERA_SCAN_TEXT);
      break;
      case R.id.actionPhoto:
      if (hasPermission()) {
      pickImage();
      } else {
      getPermission();
      }
      break;
      }
      return super.onOptionsItemSelected(item);
      }


      And this code is to display the extracted text on ActivityResult:



      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
      if (data != null) {
      if (requestCode == CAMERA_SCAN_TEXT) {
      if (resultCode == CommonStatusCodes.SUCCESS) {
      textView.setText(data.getStringExtra(TextBlockObject));
      }
      } else if (requestCode == LOAD_IMAGE_RESULTS) {
      Uri pickedImage = data.getData();
      String text = OCRCapture.Builder(this).getTextFromUri(pickedImage);
      textView.setText(text);
      }
      }
      }









      share|improve this question













      Am new to android programming i have developed one application in which i need to extract text from image/scanned image etc. i achieved that using Google OCR api below is the sample code.



      In my case i want to extract only name, email,mobile, address etc, how can i achieve that can anyone please look into it and also is it possible to extract telugu language text?



      Here is my sample code.



      This code is for getting text from image using OCR.



      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
      switch (item.getItemId()) {
      case R.id.actionCamera:
      OCRCapture.Builder(this)
      .setUseFlash(false)
      .setAutoFocus(true)
      .buildWithRequestCode(CAMERA_SCAN_TEXT);
      break;
      case R.id.actionPhoto:
      if (hasPermission()) {
      pickImage();
      } else {
      getPermission();
      }
      break;
      }
      return super.onOptionsItemSelected(item);
      }


      And this code is to display the extracted text on ActivityResult:



      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
      if (data != null) {
      if (requestCode == CAMERA_SCAN_TEXT) {
      if (resultCode == CommonStatusCodes.SUCCESS) {
      textView.setText(data.getStringExtra(TextBlockObject));
      }
      } else if (requestCode == LOAD_IMAGE_RESULTS) {
      Uri pickedImage = data.getData();
      String text = OCRCapture.Builder(this).getTextFromUri(pickedImage);
      textView.setText(text);
      }
      }
      }






      android ocr image-recognition






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 8 at 10:48









      santosh nani

      297




      297




      put on hold as too broad by rmtheis, Cindy Meister, Ron Srebro, EdChum, Gerhard Barnard Nov 12 at 11:19


      Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






      put on hold as too broad by rmtheis, Cindy Meister, Ron Srebro, EdChum, Gerhard Barnard Nov 12 at 11:19


      Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.































          active

          oldest

          votes






















          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes

          Popular posts from this blog

          Schultheiß

          Verwaltungsgliederung Dänemarks

          Liste der Kulturdenkmale in Wilsdruff