London Escorts sunderland escorts 1v1.lol unblocked yohoho 76 https://www.symbaloo.com/mix/yohoho?lang=EN yohoho https://www.symbaloo.com/mix/agariounblockedpvp https://yohoho-io.app/ https://www.symbaloo.com/mix/agariounblockedschool1?lang=EN
3.7 C
New York
Monday, February 24, 2025

Simply add doc scanning functionality to your app with ML Equipment Doc Scanner API


Posted by Thomas Ezan – Sr. Developer Relations Engineer; Chengji Yan, Penny Li – ML Equipment Engineers; David Miro Llopis – Product Supervisor

We’re excited to announce the launch of the ML Equipment Doc Scanner API. This new API makes it straightforward so as to add superior doc scanning capabilities with a high-quality and constant person interface to your Android app. The ML Equipment Doc Scanner API permits your customers to shortly and simply digitize paper paperwork.

Like the opposite ML Equipment APIs, the ML Equipment Doc Scanner API lets you seamlessly combine options powered by Machine Studying (ML) with none ML data.

ml kit document scanner illustration

Why Doc Scanner SDK?

Regardless of the digital revolution, paper paperwork and printouts are nonetheless current in our on a regular basis life. A few of our most vital paperwork are nonetheless bodily (id paperwork, receipts, and so forth.).

The ML Equipment Doc Scanner API affords an a variety of benefits, together with:

    • A high-quality and constant person interface for digitizing bodily paperwork.
    • Correct doc detection with exact nook and edge detection for a seamless scanning expertise and optimum scanning outcomes.
    • Versatile performance permits customers to crop scanned paperwork, apply filters, take away fingers, take away stains and different blemishes and ship digitized information in PDF and JPEG codecs again to your app.
    • On-device processing helps protect privateness.
    • An entire resolution eliminating the necessity for digital camera permission.

The ML Equipment Doc Scanner API is already utilized by Google Drive Android utility and the Google Pixel Digital camera.

moving image showing ML Kit Document scanner API in action in  
Google Drive

ML Equipment Doc scanner API in motion in
Google Drive

Get began

The ML Equipment Doc Scanner API requires Android API degree 21 or above. The fashions, scanning logic, and UI circulation are dynamically downloaded through Google Play providers so the ML Equipment Doc Scanner API has a minimal affect in your app measurement.

To combine it in your app, begin by configuring the scanner choices and getting a scanner shopper:

val choices = GmsDocumentScannerOptions.Builder()
    .setGalleryImportAllowed(false)
    .setPageLimit(2)
    .setResultFormats(RESULT_FORMAT_JPEG, RESULT_FORMAT_PDF)
    .setScannerMode(SCANNER_MODE_FULL)
    .construct()
val scanner = GmsDocumentScanning.getClient(choices)

Then register an ActivityResultCallback to obtain the scanning outcomes:

val scannerLauncher = registerForActivityResult(StartIntentSenderForResult()) {
  end result -> {
    if (end result.resultCode == RESULT_OK) {
      val end result =
        GmsDocumentScanningResult.fromActivityResultIntent(end result.information)
      end result.getPages()?.let { pages ->
        for (web page in pages) {
          val imageUri = web page.getImageUri()
        }
      }
      end result.getPdf()?.let { pdf ->
        val pdfUri = pdf.getUri()
        val pageCount = pdf.getPageCount()
      }
    }
  }
}

Lastly launch the doc scanner exercise:

scanner.getStartScanIntent(exercise)
  .addOnSuccessListener { intentSender ->   
    scannescannerrLauncher.launch(IntentSenderRequest.Builder(intentSender).construct())
  }
  .addOnFailureListener { ... }

To get began with the ML Equipment Doc Scanner API, go to the documentation. We will’t wait to see what you’ll construct with it!

Related Articles

Social Media Auto Publish Powered By : XYZScripts.com