Hikvision ANPR Setup #1
So I recently wanted to replace my aging Axis Q1604-E & illuminator combo with something a little more subtle, and a device that could process numberplates automatically (without using OpenALPR as I find it cumbersome and not too great on UK plates).
Looking at my options that were within budget the only clear winner was the Hikvision DS-2CD4A26FWD-IZS/P, it currently costs £531.79 in the UK but is available on a '14 day buy & try' scheme from use-ip.co.uk (not a refferal link or anything.. just a good company to work with!). I was a little skeptical that a device at this price point would actually recognise plates, not to mention doing the same at night.. but due to their returns / trial policy I decided to for it.
The camera turned up and the first thing i did was update the firmware, which annoyingly you need to contact your supplier for as Hikvision don't make it easy to find on their site (it's a special firmware containing the ANPR functionality).
skip a few hours.. camera mounted on a tree
(skipping setting an IP and basic network config - these are setups for firmware v5.4.7)
The first thing you'll need to do is grab Hikvision's plugin for rending the video stream, I'm using a mac so used this file once it's installed you'll need to restart your browser.
Anyway, head over to the camera's config page, change your password and head over to the configuration area > Image.
Set the following:
- Mounting Scenario = Road
- Exposure Time = 1/500 (depends how fast you expect the cars to pass the camera.. you may need to play with it).
- Backlight Settings = BLC OFF / WDR OFF
- Video Adjustment: Scene Mode = Outdoor
Now go to 'Road Traffic'
You need to setup as follows, basically defining a lane(s) and your region:
Set the other settings as you see fit, but make sure on the 'Picture' tab you set the 'FTP Picture Name' to 'Custom' as follows:
This is so that our Python script can read the plate from the file name (more on that later!).
Once setup you should be able to go into the 'Real-time LPR Result' tab and see plates as they pass your camera:
So for the money it works very well, hardly ever misses a normal plate (maybe once in 2 weeks it's missed a car going up the drive but gets it coming down). It works very well at night, including when cars are coming towards the camera with headlights..
However there are a couple of things wrong:
- refuses to work with square plates found on Range Rovers and other similar cars. It just reads the top line of the plate strangely.
- The built in white / black list simply does not work.
- There is no way to trigger an HTTP call or similar when a plate passes.
- Hikvision's API seems next to useless, nothing like Axis's ACAP.
- Hikvision don't have a great security reputation and I feel like I've contaminated by network with a weak / potentially backdoored device.
I've started working on a python program to capture the plate details and save them in a database with future goals of a web interface to manage known plates, report suspicous visitors, blacklist, trigger actions etc.
Regarding the Hikvision security point I mentioned previously, my cameras are in their own VLAN anyway, so I've tightened the ACL around that VLAN. Meaning the cameras cannot talk to the internet or any other host apart from my recording system. It will do for now, but in the long run I'll come up with something more robust.