패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.7.0

mlkit_scanner

iOS 및 안드로이드용 Google MLKit API를 사용하여 바코드, 텍스트, 얼굴 및 객체를 감지하는 플러터 플러그인

AndroidiOS
30일 다운로드
321
좋아요
50
Pub 점수
150

패키지 설치

flutter pub add mlkit_scanner

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Android 및 iOS에서 바코드, 텍스트, 얼굴 및 객체 감지를 가능하게 하는 Google MLKit를 활용한 플러터 플러그인입니다. 강력한 디바이스 기반 머신 러닝 기능을 플러터 애플리케이션에 쉽게 통합할 수 있도록 간단한 인터페이스를 제공합니다. 실시간 스캔 및 처리를 지원하여 시각 데이터의 빠르고 정확한 인식이 필요한 앱에 적합합니다. 네이티브 성능을 고려해 설계되었으며, 장치 내에서 직접 실행되는 최적화된 모델을 사용하여 낮은 지연 시간과 높은 정확도를 보장합니다.

사용 사례

  • 소매 앱에서의 바코드 스캔
  • 이미지에서 텍스트 추출
  • 사진 앱에서의 얼굴 탐지
  • 증강 현실에서의 객체 인식
  • 실시간 문서 스캔
  • 자동 데이터 입력

주요 기능

  • 여러 가지 탐지 유형을 지원
  • 개인 정보 보호를 위한 디바이스 내 처리
  • 실시간 스캔
  • 크로스 플랫폼 호환성
  • 간단한 API 통합
  • MLKit와 함께 높은 정확도

적합한 대상

  • 시각 인식이 필요한 모바일 앱
  • 오프라인 기능을 찾는 개발자
  • 빠른 반응 시간이 필요한 응용 프로그램
  • 사용자 프라이버시를 우선시하는 프로젝트
  • 크로스 플랫폼 개발을 위해 플러터를 사용하는 팀

고려 사항

  • 전체 기능을 사용하려면 네이티브 SDK 설정이 필요합니다
  • Android 및 iOS 플랫폼에 한정
  • Google MLKit 업데이트에 따라 다릅니다
  • 통합된 모델로 인해 앱 크기가 증가할 수 있습니다
  • 오래된 기기에서는 성능이 다를 수 있습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

MLKit Scanner

A Flutter plugin to detect barcodes, text, faces, and objects using Google MLKit API for iOS and Android

This Plugin uses Android CameraView library and iOS AVFoundation APIs for detecting objects from device's camera.

Note: This plugin is under development, and some APIs might not be available yet.

Features:

  • Display camera preview in a widget.
  • Set size of the camera preview.
  • Set overlay for camera preview.
  • Set area for detect object.
  • Pause/Resume camera preview.
  • Toogle device flash.
  • Set a preview scale
  • Use camera Zoom
  • Lock autofocus
Google MLKit APIs: Android iOS
Barcode scanning ✅ ✅
------------------------ - -

Installation

First, add mlkit_scanner as a dependency in your pubspec.yaml.

iOS

iOS 11.0 of higher is needed to use the camera plugin.

Add key to the ios/Runner/Info.plist:

<key>NSCameraUsageDescription</key>
<string>...description...</string>
Android

Change the minimum Android sdk version to 21 (or higher) in your android/app/build.gradle file.

minSdkVersion 21
Example
import 'package:mlkit_scanner/mlkit_scanner.dart';

...

return SizedBox(
  height: 200.0                                 // CameraPreview needs height constraints, if you use widget 
                                                // in Column use SizedBox or Container with height.
  child: BarcodeScanner(
    cropOverlay: ScannerCropOverlay             // you can use default ScannerOverlay, create custom, or do not 
                                                // use it at all

    onScannerInitialized: _onScannerInitialized // callback with BarcodeScannerController for control camera 
                                                // and detection when camera preview initialize.
    
    onCameraInitializeError: (error) {          // Handling error if camera can't initialize on device.
      // handleError.
    }
    onScan: (barcode) {                         // Calls on success barcode recognition
      // Do anything with the code.
    },
  ),
);

Future<void> _onScannerInitialized(BarcodeScannerController controller) async {
    await controller.startScan(100)             // Detection starts only after this call.
                                                // 100 - delay in milliseconds between detection for decreasing 
                                                // CPU consumption. Detection happens every 100 milliseconds 
                                                // skipping frames during delay. Use 0 to turn off delay.

    await controller.stopScan()                 // You can stop detection.

    await controller.setDelay(200)              // Or set delay while detection is going.

    await controller.toggleFlash()              // Toggle device flash. Can throw an Exception if device 
                                                // doesn't have flash.

    await controller.pauseCamera()              // Pause camera preview, detection also stops.

    await controller.resumeCamera()             // Resume camera preview, detection resumes too if 
                                                // controller.startScan calls before.
                                                
    await controller.setZoom(0.5)               // Set camera zoom. Values must be in range 0...1                            
}

Contributing:

Contributions are welcome.

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.