Git Product home page Git Product logo

richshaw2015 / flutter_scalable_ocr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vbalagovic/flutter_scalable_ocr

1.0 0.0 0.0 319 KB

Flutter scalable OCR package is a wrapper around google_mlkit_text_recognition where you can partialy select part of camera which text will be processed of.

Home Page: https://pub.dev/packages/flutter_scalable_ocr

License: MIT License

Ruby 3.95% C++ 30.74% C 2.09% Objective-C 0.06% Kotlin 0.18% Dart 31.15% Swift 1.70% HTML 2.67% CMake 27.46%

flutter_scalable_ocr's Introduction

Flutter Scalable OCR

v1.0.1

Flutter scalable OCR package is a wrapper around Google ML kit Text Recognition. It tackles the issue of fetching data just from part od a camera and also narowing down the camera viewport which was common problem. To see how it work in real case scenario you can check the app where it was used Exchange Rate Scanner and here are some gifs from example project.

Requirements

Since thus package uses ML Kit check requirements before running the package in project.

Features

Scan text from narow window of camera and not whole screen. There are two function getScannedText to fetch readed text as a string, or getRawData which returns list of TextElement consult ML Kit Text Recognition objects as from followin structure from google developer site image. Pinch and zoom should also work:

Note: Wrapper uses Camera package so you need to add perimission as in documentation.

Usage

Add the package to pubspec.yaml

dependencies:
  flutter_scalable_ocr: x.x.x

Import it

import 'package:flutter_scalable_ocr/flutter_scalable_ocr.dart';

Full examples for all three options are in /example folder so please take a look for working version.

Parameters:

Parameter Description Default
boxLeftOff Scalable center square left 4
boxBottomOff Scalable center square bottom 2.7
boxRightOff Scalable center square right 4
boxTopOff Scalable center square top 2.7
paintboxCustom Narrowed square in camera window from example
boxHeight Camera Window height from example
getScannedText Callback function that returns string
getRawData Callback function that returns list of TextElement

Use widget:

ScalableOCR(
    paintboxCustom: Paint()
        ..style = PaintingStyle.stroke
        ..strokeWidth = 4.0
        ..color = const Color.fromARGB(153, 102, 160, 241),
    boxLeftOff: 4,
    boxBottomOff: 2.7,
    boxRightOff: 4,
    boxTopOff: 2.7,
    boxHeight: MediaQuery.of(context).size.height / 5,
    getRawData: (value) {
        inspect(value);
    },
    getScannedText: (value) {
        setText(value);
    }),

flutter_scalable_ocr's People

Contributors

vbalagovic avatar richshaw2015 avatar

Stargazers

LUDY2015 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.