Coder Social home page Coder Social logo

dgopsq / react-native-barcodes-detector Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.29 MB

Detect barcodes from static images in React Native using Google ML Kit.

License: MIT License

Kotlin 19.89% JavaScript 6.00% Java 25.86% TypeScript 12.51% C 0.42% Objective-C 14.74% Swift 15.14% Ruby 5.44%
barcodes react react-native google-ml-kit

react-native-barcodes-detector's Introduction

Header

Detect different barcodes in static images directly on React Native. This library has a TypeScript-first support and uses Google ML Kit under the hood ๐Ÿค–.

The supported barcodes are:

๐Ÿ— Installation

# Install
npm install react-native-barcodes-detector

# Link
cd ios && pod install

โšก๏ธ Usage

Take a look at the example to see a use-case with react-native-image-picker (it's really short, I promise ๐Ÿ™).

Anyway, this is the tl;dr:

import { detectBarcodes, BarcodeFormat } from "react-native-barcodes-detector";

// This is the local image url usually retrieved
// through libraries like `react-native-image-picker`.
const imageUrl = "file://..."

// The `detectBarcodes` function needs the image url and
// a list of formats to detect. Using an empty array all
// the supported formats will be used making the detection
// process slower ๐ŸŒ.
const formats = [BarcodeFormat.QR_CODE]

detectBarcodes(imageUrl, formats)
  .then(barcodes => {
    // Here `barcodes` will contain a list
    // of detected barcodes.
  })

๐Ÿ™‹ FAQ

Where is the detection process actually done?

This library uses Google ML Kit to recognize barcodes, and this process is completely done on the physical device.

Why I can't detect a Data Matrix code?

For a Data Matrix to be recognized it must intersect the center of the image, as stated here. This means that only one Data Matrix code can be recognized per image.

โš–๏ธ License

React Native Barcodes Detector is under the MIT license.

react-native-barcodes-detector's People

Contributors

dgopsq avatar

Stargazers

 avatar

Watchers

 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.