ANPR options

Agent supports License Plate Recognition in a couple of ways:

  • Via PlateRecognizer.com (commercial with free tier, cross platform runs on cloud or locally, pay by volume)
  • Via AgentDVR-ALPR (free, open source, runs on Linux)

Using PlateRecognizer

Configure LPR (ANPR or License Plate Recognition) in Agent DVR by going to Server Settings - Intelligence and enter the settings under Plate Recognizer. Sign up for a Free Trial on Plate Recognizer. No credit card required.

Tip: DeepStack URL is optional - you can combine Plate Recognizer with DeepStack AI by triggering LPR on Alert and using DeepStack to filter movement alerts to "car,motorbike".

Configuring LPR Server

  • URL: This is the URL to the service. The default is "https://api.platerecognizer.com/v1/plate-reader/" but you can enter your own server if you have your own instance of it running.
  • Token: After creating a Plate Recognizer account, go to the Plate Recognizer Account Page and copy the API Token value.
  • Regions: Leave this blank for default or enter a CSV list of regions
  • Config: You can enter an extra config value here from the docs
  • License Plates: Enter a CSV list of plates to recognise. Example: abc123,def234,efg345 OR a URL to a dynamic list of plates like http://myserver/plates.txt. This is used to raise events from the camera like Recognized or Not Recognized. If this is blank all plates will generate Not Recognized events.
  • Reload Interval (s): If you are using a URL in License Plates this controls how often to reload the list from the URL.
  • Normalize: Enable this to normalize the plates when doing lookups. This will replace I with 1, B with 8, O with 0, Z with 2 and S with 5. This helps guard against frequently misread plate characters as both the plate lookup and the plate list are normalized.

LPR Camera Configuration

Once the server settings are done, edit a camera and go to the LPR tab:

Configuring LPR
  • Enabled: Switch LPR on or off. You can also do this via the Schedule
  • Mode: When to pass images to the PlateRecognition.com service. You can choose from Alert which you can use in conjunction with DeepStack Alert Filtering to have DeepStack look for "car,motorcycle". Motion which can be based on simple motion or a large object crossing a virtual trip wire. See Detectors, or None which is useful if you are triggering it via API.
  • Minimum Interval: How often to send images to the web service when triggered. The free version of PlateRecognizer.com has a limit of 2500 requests per month and a rate limit of 1 frame per second. (this may change, check their website)
  • Confidence: Minimum confidence of result. Anything below this value will be discarded (0-100)
  • Photos: Check this to take a photo and overlay results. These photos will be saved to Photos in Agent DVR.
  • Make, Model and Color: Check this only if you have a paid plan that supports it on PlateRecognizer.com. It's not included in the free plan. Make model and color will be requested with the image and returned in {AIJSON} in Agent Actions (see below).
Example Photo
Example LPR Photo Result
Adding LPR Actions

When LPR runs Agent will generate events for "License Plate Recognized", "License Plate Not Recognized" and "License Plate Not Detected" under Actions. If a plate is detected that matches one in the list in the server configuration you will get a Recognized event otherwise you will get a Not Recognized event.

You can use these events to trigger actions such as calling a URL with the detected plate or running an executable or publishing a message to an MQTT server. You can use the tags {AI} for the plate details (if more than one they will be in a CSV list) or {AIJSON} for the full response JSON object from PlateRecognizer.com.


LPR Troubleshooting

If LPR isn't working check the log file at /logs.html on the local server.