GithubHelp home page GithubHelp logo

spacecase123 / alprservice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ffr4nz/alprservice

0.0 0.0 0.0 12 KB

Simple API REST to process images using ALPR

License: GNU General Public License v2.0

Python 100.00%

alprservice's Introduction

ALPRservice

Simple API REST to process image from url and scan for car plates using openalpr

OpenALPR is an open source Automatic License Plate Recognition library written in C++ with bindings in C#, Java, Node.js, and Python. The library analyzes images and video streams to identify license plates. The output is the text representation of any license plate characters.

Description

ALPRservice is just a micro service covering openalpr scan over an API/JSON interface.

Installation

Install openalpr (Debian):

Devs tools

$ sudo apt-get install libpng12-dev libjpeg62-turbo-dev libtiff5-dev zlib1g-dev

$ sudo apt-get install build-essential

$ sudo apt-get install autoconf automake libtool

$ sudo apt-get install git-core

$ sudo apt-get install cmake

Prerequisites

$ sudo apt-get install libopencv-dev libtesseract-dev git cmake build-essential libleptonica-dev

$ sudo apt-get install liblog4cplus-dev libcurl3-dev

If using the daemon, install beanstalkd

$ sudo apt-get install beanstalkd

Clone the latest code from GitHub

$ git clone https://github.com/openalpr/openalpr.git

Setup the build directory

$ cd openalpr/src

$ mkdir build

$ cd build

Setup the compile environment

$ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc ..

Compile

$ make

Install the binaries/libraries to your local system (prefix is /usr)

$ sudo make install

Test

$ wget http://plates.openalpr.com/h786poj.jpg -O lp.jpg

$ alpr -c eu -j lp.jpg

To avoid “libdc1394 error: Failed to initialize libdc1394” line

sudo ln /dev/null /dev/raw1394

Install ALPRservice

Get last version from Github repo:

$ git clone https://github.com/ffr4nz/alprservice.git

You need some requeriment installed:

$ pip install -r requirements.txt

After pip install all libraries service can start using:

$ python alprservice.py -p 4343

Consume API service using /plate/ endpoint

http://alprservice.server.domain:service-port/plate/TopN/Country/URL/

http://alprservice.server.domain:service-port/plate/10/esu/https://dgaqgnnkkz5ef.cloudfront.net/uploads/car_picture/image/34034/fullsize_car_1437168106.jpg

{
  "data_type": "alpr_results", 
  "epoch_time": 1449827429584, 
  "img_height": 513, 
  "img_width": 770, 
  "processing_time_ms": 325.753967, 
  "regions_of_interest": [], 
  "results": [
    {
      "candidates": [
        {
          "confidence": 88.498375, 
          "matches_template": 0, 
          "plate": "3985JCM"
        }, 
        {
          "confidence": 86.127914, 
          "matches_template": 0, 
          "plate": "398SJCM"
        }, 
        {
          "confidence": 81.407692, 
          "matches_template": 0, 
          "plate": "985JCM"
        }, 
        {
          "confidence": 81.051277, 
          "matches_template": 0, 
          "plate": "S985JCM"
        }, 
        {
          "confidence": 80.932816, 
          "matches_template": 0, 
          "plate": "B985JCM"
        }
      ], 
      "confidence": 88.498375, 
      "coordinates": [
        {
          "x": 308, 
          "y": 384
        }, 
        {
          "x": 478, 
          "y": 382
        }, 
        {
          "x": 479, 
          "y": 419
        }, 
        {
          "x": 309, 
          "y": 421
        }
      ], 
      "matches_template": 0, 
      "plate": "3985JCM", 
      "plate_index": 0, 
      "processing_time_ms": 76.103065, 
      "region": "", 
      "region_confidence": 0, 
      "requested_topn": 5
    }
  ], 
  "version": 2
}

License

GPL

References

https://github.com/openalpr/openalpr/wiki/Compilation-instructions-(Ubuntu-Linux)

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.