Git Product home page Git Product logo

cloudapi's Introduction

openalpr

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

Check out a live online demo here: http://www.openalpr.com/demo-image.html

User Guide

OpenALPR includes a command line utility. Simply typing "alpr [image file path]" is enough to get started recognizing license plate images.

For example, the following output is created by analyzing this image: Plate Image

user@linux:~/openalpr$ alpr ./samplecar.png

plate0: top 10 results -- Processing Time = 58.1879ms.
    - PE3R2X     confidence: 88.9371
    - PE32X      confidence: 78.1385
    - PE3R2      confidence: 77.5444
    - PE3R2Y     confidence: 76.1448
    - P63R2X     confidence: 72.9016
    - FE3R2X     confidence: 72.1147
    - PE32       confidence: 66.7458
    - PE32Y      confidence: 65.3462
    - P632X      confidence: 62.1031
    - P63R2      confidence: 61.5089

Detailed command line usage:

user@linux:~/openalpr$ alpr --help

USAGE: 

   alpr  [-c <country_code>] [--config <config_file>] [-n <topN>] [--seek
         <integer_ms>] [-p <pattern code>] [--clock] [-d] [-j] [--]
         [--version] [-h] <image_file_path>


Where: 

   -c <country_code>,  --country <country_code>
     Country code to identify (either us for USA or eu for Europe). 
     Default=us

   --config <config_file>
     Path to the openalpr.conf file

   -n <topN>,  --topn <topN>
     Max number of possible plate numbers to return.  Default=10

   --seek <integer_ms>
     Seek to the specified millisecond in a video file. Default=0

   -p <pattern code>,  --pattern <pattern code>
     Attempt to match the plate number against a plate pattern (e.g., md
     for Maryland, ca for California)

   --clock
     Measure/print the total time to process image and all plates. 
     Default=off

   -d,  --detect_region
     Attempt to detect the region of the plate image.  [Experimental] 
     Default=off

   -j,  --json
     Output recognition results in JSON format.  Default=off

   --,  --ignore_rest
     Ignores the rest of the labeled arguments following this flag.

   --version
     Displays version information and exits.

   -h,  --help
     Displays usage information and exits.

   <image_file_path>
     Image containing license plates


   OpenAlpr Command Line Utility

Binaries

Pre-compiled Windows binaries can be downloaded on the releases page

Install OpenALPR on Ubuntu 16.04 with the following commands:

sudo apt-get update && sudo apt-get install -y openalpr openalpr-daemon openalpr-utils libopenalpr-dev

Documentation

Detailed documentation is available at doc.openalpr.com

Integrating the Library

OpenALPR is written in C++ and has bindings in C#, Python, Node.js, Go, and Java. Please see this guide for examples showing how to run OpenALPR in your application: http://doc.openalpr.com/bindings.html

Compiling

Build Status

OpenALPR compiles and runs on Linux, Mac OSX and Windows.

OpenALPR requires the following additional libraries:

- Tesseract OCR v3.0.4 (https://github.com/tesseract-ocr/tesseract)
- OpenCV v2.4.8+ (http://opencv.org/)

After cloning this GitHub repository, you should download and extract Tesseract and OpenCV source code into their own directories. Compile both libraries.

Please follow these detailed compilation guides for your respective operating system:

If all went well, there should be an executable named alpr along with libopenalpr-static.a and libopenalpr.so that can be linked into your project.

Docker

# Build docker image
docker build -t openalpr https://github.com/openalpr/openalpr.git
# Download test image
wget http://plates.openalpr.com/h786poj.jpg
# Run alpr on image
docker run -it --rm -v $(pwd):/data:ro openalpr -c eu h786poj.jpg

Questions

Please post questions or comments to the Google group list: https://groups.google.com/forum/#!forum/openalpr

Contributions

Improvements to the OpenALPR library are always welcome. Please review the OpenALPR design description and get started.

Code contributions are not the only way to help out. Do you have a large library of license plate images? If so, please upload your data to the anonymous FTP located at upload.openalpr.com. Do you have time to "tag" plate images in an input image or help in other ways? Please let everyone know by posting a note in the forum.

License

Affero GPLv3 http://www.gnu.org/licenses/agpl-3.0.html

Commercial-friendly licensing available. Contact: [email protected]

cloudapi's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloudapi's Issues

Running "setup.py"

I tried using python setup.py install on the terminal. However, it is giving me the error in the photo. I've installed setuptools, so I'm not sure what the problem is...
screenshot 2017-02-13 16 41 21

Maven dependency not found

Hi, this dependency:

io.swagger
openalpr_api
2.0.1
compile

not found on maven central....

please help me

Best Regards

Nelson

Countries missing from docs

Hi, thanks for putting this together. I've been testing the API and it's easy and pleasant to use!

There's a small wrinkle in the documentation, which points to GH directory[1] that only seems to contain some of the supported countries. In particular, Argentina seems to be missing from the options.
In case someone else stumbles on this before it's fixed, your first guess would be correct, it's "ar" :)

[1] https://github.com/openalpr/openalpr/tree/master/runtime_data/config

Issue with android code

        RequestParams params = new RequestParams();
        params.add("imageBytes", base64imge);
        params.add("secret_key", "sk_2d5cd712d3494484c19e55b8");
        params.add("country","us");
        params.add("recognizeVehicle", 0+"");
        params.add("state","");
        params.add("returnImage", 0 + "");
        params.add("topn", 10+"");
        params.add("prewarp","");
        params.add("tasks","make");
        String url = "https://api.openalpr.com/v2/recognize_bytes";

this api call return

{"error_code":400,"error":"Missing secret_key"}

Please help me..

OpenALPR cloud service used to accept multiple countries but this is no longer possible

Hello,
The OpenALPR cloud service used to accept multiple countries but this is no longer possible.
The Cloud API only specifies a string field for the country which only accepts a single country.

Request URL:
https://api.openalpr.com/v2/recognize_bytes?secret_key=sk_DEMODEMODEMODEMO&recognize_vehicle=0&country=eu,gb&return_image=0&topn=10
I see the following response:
{"error_code": 400, "error": "Could not initialize OpenALPR with given parameters"}

Changing the request to only specify a single country (eu) allowed the request to work.

This is a recent change as I was testing about 2 weeks ago with multiple countries and it was working.
Please can you check the integration API is correct and update it accordingly: (https://github.com/openalpr/cloudapi/blob/master/javascript/src/api/DefaultApi.js)

  • this still shows allowing multiple comma separated countries)

Best regards, Simon.

Bad Request error

    File file = new File("C:/New/anpr/snapshot/2018-04-20-102850.jpg");
    String secretKey = "sk_5e1dabe8c87bc1bc8dafd189b5d";
    String country = "india";
    Integer recognizeVehicle = 0;
    String state = "";
    Integer returnImage = 0;
    Integer topn = 0;
    String prewarp = null;
    InlineResponse200 response = api.recognizeFile(file, secretKey, country, recognizeVehicle, state, 
    returnImage, topn, prewarp);

I am using the above code to for recognize the license palte. But while runnig the program I have
"com.openalpr.api.invoker.ApiException: Bad Request" error. please Help me to solve this problem.

plate br2 has problems

When I use country equals "br2" or "br, br2" I've been having exceptions.
Why? Is there a special way to do it works?

File "walkway.py", line 280, in <module> img = cv2.imshow('Processed', processedFrame) NameError: name 'processedFrame' is not defined

Hi friends,
I am working on the following project in github.
https://github.com/AhmadYahya97/Fully-Automated-red-light-Violation-Detection.git

Failed to process frame
Traceback (most recent call last):
File "walkway.py", line 280, in
img = cv2.imshow('Processed', processedFrame)
NameError: name 'processedFrame' is not defined

I tried all the possible way not resolve the error

Issue in Java api

Am using java api. I get the below error.

Exception in thread "main" com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: Expected an int but was 10000000000 at line 1 column 744 path $.credits_monthly_total
at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:227)
at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:217)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220)
at com.google.gson.Gson.fromJson(Gson.java:887)
at com.google.gson.Gson.fromJson(Gson.java:852)
at com.google.gson.Gson.fromJson(Gson.java:801)
at com.openalpr.api.invoker.JSON.deserialize(JSON.java:103)
at com.openalpr.api.invoker.ApiClient.deserialize(ApiClient.java:859)
at com.openalpr.api.invoker.ApiClient.handleResponse(ApiClient.java:1062)
at com.openalpr.api.invoker.ApiClient.execute(ApiClient.java:989)
at com.openalpr.api.DefaultApi.recognizeFileWithHttpInfo(DefaultApi.java:371)
at com.openalpr.api.DefaultApi.recognizeFile(DefaultApi.java:350)
at com.openalpr.api.DefaultApiExample.main(DefaultApiExample.java:30)
Caused by: java.lang.NumberFormatException: Expected an int but was 10000000000 at line 1 column 744 path $.credits_monthly_total
at com.google.gson.stream.JsonReader.nextInt(JsonReader.java:1172)
at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:225)
... 13 more

PLease advice

Getting class cast error in OSGI container - Java API

Caused by: com.sun.jersey.spi.service.ServiceConfigurationError: com.sun.jersey.spi.HeaderDelegateProvider: The class com.sun.jersey.core.impl.provider.header.LocaleProvider implementing provider interface com.sun.jersey.spi.HeaderDelegateProvider could not be instantiated: Cannot cast com.sun.jersey.core.impl.provider.header.LocaleProvider to com.sun.jersey.spi.HeaderDelegateProvider
at com.sun.jersey.core.osgi.OsgiRegistry$OsgiServiceFinder$1.next(OsgiRegistry.java:149)
at com.sun.jersey.core.spi.factory.AbstractRuntimeDelegate.(AbstractRuntimeDelegate.java:76)
at com.sun.ws.rs.ext.RuntimeDelegateImpl.(RuntimeDelegateImpl.java:56)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.8.0_73]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.8.0_73]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.8.0_73]
at java.lang.reflect.Constructor.newInstance(Unknown Source) [rt.jar:1.8.0_73]
at java.lang.Class.newInstance(Unknown Source) [rt.jar:1.8.0_73]
at com.sun.jersey.core.osgi.OsgiRegistry.hookUp(OsgiRegistry.java:421)
at com.sun.jersey.core.osgi.OsgiRegistry.getInstance(OsgiRegistry.java:119)
at com.sun.jersey.core.reflection.ReflectionHelper.getOsgiRegistryInstance(ReflectionHelper.java:842)
at com.sun.jersey.spi.service.ServiceFinder.(ServiceFinder.java:200)
at com.sun.jersey.api.client.Client.init(Client.java:214)
at com.sun.jersey.api.client.Client.access$000(Client.java:119)
at com.sun.jersey.api.client.Client$1.f(Client.java:192)
at com.sun.jersey.api.client.Client$1.f(Client.java:188)
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
at com.sun.jersey.api.client.Client.(Client.java:188)
at com.sun.jersey.api.client.Client.(Client.java:171)
at com.sun.jersey.api.client.Client.create(Client.java:683)
at com.openalpr.api.invoker.ApiClient.getClient(ApiClient.java:579)
at com.openalpr.api.invoker.ApiClient.getAPIResponse(ApiClient.java:436)
at com.openalpr.api.invoker.ApiClient.invokeAPI(ApiClient.java:500)
at com.openalpr.api.DefaultApi.recognizePost(DefaultApi.java:118)
at com.ryder.integration.openlprreader.ReadUtils.readLicensePlate(ReadUtils.java:27)
at com.ryder.integration.openlprreader.LicensePlateReader.run(LicensePlateReader.java:50)
at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:104) [appian-process.jar:]
at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:101) [appian-process.jar:]
at com.appiancorp.common.ContextClassLoaderSwitcher.runInContext(ContextClassLoaderSwitcher.java:25) [appian-common.jar:]
at com.appiancorp.process.runtime.framework.DefaultActivityExecutor.execute(DefaultActivityExecutor.java:101) [appian-process.jar:]
at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute(UnattendedJavaActivityRequest.java:83) [appian-process.jar:]
at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute0(UnattendedJavaActivityRequest.java:55) [appian-process.jar:]
at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:80) [appian-process.jar:]
at com.appiancorp.mdb.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:26) [unattended-request-handler.jar:]
at sun.reflect.GeneratedMethodAccessor690.invoke(Unknown Source) [:1.8.0_73]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.8.0_73]
at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.8.0_73]
at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52) [jboss-as-ee-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63) [jboss-as-ee-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63) [jboss-as-ee-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.as.ejb3.tx.EjbBMTInterceptor.handleInvocation(EjbBMTInterceptor.java:104) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
... 46 more
Caused by: java.lang.ClassCastException: Cannot cast com.sun.jersey.core.impl.provider.header.LocaleProvider to com.sun.jersey.spi.HeaderDelegateProvider
at java.lang.Class.cast(Unknown Source) [rt.jar:1.8.0_73]
at com.sun.jersey.core.osgi.OsgiRegistry$OsgiServiceFinder$1.next(OsgiRegistry.java:147)
... 93 more

No module named openalpr_api

I'm experiencing an ImportError of No module named openalpr_api. I've ran the setup.py and installed the necessary commands explained in the README writeup. Got any advice for me?

Question about use of pre-warp on API calls

Hi

I'm hoping someone can help me? I'm calling the API and I've noticed that for images where the license plate is at an angle I quite often get no license plate back from the API.

I was hoping that the pre-warp parameter may help with these? Would it and do you know what sort of values to use for pre-warp?

Thanks in advance

openalpr counts a single search as 2

When requesting a response from the api using the URL, the response shows that 2 searches were used from the available credits, even if there is only a single licence plate in the image. Is there any reason for this? I cannot see it documented anywhere.

Thanks,
Mike

recognize_file() missing 1 required positional argument: 'self'

Hi...
When a i trying to run this code:
try:
api_response = api_instance.recognize_bytes(image_bytes, secret_key, country, recognize_vehicle=recognize_vehicle, state=state, return_image=return_image, topn=topn, prewarp=prewarp)
pprint(api_response)
except ApiException as e:
print "Exception when calling DefaultApi->recognize_bytes: %s\n" % e

I obtain this error: recognize_file() missing 1 required positional argument: 'self'

Can somebody tell me why?

API does not handle EXIF orientation tag

Some phone cameras don't re-orient images before saving them, meaning that images can be saved rotated, but with metadata specifying the rotation, so that image viewing programs can display them correctly. See here for details: https://www.howtogeek.com/254830/why-your-photos-dont-always-appear-correctly-rotated/

The cloud API appears not to take the rotation metadata into account, so it will fail to identify license plates that would be found if the image were correctly rotated. I was able to fix this in my client by simply rotating the image as needed before uploading it (using sharp), but it would be nice if the API could handle this for me.

About the country code

Hi in your comments, I was able to find the supported country code, but Thailand was not in there, but after I set it up, and use your sample code, I change the country code to Thai, it is able to correctly detect Thai number plate, I want to know why and does Java support Thai number plate as well?

ModuleNotFoundError: No module named 'openalpr_api'

Hi friends,
I am working on the following project in github.
https://github.com/ShreyAmbesh/Traffic-Rule-Violation-Detection-System

installed all the needed packages for the project but when i try to run the project in pycharm i am getting the following error...

File "VehicleMoniter.py", line 21, in
import openalpr_api
ModuleNotFoundError: No module named 'openalpr_api'

I also installed openalpr in my system

C:\Users\preetha\Desktop\python project\traffic project\Traffic-Rule-Violation-Detection-System-master>pip install openalpr
Requirement already satisfied: openalpr in c:\users\preetha\appdata\local\programs\python\python37\lib\site-packages (1.0.12)

I don't know how to solve this error....

Anyone plz help me...

thanks in advance

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.