Giter Site home page Giter Site logo

claire-chan / python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yushulx/python-barcode-qrcode-sdk

0.0 0.0 0.0 1.81 MB

Build Python extension with Dynamsoft Barcode Reader.

Home Page: https://www.dynamsoft.com/Products/Dynamic-Barcode-Reader.aspx

License: MIT License

C 98.82% Python 1.18%

python's Introduction

DBR Python Extension

Version 7.2

The repository aims to help developers build Python barcode apps with Dynamsoft Barcode Reader in Windows, Linux, macOS, and Raspberry Pi.

License

Get the trial license.

Contact Us

[email protected]

Environment

Python 2/3

Supported Symbologies

  • Linear Barcodes (1D)

    • Code 39 (including Code 39 Extended)
    • Code 93
    • Code 128
    • Codabar
    • Interleaved 2 of 5
    • EAN-8
    • EAN-13
    • UPC-A
    • UPC-E
    • Industrial 2 of 5
  • 2D Barcodes:

    • QR Code (including Micro QR Code)
    • Data Matrix
    • PDF417 (including Micro PDF417)
    • Aztec Code
    • MaxiCode (mode 2-5)
  • Patch Code

  • GS1 DataBar (Omnidirectional, Truncated, Stacked, Stacked Omnidirectional, Limited, Expanded, Expanded Stacked)

  • GS1 Composite Code

Installation

  • Dynamsoft Barcode Reader SDK.

  • OpenCV

    pip install opencv-python
    python3 -m pip install opencv-python
    

    For Raspberry Pi

    sudo apt-get install libopencv-dev python-opencv
    
  • NumPy

    pip install numpy
    python3 -m pip install numpy
    

HowTo

Windows

Set Visual Studio in cmd.exe. For example, Visual Studio 2015:

SET VS90COMNTOOLS=%VS140COMNTOOLS%

Edit setup.py. Replace the dbr_lib_dir and dbr_dll with yours:

dbr_lib_dir = r'e:\Program Files (x86)\Dynamsoft\Barcode Reader 7.2\Components\C_C++\Lib'
dbr_dll = r'e:\Program Files (x86)\Dynamsoft\Barcode Reader 7.2\Components\C_C++\Redist\x64'

Build and install the Python extension:

cd src
python setup.py build install
python3 setup.py build install

Linux, macOS and Raspberry Pi

Copy libDynamsoftBarcodeReader.so/libDynamsoftBarcodeReader.dylib to /usr/lib. If you don't have access to /usr/lib, try to copy the library to /usr/local/lib and set the LD_LIBRARY_PATH as follows:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

Build and install the Python extension:

cd src
sudo python setup.py build install
sudo python3 setup.py build install

Examples

  • examples/video

    python rtsp.py
    
  • examples/camera

    python camera-decodevideo.py
    
  • examples/command-line

    python test.py
    

Functions

  • initLicense(license-key)

  • decodeFile(filename, barcodeTypes)

    barcodeTypes = dbr.BF_ONED | dbr.BF_PDF417 | dbr.BF_QR_CODE | dbr.BF_DATAMATRIX | dbr.BF_AZTEC 
    
    Barcode Format Values
    ALL dbr.BF_ALL
    1D dbr.BF_ONED
    PDF417 dbr.BF_PDF417
    QR Code dbr.BF_QR_CODE
    DataMatrix dbr.BF_DATAMATRIX
    Aztec Code dbr.BF_AZTEC
  • decodeBuffer(frame-by-opencv-capture, barcodeTypes)

  • startVideoMode(max_buffer, max_results, video_width, video_height, image_format, barcodeTypes, callback)

  • stopVideoMode()

  • appendVideoFrame(frame-by-opencv-capture)

  • initLicenseFromLicenseContent(license-key, license-content)

  • outputLicenseToString()

  • initLicenseFromServer(license-key, license-server)

  • setFurtherModes(mode, [values])

  • setParameters(json-string)

Online Documentation

https://www.dynamsoft.com/Products/Barcode-Reader-Resources.aspx#documentation

Related Articles

python's People

Contributors

vincy1993 avatar yushulx 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.