Skip to content
paolo8417Public
forked from Credntia/CVScanner

About

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

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

69 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages