Planning : ALPR

FrankOceanXray

Getting the hang of it
Aug 10, 2016
221
18
Some shenanigans in my neighborhood and I like projects:

Seems a camera with a CS mount is common ([FONT=&amp]IPC-HF5421E)[/FONT]. I believe I can mount something very close to the road, however, and would not need a great big lens/zoom. The mailbox is right at the roadway where vehicles turn into... slow moving vehicles <15 MPH.

No need for high MP? Eeen 720p? (just need POE)

Is there an angle to the plane of the headlights that is best (the mailbox would allow for a shallow angle)?

Run openLPR on same computer running BI (openALPR is not strenuous) ?

Hope to use this to document my venture, so to help others.

RESEARCH:

https://www.ipcamtalk.com/showthread.php/516-Dedicated-License-Plate-Cam-project

https://github.com/peters/openalpr-windows


http://warelogic.com/

https://www.policeone.com/police-pr...n-automatic-license-plate-recognition-system/ (good details of install)

http://www.videoanalitika.lt/en/anpr-numeriu-atpazinimo-sistema.html (i have tried the : http://www.videoanalitika.lt/en/index.html sofware and this eats cpu. constant draw of 45 % in a i5 quad core with a 3Mp camera)

RpiB+ (
1) Raspberry Pi (B+) is a no-go. latest rasbian overclocked at 900mhz. compiled openalpr and it takes 20 seconds to process the sample image (480x720 jpg of red golf with uk plate.) that's not gonna work. The windows version doesn't seem to have a 'daemon' option that i can tell. sigh...)

May venture away fom dahua..
https://www.ipcamtalk.com/showthread.php/7259-Huisun-10x-LPR-(License-Plate-Reading)-settings
 
Last edited by a moderator:
CS Mount cameras basically have alot more lens and focal options, they also have back focus which can physically move the image sensor for fine tuning focus.. this is important because in the daytime the focal point for a license plate is further away than at night time and for best performance day/night you need to re-focus.. at night auto-focus wont work unless you have a test-plate fixed outside, so its also important that you can use external API calls to tweak the focus externally.

720p is adequate if your zoomed in to reading plate levels only.. typically this is so tight you'd need one camera for each lane of traffic.. I am running 4MP so I can get most of the street and the sidewalks in the daytime.

OpenALPR has a dewarping option that allows you to work with harsh angles of attack, but the closer you can get to dead on the less work is required processing the image..

OpenALPR uses alot of resources to process video in realtime, I ended up getting a nice gaming video card and building OpenALPR with CUDA hardware acceleration (difficult to accomplish in windows).. without it it was running nearly 200w of cpu power and it was struggling at dusk/dawn as it was taking roughly 200ms to process a frame, now its using ~40w of power and processing 4MP MJPEG @ 28Mbps, 50ms a frame which is realtime @ 20fps and I dont miss anything readable.
 

Attachments

  • galileo-cam1-1463658812981.jpg
    galileo-cam1-1463658812981.jpg
    477.1 KB · Views: 79
  • galileo-cam1-1463711298767.jpg
    galileo-cam1-1463711298767.jpg
    121.8 KB · Views: 76
  • galileo-cam1-1463711849007.jpg
    galileo-cam1-1463711849007.jpg
    162.3 KB · Views: 50
  • IMAG0548.jpg
    IMAG0548.jpg
    351.7 KB · Views: 99
  • galileo-cam1-1460589639572.jpg
    galileo-cam1-1460589639572.jpg
    312.5 KB · Views: 83
  • galileo-cam1-1460589654566.jpg
    galileo-cam1-1460589654566.jpg
    328.9 KB · Views: 76
Last edited by a moderator:
CS Mount cameras basically have alot more lens and focal options, they also have back focus which can physically move the image sensor for fine tuning focus.. this is important because in the daytime the focal point for a license plate is further away than at night time and for best performance day/night you need to re-focus.. at night auto-focus wont work unless you have a test-plate fixed outside, so its also important that you can use external API calls to tweak the focus externally.

720p is adequate if your zoomed in to reading plate levels only.. typically this is so tight you'd need one camera for each lane of traffic.. I am running 4MP so I can get most of the street and the sidewalks in the daytime.

OpenALPR has a dewarping option that allows you to work with harsh angles of attack, but the closer you can get to dead on the less work is required processing the image..

OpenALPR uses alot of resources to process video in realtime, I ended up getting a nice gaming video card and building OpenALPR with CUDA hardware acceleration (difficult to accomplish in windows).. without it it was running nearly 200w of cpu power, now its using ~40w of power.

I like that discrete little bird box for it. What camera are you using in there?
 
  • Like
Reactions: PSPCommOp
I'm glad you are chiming in nayr. I went through your build.

So the coding you did to allow a stand alone video card to do the heavy load of the software is not for Windows?
 
OpenALPR uses alot of resources to process video in realtime, I ended up getting a nice gaming video card and building OpenALPR with CUDA hardware acceleration (difficult to accomplish in windows).. without it it was running nearly 200w of cpu power and it was struggling at dusk/dawn as it was taking roughly 200ms to process a frame, now its using ~40w of power and processing 4MP MJPEG @ 28Mbps, 50ms a frame which is realtime @ 20fps and I dont miss anything readable.
What happened to your rock camera? You moved it to the birdhouse?
 
@pschmehl, yeah I abandoned the rock idea when I wanted it high enough off the ground that snow would not impede its use.


@FrankOceanXray, openalprd has support already coded for cuda offloading.. its not enabled by default, so your going to need to setup a development environment for capable of building ALPRD from source, then installing the cuda development libraries and try to build in support for it.. It was surprisingly tricky to pull off in Linux because of Nvidia's binary kernel module (tip: cuda libraries must match kernel module, reboots are required), I can only imagine what a challenge it'll be for windows users if its even possible to do.
 
@nayr, that is all gibberish to me. I took a class on C+ 15 years ago? I'll need to look into it more. openLPR is not linux only is it? I will need to get a bit deeper. I actually should have good access to ALPR and traffic detection, monitoring, computation type stuff. I would prefer to know the theory of it if you will..so I start off right.

I hope to report back with my findings.
 
Last edited by a moderator:
they dont offer prebuilt executables with Cuda (Nvidia GPU usage) enabled, because its dependent on the version of cuda you have installed and the drivers your running.. so your going to have to compile the code into binaries with cuda support enabled.

more than likely its going to require cygwin to build openalprd from scratch, http://www.cygwin.com/

you dont need to do any coding, just building it with the right flags enabled after installing the cuda developer libraries
 
thats just source code, it has to be compiled into binaries..
If you want to enable CUDA-support for OpenCV add -CudaGeneration <Kepler|Fermi> when executing build.ps1

yes cuda is for offloading it to a nvidia gfx card.. openalprd will only use one core of your cpu, and it will crush your i7.. trying to offload hardware acceleration in BI via Intel Gfx and OpenALPRD via CUDA might not even be possible at the same time.

go ahead and install it now on your BI server, give it a stream off one of your existing cameras and see for your self what framerate it can do in software alone.. I was getting about 4-5fps max w/out cuda, and 20fps with.. 4-5fps was waay too low and fast moving vehicles would be entirely missed.. this was on a over-clocked 4Ghz Phenom II X6 Black
 
Last edited by a moderator:
The computer is on the way. Just won it this morning. Just planning for now. Intend to get the basics set up, dialed in. Then start adding.. one project is never enough, right?

And openALPR is intensive enough an RPi could not be a stand alone handler of the stuff?
 
I tried running OpenALPR on a RPI and got about half a frame per second @ 720p.. its entirely inadequate.
 
Seems higher up, angle at 30* or so is often spoken but in reality when you look at vehicle mounted LPR and a system like the MPH900.. these are very much in line with the vehicle.
 
yeah thats why I am shooting at such a distance, alpr supports a mask so it only looks in a certain area for plates.. another reason to feed it a high resolution image is so you get a higher resolution .jpeg saved off, by default it will scale down an image to 720p for processing but still save whatever size you gave it.

reading plates automatically was pretty tricky to accomplish in a residental environment.. YMMV tremendously.. municipalities have alot better installation options avilable since they own all the easements.
 
Seems higher up, angle at 30* or so is often spoken but in reality when you look at vehicle mounted LPR and a system like the MPH900.. these are very much in line with the vehicle.
 
That is in the software. I am wanting to know how to set it up to work from the jump.. I know tweaks are likely to be needed and invited.. but should this camera be mounted close to the roadway at a height of a mail box (like the commercially available MPH900) or should I go for the high atop a house angled down?

I am on pag 12 of the Dedicated License Plate thread... seems an inexpensive IR mounted close to the road way, and a camera far away at the time. But I do like the idea of a simpler bullet 1.3MP camera right up close.
 
@nayr: Thanks for sharing your ALPR experiences in these threads. I'm curious what fraction of the traffic you see gives you a readable plate? I did some casual tests using some of my frame grabs at http://www.openalpr.com/demo-image.html but only got a few to work. Probably I have too much of an angle to the road.

Interestingly, I tried a 640x352 pixel image with a pretty clear view of a plate which did not work, then I simply upscaled the same image at 200% in MS Paint and that image did work! Obviously the second image didn't have any more real information, but (I presume) the tesseract OCR process was just expecting a certain number of pixels in each letter.
 
Last edited by a moderator:
With Milestone becoming free soon, I noticed they have LPR add-on. It is no good for the free copy though.

I am wondering if BI has plans to release an LPR plug-in.