Coder Social home page Coder Social logo

kivy-garden / garden.zbarcam Goto Github PK

View Code? Open in Web Editor NEW
49.0 8.0 14.0 1.33 MB

Migrated to https://github.com/kivy-garden/zbarcam

Home Page: https://github.com/kivy-garden/zbarcam

License: MIT License

Python 72.56% Makefile 26.23% Shell 1.22%
kivy zbar qrcode barcode scanner python

garden.zbarcam's Introduction

garden.zbarcam

Build Status

Real time Barcode and QR Code scanner using the camera. It's built on top of Kivy and pyzbar.

screenshot

How to use

Simply import and instanciate ZBarCam in your kvlang file and access its symbols property.

#:import ZBarCam kivy.garden.zbarcam.ZBarCam
#:import ZBarSymbol pyzbar.pyzbar.ZBarSymbol
BoxLayout:
    orientation: 'vertical'
    ZBarCam:
        id: zbarcam
        # optional, by default checks all types
        code_types: ZBarSymbol.QRCODE, ZBarSymbol.EAN13
    Label:
        size_hint: None, None
        size: self.texture_size[0], 50
        text: ', '.join([str(symbol.data) for symbol in zbarcam.symbols])

Install

Ubuntu

Install system requirements (Ubuntu 18.04):

sudo apt install libzbar-dev

Install garden requirements:

garden install --upgrade xcamera

Install zbarcam: Via garden:

garden install --upgrade zbarcam

When installed with this method, the import command would be:

from kivy.garden.zbarcam import ZBarCam

Via pip:

pip install --upgrade https://github.com/kivy-garden/garden.zbarcam/archive/develop.zip

When installed with this method, the import command would be:

from zbarcam import ZBarCam

You may also need to compile/install OpenCV manually, see OpenCV.md.

Android

Build for Android via buildozer, see buildozer.spec.

Contribute

To play with the project, install system dependencies and Python requirements using the Makefile.

make

Then verify everything is OK by running tests.

make test
make uitest

Troubleshooting

Install Unable to import package 'kivy.garden.xcamera.XCamera'

Missing the xcamera dependency, install it with:

garden install xcamera

Android ValueError: Empty module name

More likely an import issue in your .kv file. Try to from zbarcam import ZBarCam in your main.py to see the exact error. It's common to forget Pillow in buildozer.spec requirements section.

OpenCV related

See OpenCV.md.

Credits

I borrowed a lot of code from tito/android-zbar-qrcode.

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.