High performance license plate recognition based on deep learning HyperLPR Android SDK implementation.
If you need to learn about the build steps in the source code of the project, you can go : HyperLPR.
- Android: arm64-v8a、armeabi-v7a
Add Jitpack dependencies to your Gradle configuration
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add dependencies in build.gradle for projects where you need hyperlpr
dependencies {
implementation 'com.github.HyperInspire:hyperlpr3-android-sdk:1.0.3'
}
Before implementing the license plate recognition algorithm, the initialization function needs to be executed, and the storage read and write permissions need to be opened in advance. Initialization is performed only once, usually when the program is started.
// License plate recognition algorithm configuration parameters
HyperLPRParameter parameter = new HyperLPRParameter()
.setDetLevel(HyperLPR3.DETECT_LEVEL_LOW)
.setMaxNum(1)
.setRecConfidenceThreshold(0.85f);
// Initialization (performed only once)
HyperLPR3.getInstance().init(this, parameter);
Bitmap is used as an example for license plate recognition
// Use Bitmap as picture parameter for license plate recognition
Plate[] plates = HyperLPR3.getInstance().plateRecognition(bitmap, HyperLPR3.CAMERA_ROTATION_0, HyperLPR3.STREAM_BGRA);
for (Plate plate: plates) {
// Print the detected license plate number
Log.i(TAG, plate.getCode());
}
License plate recognition using camera stream or file stream
// License plate recognition using a stream of NV21
Plate[] plates = HyperLPR3.getInstance().plateRecognition(data, previewSize.height, previewSize.width, HyperLPR3.CAMERA_ROTATION_270, HyperLPR3.STREAM_YUV_NV21);
The Android-SDK of hyperlpr is currently in the testing phase. If you encounter any problems during use, please raise your questions in issues. PR welcome.