sclaflin / OpenALPR-HTTP-Wrapper

Thin wrapper around the OpenALPR cli program
MIT License
9 stars 7 forks source link

No result in JSON #2

Closed DuMees closed 1 year ago

DuMees commented 1 year ago

Hello all,

I've installed it on my Synology in Docker. It runs like it should, however all the responses do not have a result. Not via CURL or webpage.

Anyone has an thought about what could be the issue?

Would be greatly appreciated. result

DuMees

DuMees commented 1 year ago

Maybe good to know that normal openALPR do work in another docker container.

sclaflin commented 1 year ago

Agreed that it looks like it's running fine. The most likely answer is poor quality image(s) being sent to it. Either the area where the plate is is too small, or too blurry, etc. Try doing an image search for license plates and manually upload them to see if you get results that way.

DuMees commented 1 year ago

I really appreciate your help!

I tested it with an image that works on the implementation without the wrapper from Matthill (that I have to startup via SSH, docker CLI). Problem with that is that I cannot run a new docker container from the Synology Docker integration therefore your http-wrapper is my saving grace.

I cannot figure out how to debug as I'm not a docker expert...

If you can help me to get me to generate a log or something I'm sure I should be able to figure it out and provide feedback to you to improve.

Regards,

DuMees plate

sclaflin commented 1 year ago

Uploaded the image you attached and got the following output:

{"version":2,"data_type":"alpr_results","epoch_time":1667926025011,"img_width":3843,"img_height":2827,"processing_time_ms":340.105865,"regions_of_interest":[{"x":0,"y":0,"width":3843,"height":2827}],"results":[{"plate":"CD9052","confidence":89.766571,"matches_template":0,"plate_index":0,"region":"","region_confidence":0,"processing_time_ms":16.527998,"requested_topn":10,"coordinates":[{"x":762,"y":1289},{"x":1202,"y":1391},{"x":1163,"y":1593},{"x":721,"y":1488}],"candidates":[{"plate":"CD9052","confidence":89.766571,"matches_template":0},{"plate":"CD905Z","confidence":82.161018,"matches_template":0},{"plate":"CD9O52","confidence":81.714828,"matches_template":0},{"plate":"CD9Q52","confidence":80.837914,"matches_template":0},{"plate":"CD90S2","confidence":79.898552,"matches_template":0},{"plate":"CO9052","confidence":79.450264,"matches_template":0},{"plate":"CD9D52","confidence":78.696381,"matches_template":0},{"plate":"GD9052","confidence":77.919914,"matches_template":0},{"plate":"D9052","confidence":77.865913,"matches_template":0},{"plate":"CQ9052","confidence":77.728477,"matches_template":0}]}]}

DuMees commented 1 year ago

Issue with the Synology implementation of Docker than. Probably a security/folder thing I guess. Anyone has an idea how I can debug and narrow it down?

sclaflin commented 1 year ago

Might be a silly question, but when you uploaded the image manually, did you select "USA" or "Europe". I ask because I got results with "USA", but I didn't get results with "Europe".

DuMees commented 1 year ago

Yup, that's it. See below. Selecting USA does the trick. No result when selecting EU. Also via my nodered implementation it works with country US (although it feels not that accurate).

result

So for now it works, when I have time I'm happy to take a look at the code to see if I can figure out what goes wrong..

Really appreciate your help.

sclaflin commented 1 year ago

Happy to help!

DuMees commented 1 year ago

I've found the cause and proposed a change.

In server.js you use country_Code where in the openalpr.js you use country_code in the selector.

Using country_Code in the curl request solved it as well.

sclaflin commented 1 year ago

I'm sorry, but that's not correct. Nowhere in any of this project does "country_Code" exist.

"country_Code" is not used as an argument and ends up being ignored by Server.js. The default value of "us" is used in this case.

DuMees commented 1 year ago

That it defaults to us could indeed be the reason it populates it when using an incorrect selector name or curl argument. Too bad it is not that simple.

sclaflin commented 1 year ago

I double checked the compiled "alpr" binary that this wrapper calls and it does indeed take either "us" or "eu" as arguments for the country code. I suspect the issue lies somewhere within the open source alpr project.

My biggest concern is the sidewalls of the tires in that picture! Yikes!

DuMees commented 1 year ago

And a CD license plate meaning that the people of the country it is assigned to pay the fine ;)

Weird thing is I do get a result when running via SSH and argument eu against the docker image when pulled via hub.docker.com directly.

That's why I thought the wrapper might not be passing it correctly but this exceeds my knowledge level.

Vaguely it does seem to recognize Dutch plates even with US selected.