搜尋套件、儲存庫與 APP 分類

套件詳情v0.2.3

ml_card_scanner

用於掃描銀行信用卡的套件。

AndroidiOS
近 30 天下載
185
喜歡數
29
Pub 分數
100

安裝套件

flutter pub add ml_card_scanner

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個專為使用機器學習掃描銀行卡和信用卡而設計的Flutter套件。它提供了一個使用者友善的介面,可從影像中擷取卡片資訊,自動偵測卡片類型、卡號、到期日與持卡人姓名。此套件適用於Android與iOS,利用裝置端處理以確保隱私與速度。該套件可無縫整合至需要快速提取卡片資料的支付或金融應用中。

適用情境

  • 行動應用程式中的信用卡資料輸入
  • 自動卡資訊捕獲
  • 付款表單預填
  • 金融應用入門
  • 銀行服務的文件掃描

主要特色

  • 設備端基於機器學習的卡片檢測
  • 支援主要卡片類型(Visa、Mastercard 等)
  • 即時卡欄位識別
  • 注重隱私,無雲端處理
  • 透過 Flutter 外掛實現簡單整合

適合對象

  • 行動銀行應用程式
  • 電子商務結帳流程
  • 費用追蹤工具
  • 卡片管理平台
  • 需要快速卡片輸入的應用程式

使用建議

  • Android 與 iOS 需要相機權限
  • 效能可能在舊裝置上有所差異
  • 使用清晰、光線充足的卡片影像可獲得最佳效果
  • 限於標準卡格式
  • 可能需要校準非標準卡牌設計

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

ml_ card_scanner

The ml_card_scanner plugin allows you to scan bank cards.

Features

  • Can scan expiration date, card type and card number
  • Work with horizontal and vertical cards
  • Powered by Google's Machine Learning models
  • Great performance and accuracy
  • Fully offline scan makes it a completely secure scanner.
Warning: This package does not guarantee 100% 
accurate scanning of card details, 
so always give users the opportunity 
to check and modify the data before using it.

Prepare

###Android

  1. Add these to android/grade.properties file:
android.useAndroidX=true
android.enableJetifier=true
  1. In android/app/build.gradle file:
android {
  compileSdkVersion 31 // Set this to at least 31
  minSdkVersion 21 // at least 21
  ...
}
  1. Add the permission to android/app/src/main/AndroidManifest.xml file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  <uses-permission android:name="android.permission.CAMERA"/> 
  ...
 </manifest>

###iOS

Add to ios/Runner/Info.plist file:

<key>NSCameraUsageDescription</key>
<string>Your Description</string>

Add this lines to the top of your Podfile:

# Uncomment this line to define a global platform for your project
 platform :ios, '10.0'

And add the following to end of your Podfile file:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      ... # Here are some configurations automatically generated by flutter

      # You can enable the permissions needed here. For example to enable camera
      # permission, just remove the `#` character in front so it looks like this:
      #
      # ## dart: PermissionGroup.camera
      # 'PERMISSION_CAMERA=1'
      #
      #  Preprocessor definitions can be found in: https://github.com/Baseflow/flutter-permission-handler/blob/master/permission_handler/ios/Classes/PermissionHandlerEnums.h
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
        '$(inherited)',

       
        ## dart: PermissionGroup.camera
         'PERMISSION_CAMERA=1',

        ]

    end
  end
end

Usage

Just import the package and call ml_card_scanner an use ScannerWidget in your code:

ScannerWidget(controller: _controller)

Also ScannerWidget have another parameter you can specify:

  • overlayBuilder - set your overlay widget or specify null to use the default;
  • overlayTextBuilder - set your widget or specify null to use the default;
  • cameraPreviewBuilder - set your widget constraints for CameraPreview or specify null to use the default;
  • scannerDelay - set the scan delay or not set to use the default 400 (interval between card scannings in millisecconds);
  • oneShotScanning - set to false - the scan will run continuously, true -scaninng will stop after card detected;
  • overlayOrientation - set the default overlay orientation, by default portrait;
  • cameraResolution - resolution preset for camera, by default high;
  • controller - ScannerWidgetController widget controller to get scanned card details or error;
  • cardScanTries - how many recognition varians to collect before provide scanning result;
  • usePreprocessingFilters - applying built in preprocessing filters to improve recognition quality; would slow down the recognition process, but improve the quality;

See example/lib/ml_card_scanner.dart for implementation.

For ScannerWidgetController have functionality:

  • enable or disable scanning;
  • enable or disable camera preview;
  • set onCardScanned callback;
  • set onError callback;

Example Output :

Number card: 5173949390587465
Type: Master Card
Expiry: 10/24

所屬分類

依賴

依賴清單 5 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。