2a. Configure (camera?
Blue Iris?) such that snapshots are put into a directory for post processing
2b. Possible configuration of ALPR Daemon to monitor stream from camera
I ended up going with option 2b.
There are plenty of tutorials out there on installing openalpr and openalprd, so I won't repeat those here. BUT I will share the critical configuration steps I found:
ALPR needs to be calibrated to your specific image geometry.
The command to do this is:
openalpr-utils-calibrate <filename>
The <filename> should be an actual capture from your camera in it's final position, focus, etc.
Once adjustments are complete, pressing 'o' will output the resulting prewarp parameter. This will need to be pasted into:
/etc/openalpr/openalpr.conf file in the correct placeholder. Example:
; Calibrating your camera improves detection accuracy in cases where vehicle plates are captured at a steep angle
; Use the openalpr-utils-calibrate utility to calibrate your fixed camera to adjust for an angle
; Once done, update the prewarp config with the values obtained from the tool
prewarp = planar,1280.000000,720.000000,-0.000000,0.000000,-0.260000,0.945000,1.000000,0.000000,0.000000
Before configuring the daemon, make sure you can reliably use the openalpr command line on several of your images and get good results.
To set up the daemon (this will monitor a camera stream continuously and output plates that it sees):
Set up the /etc/openalpr/alprd.conf file. You must set a stream. mine is:
stream = rtsp://<username>:<password>@<camera IP>:<camera rtsp port>/cam/realmonitor?channel=1&subtype=2
You can verify successful connection to a stream via the daemon command line:
alprd -f
You should see a message that a successful connection to the video stream was made.
Once that is successful, you are in the home stretch!!!
Other critical parameters to set up in the /etc/openalpr/alprd.conf file are store plates = 1 and store_plates_location = <directory with permissions open such that alpr can put files there> mine are:
; Determines whether images that contain plates should be stored to disk
store_plates = 1
store_plates_location = /var/www/LPR_images/
Also, in order to process these images, you will need to have the daemon POST JSON data to a url at which you have a script ready to process it.
I used:
; upload address is the destination to POST to
upload_data = 1
upload_address = http://<IP address ofserver hosting your process script>/cgi-bin/process_alpr.pl
As a baby step, I started by just ensuring that the script would receive data and output that data to a file.
Once you get this far, you can do anything within your imagination and coding skills with the data!!!
You will now have:
1. A camera physically mounted to clearly view license plates and configured so that you can clearly read plates day and night
2. A server with openalpr and openalprd installed and configured
3. A server running a script that can catch and process JSON data that will be output by alprd
At this point, each plate passing should output a JSON file (via your script), and a jpeg snapshot (to the directory you configured).
The JSON file has the name and location of the jpeg file, and a TON of data regarding what plate number alprd believes it saw.
That's it for now!!! More to come.