Calibrating Masks, this is what I've been doing.. seems to work pretty well, if anyone has a better strategy I am open to alternatives and/or improvements.
you need sample imagery to build your mask.. rip some captures out of your recordings with vehicles in position where you want them captured or run openalprd basically default expecting it to miss stuff but still get you alot of imagery to work with after enough time..
look for:
- Biggest Plate & Smallest Plate, due to distance and angles.. if your capturing both coming and going you need them for both all lined up in roughly the same vertical plane.
- Highest Plate and Lowest Plate, big trucks and lil cars.. the extreme edges.
- No plate image, an image with no vehicles or plates to read.. this is your baseline.
Import all the images into gimp/photoshop as separate layers, put your no plate image as the lowest/background layer and go through and cut everything but the plate area out of all the other layers, leaving the plates in the original location minus the vehicle..
you should now have the big and small plates both coming and going all transposed on-top of each-other, change layer visibility as desired, take your biggest plate size, calculate the width in pixels and add a guide line the same pixels to both the left and right of your plate group.. take your highest plate read and add a guide with a small margin of error, same with your lowest plate read.. you should now have your first mask defined.. this will get refined but its a great starting point.
create a white layer, with a black layer on top and push them to the top.. select the area inside your guides and cut out that section of the black layer, you should now have a black and white mask you can export to a jpeg and put in your openalpr.conf
play with the max_plate_width_percent & max_plate_height_percent options in openalpr.conf with your largest plate capture, get those numbers as small as reasonable while still detecting your plate then add a few percentage for a margin of error, thats unlikely to really be the absolute largest plate you have.
run your no-plate capture through openalprd after you have the above options tuned, take the total processing time on divide it by 1000, round the results down and this is your starting FPS.. so ~200ms would be 5fps, ~100ms would be 10fps, etc.. the smaller we get our mask the higher the FPS we can run.. the higher the FPS we can run the smaller our mask can be.. somewhere is perfection, and with all the variables changing you can just tune it in w/trial and error.. you'll get the feel pretty quickly if you made things better or worse.
fire up openalprd and wait for traffic!
3 options will likely play out:
1. Too much capture, your getting a half dozen plate captures for each vehicle.. so we can shrink our width down on mask incrementally and retry until we get desired # of images on average, and at least one capture for even the fastest speeders.
2. Just enough capture, you nailed it... just keep testing and make sure nothing slips past your mask.
3. Missing captures, your mask it too small and you dont have the performance for the FPS needed to get everyone in that area.. so try: expand the width, lower the fps, back off the resolution, increase zoom.