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

套件詳情v1.0.2

flutter_text_detect_area

Flutter 文字偵測區域的文字識別功能可透過拖曳/移動/平移區域選擇器,從影像的特定區域辨識/偵測文字。

AndroidiOS
近 30 天下載
127
喜歡數
29
Pub 分數
150

安裝套件

flutter pub add flutter_text_detect_area

套件介紹

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

Flutter Text Detect Area 是一個專為在影像特定區域中精確辨識文字而設計的 Flutter 套件。透過允許使用者拖曳、移動或平移選擇器覆蓋影像,可將選定區域的文字隔離並偵測。適用於需要聚焦 OCR 的應用,例如文件掃描或從影像中提取資料,此套件利用機器學習與電腦視覺技術。該套件支援 Android 與 iOS 平台,使其可在各種行動裝置上使用。它可透過 pub.dev 隨意整合至 Flutter 專案中。

適用情境

  • 文件掃描
  • 基於圖像的數據提取
  • 選擇性文本識別
  • 移動OCR應用
  • 圖像中的即時文字檢測

主要特色

  • 拖曳並平移區域選擇
  • 精確的基於區域的文本檢測
  • 跨平台支援(Android 與 iOS)
  • 與 Flutter 的輕鬆整合
  • 即時OCR處理

適合對象

  • 開發 OCR 功能的開發者
  • 需要選擇性文本提取的應用
  • 具有影像分析的行動應用程式
  • 帶有圖像識別的教育工具
  • 欄位資料採集應用

使用建議

  • 需要相機或圖像輸入
  • 性能取決於設備功能
  • 準確度隨圖像品質而變化
  • 限制在選定區域內的文字
  • 可能需要對低品質圖像進行額外預處理

原始 README

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

Flutter Text Detect Area

pub package GitHub stars License: GPLv3 Flutter Compatible Platform


A Flutter plugin that enables text detection from specific areas of an image or live camera preview. Just drag/select the area you want to scan, and let it extract the text using ML Kit.

Perfect for scanning:

  • 🧾 Receipts image
  • 📄 Documents image
  • 📘 PDFs image
  • 🧠 Custom fields in images

🚀 Features

  • 📸 Supports both live camera and gallery image input
  • ✍️ Manual area selection (drag, resize, pan, freeze)
  • 🔁 Detect text once or continuously
  • 📱 Android & iOS support
  • ✅ Simple integration

📦 Installation

Add to your pubspec.yaml:

dependencies:
  flutter_text_detect_area: <latest-version>

Import in your Dart file:

import 'package:flutter_text_detect_area/flutter_text_detect_area.dart';

📸 Preview

Pick Image (GIF) Live Camera (GIF)
Pick Camera
Multi Text Detection (PNG) Single Text Detection Camera (PNG)
Multi Single

📂 Image Picker Setup

Use the image_picker package to choose an image:

final pickedFile = await ImagePicker().pickImage(source: ImageSource.gallery);

✨ Example Usage

Navigator.of(context).push(
  MaterialPageRoute(
    builder: (context) => SelectImageAreaTextDetect(
      detectOnce: true, // Set to false for continuous scan
      enableImageInteractions: true,
      imagePath: pickedFile?.path ?? '',
      onDetectText: (value) {
        if (value is String) {
          print("Detected: $value");
        } else if (value is List<String>) {
          for (int i = 0; i < value.length; i++) {
            print("${i + 1}. ${value[i]}");
          }
        }
      },
      onDetectError: (error) {
        if (error is PlatformException &&
            (error.message?.contains("InputImage width and height should be at least 32!") ?? false)) {
          ScaffoldMessenger.of(context).showSnackBar(
            const SnackBar(content: Text("Selected area must be at least 32x32 pixels.")),
          );
        }
      },
    ),
  ),
);

🔐 Permissions

Android (AndroidManifest.xml)
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
iOS (Info.plist)
<key>NSCameraUsageDescription</key>
<string>Need camera access for live scanning</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Need photo access to pick images</string>

✅ Platform Support

Platform Supported
Android ✅
iOS ✅
Web ❌

🔍 Output Format

  • If detecting once: returns String
  • If detecting multiple areas: returns List<String>

💡 Use Cases

  • Scan receipts for expenses
  • Extract fields from identity cards
  • Detect table content from scanned documents
  • Select and extract from academic papers or books

👨‍💻 Contributors


📄 License

This project is licensed under the GNU GPLv3.

所屬分類

依賴

依賴清單 7 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。