Getting results back from PlateRecognizer

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Post Reply
ijhedges
Posts: 3
Joined: Sat Jul 20, 2024 11:09 am

Getting results back from PlateRecognizer

Post by ijhedges »

I have a monitor setup in event server to detect for a car on my drive and send this to PlateRecognizer.
This is aspect is working, the image in Zoneminder for the Object Detection shows my car labelled as 'car'.
The call is being made to PlateRecognizer and the same image is analysed and my number plate is identified.

What I don't seem to be able to get, is the alpr result displayed on the image in Zoneminder.

from my objectconfig.ini (some of the commented lines removed to reduce the noise)

Code: Select all

[monitor-23]
# front door left
match_past_detections=yes
# car_past_det_max_diff_area=5000px
#wait=5
object_detection_pattern=(person|car)

# object_detection_pattern=^(?!potted plant|pottedplant|bench|broccoli)
#alpr_detection_pattern=^(.*x11)
#delete_after_analyze=no
#detection_pattern=.*
import_zm_zones=no

# polygon areas where object detection will be done.

my_front_door_left=2,447 475,426 475,579 4,594
my_front_door_left2=105,359 283,359 278,530 106,541
#my_front_door_left_alpr=186,576 299,578 302,612 188,610

# You are now allowed to specify detection pattern per zone

my_front_door_left_zone_detection_pattern=(person)
my_front_door_left2_zone_detection_pattern=(car)
#my_front_door_left_alpr_zone_detection_pattern=(car)

# use license plate recognition for my driveway
# see alpr section later for more data needed
resize=no
my_model_sequence=object,alpr
detection_mode=all
camera_id=front_door

Code: Select all

[alpr]
alpr_detection_pattern=.*
alpr_use_after_detection_only=yes

alpr_api_type=cloud

# -----| If you are using plate recognizer | ------
alpr_service=plate_recognizer
#alpr_service=open_alpr_cmdline

# If you want to host a local SDK https://app.platerecognizer.com/sdk/
#alpr_url=http://192.168.1.21:8080/alpr
# Plate recog replace with your api key
alpr_key=!PLATEREC_ALPR_KEY
# if yes, then it will log usage statistics of the ALPR service
platerec_stats=yes
# If you want to specify regions. See http://docs.platerecognizer.com/#regions-supported
#platerec_regions=['us','cn','kr']
# minimal confidence for actually detecting a plate
platerec_min_dscore=0.1
# minimal confidence for the translated text
platerec_min_score=0.2
I would appreciate any suggestions for this last missing step
ijhedges
Posts: 3
Joined: Sat Jul 20, 2024 11:09 am

Re: Getting results back from PlateRecognizer

Post by ijhedges »

OK, I think I'm finding info towards my own question

Code: Select all

07/20/24 12:39:09 zmesdetect_m23[3665] DBG2 alpr.py:217 [ALPR JSON: {'processing_time': 119.743, 'results': [{'box': {'xmin': 200, 'ymin': 609, 'xmax': 280, 'ymax': 627}, 'plate': 'xxxxxxxx', 'region': {'code': 'gb', 'score': 0.836}, 'score': 0.853, 'candidates': [{'score': 0.853, 'plate': 'xxxxxxxx'}, {'score': 0.832, 'plate': 'xxxxxxxx'}, {'score': 0.779, 'plate': 'xxxxxxxxx'}, {'score': 0.776, 'plate': 'xxxxxxxx'}, {'score': 0.757, 'plate': 'xxxxxxxx'}, {'score': 0.754, 'plate': 'xxxxxxxx'}], 'dscore': 0.99, 'vehicle': {'score': 0.9, 'type': 'Sedan', 'box': {'xmin': 102, 'ymin': 518, 'xmax': 355, 'ymax': 720}}}], 'filename': '1139_ZVJAn_6b2efae5-eff6-4a73-b5b7-8fd45d4cfc02-alpr.jpg', 'version': 1, 'camera_id': 'front_door', 'timestamp': '2024-07-20T11:39:09.803245Z'}]
07/20/24 12:39:09 zmesdetect_m23[3665] DBG2 alpr.py:244 [Exiting ALPR with labels:['alpr:xxxxxxxx']]
07/20/24 12:39:09 zmesdetect_m23[3665] DBG2 detect_sequence.py:711 [This model iteration inside alpr found: labels: ['alpr:xxxxxxxx'],conf:[0.853]]
07/20/24 12:39:09 zmesdetect_m23[3665] DBG2 detect_sequence.py:424 [Max object size found to be: 90%]
07/20/24 12:39:09 zmesdetect_m23[3665] DBG2 detect_sequence.py:432 [Converted 90% to 767520.0]
07/20/24 12:39:09 zmesdetect_m23[3665] DBG2 detect_sequence.py:541 [intersection: object:alpr:xxxxxxxx,POLYGON ((200 609, 280 609, 280 627, 200 627, 200 609)) DOES NOT intersect polygon:my_front_door_left,POLYGON ((3 744, 791 709, 791 964, 6 989, 3 744))]
07/20/24 12:39:09 zmesdetect_m23[3665] DBG2 detect_sequence.py:502 [intersection: object:alpr:xxxxxxxxx,POLYGON ((200 609, 280 609, 280 627, 200 627, 200 609)) intersects polygon:my_front_door_left2,POLYGON ((175 597, 471 597, 463 882, 176 901, 175 597))]
07/20/24 12:39:09 zmesdetect_m23[3665] DBG2 detect_sequence.py:504 [my_front_door_left2 polygon/zone has its own pattern of (car), using that]
07/20/24 12:39:09 zmesdetect_m23[3665] DBG2 detect_sequence.py:535 [my_front_door_left2 intersects object:alpr:xxxxxxxxx[[(200, 609), (280, 609), (280, 627), (200, 627)]] but does NOT match your detect pattern filter]
07/20/24 12:39:09 zmesdetect_m23[3665] DBG2 detect_sequence.py:768 [We did not find any alpr matches in frame: alarm]
I've removed my plate from the log, but it is being detected.
So it is being fed back from PlateRecognizer, and something about the pattern filter is not matching it.

I'm using the default
alpr_detection_pattern=.*
ijhedges
Posts: 3
Joined: Sat Jul 20, 2024 11:09 am

Re: Getting results back from PlateRecognizer

Post by ijhedges »

Problem resolved.

It wasn't the alpr pattern, it was the zone detection pattern.
Added alpr and now its working

Code: Select all

my_front_door_left2_zone_detection_pattern=(car|alpr)
Post Reply