Start using &JSON macro instead of &PLATE or &MEMO macro
If you change to &JSON macro you will have the below data and can add the confidence and cropped image to the ALPR Recognition Feed
"confidence":0.9605546444654465,
"label":"Plate: LPW8491",
"plate":"LPW8491",
"x_min":781,
"y_min":587,
"x_max":928,
"y_max":700}

Log in to comment and vote
Comments15
VideoDad
Jan 18, 2025
I really like this for the ability to get the cropped location of the plate(s).
I do see some possible complicaitons though for those not using ALPR exclusively.
For example, I’m using the license-plate custom model and when it detects something it sends the image off to PlateRecognizer. I’d still need to be able to send the detected &PLATE because the JSON in this case doesn’t include the plate, just the label “DayPlate” which is not what I want stored as the plate name.
[{"api":"license-plate","found": {"message":"Found DayPlate", "count":1,"predictions": [{"label":"DayPlate", "confidence":0.9259348, "y_min":760, "x_min":22, "y_max":870, "x_max":184}], "moduleId":"ObjectDetectionYOLOv5Net", "moduleName":"Object Detection (YOLOv5 .NET)", "command":"custom", "requestId":"f3dece3c-eafc-4180-aac0-a1ba1e5eced3", "inferenceDevice":"CPU", "inferenceMs":585, "processMs":585, "analysisRoundTripMs":3937, "success":true, "processedBy":"localhost", "timestampUTC":"Sat, 18 Jan 2025 18:30:52 GMT"}}]So this mostly works, if the api can still accept the “plate:” field as an override. The only other issue is that Blue Iris doesn’t return multiple hits from PlateRecognizer. It returns one and if there were multiple plates detected by “license-plate”, it wouldn’t know how to line them up with what PlateRecognizer detected. For me, I don’t get multiple plates often, but it would be a limitation.
Another use case is I’m currently logging the detection of delivery vehicles as plates. I’m using my delivery custom model and it presently detects the plates as AMAZON, DHL, UHAUL, UPS, USPS.
[{"api":"delivery", "found": {"message":"Found fedex", "count":1,"predictions": [{"label":"fedex", "confidence":0.9868376, "y_min":91, "x_min":1896, "y_max":263, "x_max":2350}], "moduleId":"ObjectDetectionYOLOv5Net", "moduleName":"Object Detection (YOLOv5 .NET)", "command":"custom", "requestId":"198f9551-28c6-496e-b4ae-7d305d5261f7", "inferenceDevice":"CPU", "inferenceMs":370, "processMs":370, "analysisRoundTripMs":1754, "success":true, "processedBy":"localhost", "timestampUTC":"Sat, 18 Jan 2025 18:48:20 GMT"}}]This would work if it pulls the “label” field, but in the ALPR case, there’s an extra “Plate: “ preceding the ALPR detected plate. In that case, though, there is a “plate” field that would be used.
Thoughts?
MikeLud
Jan 18, 2025
Easy edit to remove the “Plate: “
I just tested and Blue Iris works fine with the change.
{
"confidence":0.9544437006115913,
"label":"KAA6078",
"plate":"KAA6078",
"x_min":129,
"y_min":577,
"x_max":283,
"y_max":682}
VideoDad
Jan 18, 2025
I still have the issue with PlateRecognizer where the label would be “DayPlate” or “NightPlate”. But if the API still allows for a separate Plate field sent in, it should work as an override.
Just a heads up to Charlie.
Charlie Algert
Jan 19, 2025
Why would this break platerecognizer?
You can still make the alert action require the plate
VideoDad
Jan 19, 2025
If you don't go exclusively to JSON, then yes. But I was imagining being able to use the JSON to get the cropped area of the plate and still send the plate from PlateRecognizer.
Charlie Algert
Jan 20, 2025
OHHH, I see bc u use the platerecognizer AI instead of codeproject. I mean… that’s a bit of a sticky one. The license plate model will definitely improve and the goal is to not have to use platerecognizer. I will definitely still leave everything backwards compatible.
I’m pretty sure blue Iris already has an option to crop into it, no?
VideoDad
Jan 20, 2025
My point being you could bring in the full image as you do today. The &JSON could be useful for bringing in the cropping info and the percent certainly.
This would all work but you can't count on the label in the &JSON having the plate. In the case of PlateRecognizer, the plate field would have to be sent in manually and it would apply to the first detected region in the &JSON.
Charlie Algert
Jan 20, 2025
I’m not sure if I’m fully clear since I never used platerecognizer much. Let me know if I’m not getting it.
When you say you can’t count of the label in the JSON having the plate, you mean if you are using platerecognizer for the OCR, right? With CPAI, it will. If using the plate detection model first, then sending to platerecognizer, yes it would be an issue. But isn’t that already the case?
If there is data that is sent back to BI after the request to the alpr db would be sent, the BI api could be used to go request the new data after the fact.
VideoDad
Jan 20, 2025
Today I pass in the detected plate from PlateRecognizer in the &PLATE field.
Then there's the ability to pass in the list of detected objects in the &MEMO field. I use this to pass in detections from my custom delivery model so I can track detections of AMAZON, DHL, FEDEX, UPS and USPS as if they were vehicles with those plates.
Mike also uses that to pass in the list of detected plates from the ALPR. His module changes the label to that of the plate OCR.
Now he's suggesting that you add the ability to get the bounding boxes, the confidence and the plate/label from &JSON so it would be useful for that additional info.
I can use the same method for my delivery model and get the confidence and bounding box info. So that's good.
If I want to switch PlateRecognizer detected plates to also take advantage of the &JSON bounding box, it also works except the label field contains “DayPlate" or “NightPlate", not the detected plate. So I'm just asking if this can be implemented so that the plate can be sent in the plate:&PLATE field and the processing of &JSON would just use it as an override of the first detected bounding box’s label and would then ignore any additional detections.
Charlie Algert
Jan 20, 2025
So if both plate: and the JSON are sent, use the number from plate?
VideoDad
Jan 20, 2025
That's my request…but if you think it's messy, I can just skip the &JSON method for PlateRecognizer as long as the Plate method still works.
I thought &JSON was being proposed as a replacement for the other two methods. It certainly removes the need to keep the &MEMO method since all that info (and more) is in the &JSON.
Charlie Algert
Jan 20, 2025
I 95% understand what happens in your setup. Doesn’t seem messy to me… Very easy to do.
The JSON will be the primary way to send, but I’ll leave the others or at least the plate option.
Would be cool if your delivery model could be used to auto tag stuff.
VideoDad
Jan 20, 2025
The delivery model runs on a different camera so I don't think it would be easy to associate with a plate detection on a different camera doing the LPR.
Charlie Algert
Jan 20, 2025
Hmm ok I see. Could definitely be done, but would probably fall apart a little bit with more than one car at a time in the recognition zone for either model.
VideoDad
Jan 22, 2025
I was just looking at the PlateRecognizer API and it clearly returns multiple plates and their bounding boxes. I guess BI (Ken) is only keeping the first one. Maybe someday he’ll update it to return all the plates like ALPR does. :)