项目作者: BrandonVargas

项目描述 :
Implementación de Mobile Vision en Android para extraer información de identificaciones mexicanas (IFE/INE)
高级语言: Java
项目地址: git://github.com/BrandonVargas/AndroidOCRFforID.git
创建时间: 2017-02-25T03:03:23Z
项目社区:https://github.com/BrandonVargas/AndroidOCRFforID

开源协议:Apache License 2.0

下载


AndroidOCRFforID

Implementación de Mobile Vision en Android para extraer información de identificaciones mexicanas (IFE/INE)

Configuración

File -> New -> Import Module,seleccionar el modulo OCR de este proyecto, se agrega automaticamente uCrop

File -> Project Structure -> Modules/app -> Pestaña Dependencias -> + -> Module dependency -> :ocr

Añadir al Manifest

  1. <activity
  2. android:name="mx.brandonvargas.ocrforid.OcrIdActivity"
  3. android:screenOrientation="portrait"
  4. android:theme="@style/AppTheme.NoActionBar"
  5. ></activity>
  6. <activity
  7. android:name="com.yalantis.ucrop.UCropActivity"
  8. android:screenOrientation="portrait"
  9. android:theme="@style/AppTheme.NoActionBar"
  10. ></activity>

Y añadir a styles

  1. <style name="AppTheme.NoActionBar">
  2. <item name="windowActionBar">false</item>
  3. <item name="windowNoTitle">true</item>
  4. <item name="android:windowBackground">@android:color/white</item>
  5. <item name="android:windowDrawsSystemBarBackgrounds">true</item>
  6. <item name="android:statusBarColor">@color/colorPrimary</item>
  7. </style>

Obteniendo la información

Para iniciar el OCR

  1. startActivityForResult(new Intent(MainActivity.this, OcrIdActivity.class),OCR_REQUEST);

Para recuperar los datos

  1. @Override
  2. public void onActivityResult(int requestCode, int resultCode, Intent data) {
  3. super.onActivityResult(requestCode, resultCode, data);
  4. Bundle extras = data.getExtras();
  5. if(resultCode == Activity.RESULT_OK && requestCode == OCR_REQUEST && extras!=null){
  6. Boolean is_ine = extras.getBoolean("IS_INE");
  7. String name = extras.getString("NAME");
  8. String lastName = extras.getString("LAST_NAME");
  9. String motherLastName = extras.getString("M_LAST_NAME");
  10. String curp = extras.getString("CURP");
  11. String address = extras.getString("ADDRESS");
  12. String elector = extras.getString("ELECTOR");
  13. String state = extras.getString("STATE");
  14. String town = extras.getString("TOWN");
  15. String section = extras.getString("SECTION");
  16. String id = extras.getString("ID");
  17. Uri uri1 = Uri.parse(extras.getString("URI1"));
  18. Uri uri2 = Uri.parse(extras.getString("URI2"));
  19. }
  20. }

To Do

  • Mejorar Algoritmos de detección
  • Mejorar Algortimo para tomar foto y recortar
  • Resolver problemas con smartphones Samsung

Bibliotecas de terceros

Licencia/License

Copyright [2017] [Brandon Vargas]

Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  1. http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.