Skip to content

maxmx911/android-camera2-preview-qr-code-scanner

 
 

Repository files navigation

android-camera2-preview-qr-code-scanner

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.

Android QR Code Scanner

Features

  • Camera preview
  • QR code scanning by Dynamsoft Barcode Reader
  • Result overlay
  • Auto-torch
  • Zoom by fingers
  • QR code detection by YOLO tiny

How to Enable QR Code Scan

Apply for a valid license key to activate Dynamsoft Barcode Reader:

BarcodeReader.initLicense(
"DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==",
    new DBRLicenseVerificationListener() {
        @Override
        public void DBRLicenseVerificationCallback(boolean isSuccessful, Exception e) {
        }
    });

How to Get Camera Frames to Do Image Processing

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
}

Blog

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 59.8%
  • Java 34.6%
  • C 3.8%
  • CMake 1.4%
  • Objective-C 0.1%
  • HTML 0.1%
  • Other 0.2%