openalpr / cloudapi Goto Github PK
View Code? Open in Web Editor NEWOpenALPR Cloud API Client Libraries
License: Apache License 2.0
OpenALPR Cloud API Client Libraries
License: Apache License 2.0
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.
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
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?
When I use country equals "br2" or "br, br2" I've been having exceptions.
Why? Is there a special way to do it works?
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
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
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?
It would be beneficial to upgrade the current library to Swift 4.0.
In the openalpr/cloudapi https://github.com/MatUrbanski/alpr_ruby/ is linked and therefor when i run:
pip install git+https://github.com/openalpr/cloudapi.git
I get a message i don't have permission to clone this repo.
Is there no way to either integrate this in openalpr repo or delete it?
Reference: MatUrbanski/alpr_ruby#1
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.
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..
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
i want to upload imgae from my desktop ?
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
Hi, this dependency:
io.swagger
openalpr_api
2.0.1
compile
not found on maven central....
please help me
Best Regards
Nelson
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?
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
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
Is version 3.65 supported? I keep the error -
AttributeError: 'bytes' object has no attribute 'swagger_types'
Whats the fix to this? On 2.7.15 it works perfectly
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)
Best regards, Simon.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.