Need help with CVScanner?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

Credntia
134 Stars 47 Forks GNU General Public License v3.0 69 Commits 6 Opened issues

Description

An OpenCV based library for Android to scan ID documents or Passports.

Services available

!
?

Need anything else?

Contributors list

# 154,963
CVScanner 134 Java top 10

CVScanner

An OpenCV based library for Android to scan/crop ID documents or Passports.

Usage

Automatic Crop

The easiest way is to launch the

DocumentScannerActivity
CVScanner.startScanner(this, isPassport, REQ_SCAN);

You'll get the path of the scanned image in

onActivityResult(int requestCode, int resultCode, Intent data)
if(requestCode == REQ_SCAN && resultCode == RESULT_OK){
  String path = data.getStringExtra(CVScanner.RESULT_IMAGE_PATH);
}

You can use the

DocumentScannerFragment
too
Fragment fragment = DocumentScannerFragment.instantiate(isScanningPassport);
getSupportFragmentManager().beginTransaction()
        .add(R.id.container, fragment)
        .commit();

The host Activity should implement

ImageProcessorCallback
to get scanning results.

Manual Crop

The easiest way is to launch the

CropImageActivity
CVScanner.startManualCropper(this, currentPhotoUri, REQ_CROP_IMAGE);

You'll get the path to the scanned image in

onActivityResult
if(requestCode == REQ_CROP_IMAGE && resultCode == RESULT_OK){
  String path = data.getStringExtra(CVScanner.RESULT_IMAGE_PATH);
}

You can use the

ImageCropperFragment
too
Fragment fragment = ImageCropperFragment.instantiate(imageUri);
getSupportFragmentManager().beginTransaction()
    .add(R.id.container, fragment)
    .commit();

The host Activity should implement

ImageProcessorCallback
to get cropping results.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.