├── .gitignore ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── android │ │ └── guocheng │ │ └── easypr │ │ └── MainActivity.java │ └── res │ ├── layout │ └── activity_main.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ ├── mipmap-xxxhdpi │ └── ic_launcher.png │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradlew ├── gradlew.bat ├── libEasyPR ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ ├── aiseminar │ │ └── EasyPR │ │ │ └── PlateRecognizer.java │ │ └── fosung │ │ └── libeasypr │ │ ├── EasyPrBiz.java │ │ ├── EasyPrPath.java │ │ ├── util │ │ ├── BitmapUtil.java │ │ ├── CameraManager.java │ │ ├── FileUtil.java │ │ ├── FlashLightUtils.java │ │ └── ScreenUtil.java │ │ └── view │ │ ├── EasyPRPreSurfaceView.java │ │ ├── EasyPRPreView.java │ │ └── EasyPRPreViewMaskLayer.java │ ├── jniLibs │ ├── arm64-v8a │ │ ├── libEasyPR.so │ │ └── libopencv_java3.so │ ├── armeabi-v7a │ │ ├── libEasyPR.so │ │ └── libopencv_java3.so │ ├── armeabi │ │ ├── libEasyPR.so │ │ └── libopencv_java3.so │ ├── mips │ │ ├── libEasyPR.so │ │ └── libopencv_java3.so │ ├── mips64 │ │ ├── libEasyPR.so │ │ └── libopencv_java3.so │ ├── x86 │ │ ├── libEasyPR.so │ │ └── libopencv_java3.so │ └── x86_64 │ │ ├── libEasyPR.so │ │ └── libopencv_java3.so │ └── res │ ├── raw │ ├── easypr_ann.xml │ └── easypr_svm.xml │ └── values │ └── easypr_colors.xml └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EasyPRForAndroid 2 | 车牌识别库EasyPR移植Android版本。
3 | 基于OpenCV开源库,使用Android Studio进行构建。 4 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "25.0.2" 6 | defaultConfig { 7 | applicationId "com.android.guocheng.easypr" 8 | minSdkVersion 15 9 | targetSdkVersion 22 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(include: ['*.jar'], dir: 'libs') 24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 25 | exclude group: 'com.android.support', module: 'support-annotations' 26 | }) 27 | compile 'com.android.support:appcompat-v7:25.3.1' 28 | testCompile 'junit:junit:4.12' 29 | compile project(':libEasyPR') 30 | } 31 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/android/guocheng/easypr/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.android.guocheng.easypr; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.view.View; 6 | import android.widget.Button; 7 | import android.widget.TextView; 8 | import android.widget.Toast; 9 | import com.fosung.libeasypr.view.EasyPRPreSurfaceView; 10 | import com.fosung.libeasypr.view.EasyPRPreView; 11 | 12 | public class MainActivity extends AppCompatActivity { 13 | 14 | private EasyPRPreView easyPRPreView; 15 | private Button btnShutter; 16 | private TextView text; 17 | 18 | @Override 19 | protected void onCreate(Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | setContentView(R.layout.activity_main); 22 | 23 | easyPRPreView = (EasyPRPreView) findViewById(R.id.preSurfaceView); 24 | btnShutter = (Button) findViewById(R.id.btnShutter); 25 | text = (TextView) findViewById(R.id.text); 26 | initListener(); 27 | } 28 | 29 | @Override 30 | protected void onStart() { 31 | super.onStart(); 32 | if (easyPRPreView != null) { 33 | easyPRPreView.onStart(); 34 | } 35 | } 36 | 37 | @Override 38 | protected void onStop() { 39 | super.onStop(); 40 | if (easyPRPreView != null) { 41 | easyPRPreView.onStop(); 42 | } 43 | } 44 | 45 | @Override 46 | protected void onDestroy() { 47 | super.onDestroy(); 48 | if (easyPRPreView != null) { 49 | easyPRPreView.onDestroy(); 50 | } 51 | } 52 | 53 | private void initListener() { 54 | easyPRPreView.setRecognizedListener(new EasyPRPreSurfaceView.OnRecognizedListener() { 55 | @Override 56 | public void onRecognized(String result) { 57 | if (result == null || result.equals("0")) { 58 | Toast.makeText(MainActivity.this, "换个姿势试试!", Toast.LENGTH_SHORT).show(); 59 | } else { 60 | Toast.makeText(MainActivity.this, "识别成功", Toast.LENGTH_SHORT).show(); 61 | text.setText(result); 62 | } 63 | } 64 | }); 65 | btnShutter.setOnClickListener(new View.OnClickListener() { 66 | @Override 67 | public void onClick(View view) { 68 | easyPRPreView.recognize();//开始识别 69 | } 70 | }); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 |