Giter Site home page Giter Site logo

reyna168 / vision-camera-dynamsoft-label-recognizer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tony-xlh/vision-camera-dynamsoft-label-recognizer

0.0 0.0 0.0 31.56 MB

React Native Vision Camera Frame Processor Plugin of Dynamsoft Label Recognizer

License: MIT License

JavaScript 1.18% Ruby 3.98% C 0.55% Objective-C 5.58% Java 42.54% TypeScript 31.31% Objective-C++ 0.97% Swift 13.89%

vision-camera-dynamsoft-label-recognizer's Introduction

vision-camera-dynamsoft-label-recognizer

React Native Vision Camera Frame Processor Plugin of Dynamsoft Label Recognizer

label-recognizer-example.mp4

Versions

For vision-camera v2, use versions 0.x.

For vision-camera v3, use versions >= 1.0.0.

Installation

yarn add vision-camera-dynamsoft-label-recognizer
cd ios && pod install

Add the plugin to your babel.config.js:

module.exports = {
   plugins: [['react-native-worklets-core/plugin']],
    // ...

Note: You have to restart metro-bundler for changes in the babel.config.js file to take effect.

Usage

  1. Scan text with vision camera.

    import { recognize } from 'vision-camera-dynamsoft-label-recognizer';
    
    // ...
    const frameProcessor = useFrameProcessor((frame) => {
      'worklet';
      const scanResult = recognize(frame);
    }, []);
  2. Scan text from base64-encoded static images.

    const scanResult = await decodeBase64(base64);
  3. License initialization (apply for a trial license).

    await initLicense("your license");

Interfaces

Scanning configuration:

//the value is in percentage
export interface ScanRegion{
  left: number;
  top: number;
  width: number;
  height: number;
}

export interface ScanConfig{
  scanRegion?: ScanRegion;
  includeImageBase64?: boolean;
}

export interface CustomModelConfig {
  customModelFolder: string;
  customModelFileNames: string[];
}

You can use a custom model like a model for MRZ passport reading using the CustomModelConfig prop and update the template. You can find the MRZ model and template in the example.

You need to put the model folder in the assets folder for Android or the root for iOS.

About the result:

export interface ScanResult {
  results: DLRResult[];
  imageBase64?: string;
}

export interface DLRResult {
  referenceRegionName: string;
  textAreaName: string;
  pageNumber: number;
  location: Quadrilateral;
  lineResults: DLRLineResult[];
}

export interface Quadrilateral{
  points:Point[];
}

export interface Point {
  x:number;
  y:number;
}

export interface DLRLineResult {
  text: string;
  confidence: number;
  characterModelName: string;
  characterResults: DLRCharacherResult[];
  lineSpecificationName: string;
  location: Quadrilateral;
}

export interface DLRCharacherResult {
  characterH: string;
  characterM: string;
  characterL: string;
  characterHConfidence: number;
  characterMConfidence: number;
  characterLConfidence: number;
  location: Quadrilateral;
}

Supported Platforms

  • Android
  • iOS

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

vision-camera-dynamsoft-label-recognizer's People

Contributors

xulihang 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.