This is a skeleton project that demonstrates how to implement a basic Android camera preview by using CameraX and Dynamsoft Camera Enhancer respectively. The project also features QR code scan. You can replace this part with other image processing code.
- Camera preview
- QR code scanning by Dynamsoft Barcode Reader
- Result overlay
- Auto-torch
- Zoom by fingers
- QR code detection by YOLO tiny
Apply for a valid license key to activate Dynamsoft Barcode Reader:
BarcodeReader.initLicense(
"DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==",
new DBRLicenseVerificationListener() {
@Override
public void DBRLicenseVerificationCallback(boolean isSuccessful, Exception e) {
}
});
CameraX
analysisUseCase.setAnalyzer(cameraExecutor,
imageProxy -> {
// image processing
Log.i(TAG, "image processing.................");
// image processing
// Must call close to keep receiving frames.
imageProxy.close();
});
Dynamsoft Camera Enhancer
@Override
public void frameOutputCallback(DCEFrame dceFrame, long l) {
// image processing
Log.i(TAG, "image processing.................");
// image processing
}