hi, i want to implement plate recognizer number with openhab to open my gatedoor.
when a car trigger the camera detection openhab a snapshot and send a request to my sdk and i want to parse the result.
with shell command i obtain the result without problem.
this is the request from shell
davide@davide-OptiPlex-3040:~$ curl -F “upload=@/home/davide/Documenti/targa.jpg” http://192.168.1.8:38080/v1/plate-reader/
and this is the response:
“filename”: “targa.jpg”, “timestamp”: “2022-04-24 18:58:08.501118”, “camera_id”: null, “results”: [{“box”: {“xmin”: 420, “ymin”: 362, “xmax”: 540, “ymax”: 478}, “plate”: “", “region”: {“code”: “it”, “score”: 0.807}, “score”: 0.903, “candidates”: [{“score”: 0.903, “plate”: "*”}, {“score”: 0.781, “plate”: “fh6b7jy”}], “dscore”: 0.712, “vehicle”: {“score”: 0.686, “type”: “Van”, “box”: {“xmin”: 7, “ymin”: 0, “xmax”: 646, “ymax”: 604}}}], “usage”: {“calls”: 6, “max_calls”: 2500}, “processing_time”: 52.91
So i want to send the curl and parse the response, only the “plate”: “*****”, and if the plate is correct openhab open the doorgate.
i ve try to implement the http binding but i think that it’s not a good idea.
Do you think that 's possible to implement this request with the action for openhab?
this is the wiki of the sdk
HTTP Request
`POST https://api.platerecognizer.com/v1/plate-reader/’POST Parameters
Parameter Required Description upload Yes The file to be uploaded. The parameter can either be the file bytes (using Content-Type multipart/form-data) OR a base64 encoded image. regions No Match the license plate pattern of a specific region or regions. This parameter can be used multiple times to specify more than one region. It is treated as a guide and the template will be ignored if the prediction differs too much from it. That’s because we want to still be able to read plates from foreign vehicles. The system may sometimes mistake a local vehicle for a foreign one. camera_id No Unique camera identifier. timestamp No ISO 8601 timestamp. For example, 2019-08-19T13:11:25
. The timestamp has to be in UTC.mmc No Predict vehicle make, model, orientation and color. This feature is available for an additional fee. Set parameter to true (mmc=true) if you have this feature enabled/purchased to get vehicle make, model and color. Possible values are true
orfalse
.config No Additional engine configuration. See details.
thank