Dedicated License Plate Cam project

cam235

Pulling my weight
Joined
Oct 5, 2016
Messages
323
Reaction score
164
Just started with this- in a while I could put up a Python example. Right now I've got an Ubuntu box running this modified version of the "Darknet" recognizer GitHub - saiprabhakar/darknet-modified at v0 in batch mode that spits out a file with (detection, probability, x1,y1,x2,y2) data for each image, which I can then use to crop out items and assemble a montage. My low-powered system takes 25 seconds per frame, so not exactly "real time". It will sometimes detect a "person" in the street who is just driving by in a car, if it gets a good enough view in through the window. Maybe good for the backyard if you've got motion from tree branches, or animals that too often trigger simple motion detect.

For a glimpse of the future, check this out- running at 30 fps on 2k x 1k images and detecting and color-coding people, vehicles, signs, trees, and pavement areas, pretty accurately:

 
Last edited:

HalfMoon

Getting the hang of it
Joined
Apr 23, 2017
Messages
38
Reaction score
39
Location
Arizona
And today was OpenALPR fun day. Set this up to scan for Blue Iris motion snapshots and read them and add text to their images. Now to add database integration.

View attachment 18237
@toomscj7 do you have any links to resources for setting this up, or even any personal notes/advice? I have one of these cameras inbound and will be looking to set this up.
 

toomscj7

n3wb
Joined
Jul 2, 2015
Messages
25
Reaction score
19
@toomscj7 do you have any links to resources for setting this up, or even any personal notes/advice? I have one of these cameras inbound and will be looking to set this up.
Biggest thing to consider is the location. Angle to target and distance to target makes a world of difference. Shoot for 20 degrees or less at around 60ft if you can.
 

cam235

Pulling my weight
Joined
Oct 5, 2016
Messages
323
Reaction score
164
Biggest thing to consider is the location. Angle to target and distance to target makes a world of difference. Shoot for 20 degrees or less at around 60ft if you can.
That distance and angle is great if your situation allows; but if you have to go to longer ranges for a good angle, you can still make it work.
 

HalfMoon

Getting the hang of it
Joined
Apr 23, 2017
Messages
38
Reaction score
39
Location
Arizona
Biggest thing to consider is the location. Angle to target and distance to target makes a world of difference. Shoot for 20 degrees or less at around 60ft if you can.
That distance and angle is great if your situation allows; but if you have to go to longer ranges for a good angle, you can still make it work.
Thank you both.

I took out my Bosch Laser measure tonight and it looks like I am about 77 feet distance with 11 feet of total height. Quick calculations say this is about 7 degrees angle of altitude and will be about 40 degrees off axis.

Seem reasonable? I know I'm going to have to test it when the camera comes, but input from experience is highly valuable. I could bring the distance in, but the sideways angle increases and will be less of a square shot due to trees.
 

toomscj7

n3wb
Joined
Jul 2, 2015
Messages
25
Reaction score
19
Thank you both.

I took out my Bosch Laser measure tonight and it looks like I am about 77 feet distance with 11 feet of total height. Quick calculations say this is about 7 degrees angle of altitude and will be about 40 degrees off axis.

Seem reasonable? I know I'm going to have to test it when the camera comes, but input from experience is highly valuable. I could bring the distance in, but the sideways angle increases and will be less of a square shot due to trees.
40 degrees is probably a strecth. You may be able to visually see them, but ALPR will be tough.
 

HalfMoon

Getting the hang of it
Joined
Apr 23, 2017
Messages
38
Reaction score
39
Location
Arizona
Thanks again to both of you.

I went out this morning and found another spot that will get me to about 19 degrees, I will just need to get the wife's approval. In this location I will need to top off the bushes to make sure that they are nowhere close to blocking the view and keep them trimmed back.
 

toomscj7

n3wb
Joined
Jul 2, 2015
Messages
25
Reaction score
19
Thanks again to both of you.

I went out this morning and found another spot that will get me to about 19 degrees, I will just need to get the wife's approval. In this location I will need to top off the bushes to make sure that they are nowhere close to blocking the view and keep them trimmed back.
19 is about where mine is. I get really goid shots there.

I spoke with the Blue ziris developers and they added a millisecond option for snapshots. If you uograde to the latest version its there. You can combine the snapshot on trigger action with an ALPR script.
 

theIdol

n3wb
Joined
Jun 8, 2017
Messages
1
Reaction score
0
Hi, I new to all this and have many questions, but the one that to me is the most important is if you are feeding a stream to alpr and even having a detection mask on how do you get the vehicle mostly in the same spot, I've got 3 or 4 images hopping around inside the detection zone. I have seen someone say that they are getting 100% detection with only one image from the stream, and it looks like the plate is in the same basic area. What sorcery is this?
 

ITHelpMe

Young grasshopper
Joined
Mar 13, 2017
Messages
35
Reaction score
5
OpenALPR issue. For the most part, my LPR setup seems really good. Very clear picture day and night. OpenALPR is reading it sometimes and sometime it does not. What gives? I've given OpenALPR my main stream and 4 cores to work with. Attached is a clip of the street in which cars goes in and out and the mask to detect. I live in the end of a road so there's only 1 way in and out. I have the HFW5231E-Z5 zoomed all the way in. Any tips? Thank you.
upload_2017-9-25_17-10-34.png
upload_2017-9-25_17-10-45.png
 

cam235

Pulling my weight
Joined
Oct 5, 2016
Messages
323
Reaction score
164
If the purple dots indicate auto-detected corners of the plate, it looks pretty close and the program ought to be able to see it. But I think the ALPR code was mostly tested with plates that are very close to horizontal, and it looks like your camera is somewhat tilted.
 

ITHelpMe

Young grasshopper
Joined
Mar 13, 2017
Messages
35
Reaction score
5
If the purple dots indicate auto-detected corners of the plate, it looks pretty close and the program ought to be able to see it. But I think the ALPR code was mostly tested with plates that are very close to horizontal, and it looks like your camera is somewhat tilted.
Thanks. For that specific car, it read it correctly but sometimes other cars in the same spot, ALPR totally ignores them. ALPR code is strange, sometimes it gets plates that are blurred and sometimes it misses ones that very clear. My Z5 camera's focus seems to adjust it's focus on its own from time to time. Not sure whether that contributing to the issue so I'm testing by forcing the focus to a specific setting using CURL and sending the command to it every 5 minutes so it'll retain the same focus. I'll go into ALPR and adjust the tilt to be as horizontal as I can. We'll see if those two thing helps.
 
Last edited:

tangent

IPCT Contributor
Joined
May 12, 2016
Messages
4,338
Reaction score
3,519
OpenALPR issue. For the most part, my LPR setup seems really good. Very clear picture day and night. OpenALPR is reading it sometimes and sometime it does not. What gives? I've given OpenALPR my main stream and 4 cores to work with. Attached is a clip of the street in which cars goes in and out and the mask to detect. I live in the end of a road so there's only 1 way in and out. I have the HFW5231E-Z5 zoomed all the way in. Any tips? Thank you.
View attachment 22097
View attachment 22098
I'm not an OpenALPR expert, but your mask seems pretty goofy to me. Go back a few pages to about here: Dedicated License Plate Cam project
and the post above this / a few pages before. I'd set a nice rectangular mask that covers the area in the middle of the street where license plates pass similar to what nayr did. Above the post I linked he also talks about focus issues.
 

ITHelpMe

Young grasshopper
Joined
Mar 13, 2017
Messages
35
Reaction score
5
I'm not an OpenALPR expert, but your mask seems pretty goofy to me. Go back a few pages to about here: Dedicated License Plate Cam project
and the post above this / a few pages before. I'd set a nice rectangular mask that covers the area in the middle of the street where license plates pass similar to what nayr did. Above the post I linked he also talks about focus issues.
After adjusting the mask, it appears to be better. I've made the mask more simpler. At first I wanted to cover every area because I'm not sure whether cars would sway to one side of the road or if ALPR would miss due to only half a plate captured. Now the plates are capturing with more consistency and almost every plate has 95 confidence. Not sure if that's normal. Not sure if the reduce mask has any relationship to FPS. Would higher FPS be better for ALPR? I'm not sure how I would adjust the FPS level in OpenALPR. I'm only getting between 8-12 FPS in ALPR.

upload_2017-9-26_15-18-28.png
 

tangent

IPCT Contributor
Joined
May 12, 2016
Messages
4,338
Reaction score
3,519
After adjusting the mask, it appears to be better. I've made the mask more simpler. At first I wanted to cover every area because I'm not sure whether cars would sway to one side of the road or if ALPR would miss due to only half a plate captured. Now the plates are capturing with more consistency and almost every plate has 95 confidence. Not sure if that's normal. Not sure if the reduce mask has any relationship to FPS. Would higher FPS be better for ALPR? I'm not sure how I would adjust the FPS level in OpenALPR. I'm only getting between 8-12 FPS in ALPR.

View attachment 22132
Honestly my advice would be to go back to the start of this thread and re-read the entire thing. This will probably take you a few hours.

You provide minimal details about your ALPR setup. What hardware is it running on? What OS? What graphics card? Is it even configured for hardware (GPU) acceleration?
I don't think the Z5 can do this but IDK, some cams can output a substream that's a cropped portion of the larger image. This can reduce the processing OpenALPR does.

You can't "set" FPS (frames per second) that it processes, but if you make the image easier to process or enable gpu acceleration it will increase. If you're using the prebuilt windows installer, I believe it's GPU enabled without any extra effort required.
 

ITHelpMe

Young grasshopper
Joined
Mar 13, 2017
Messages
35
Reaction score
5
I have been interested in setting up an LPR camera and read this thread which made it all look a bit daunting so I thought what the hell I'll download and setup up OpenALPR and give it a go I was up and running in an hour with an existing Camera can't believe how easy it was
Bernie, what camera do you have for the LPR?
 

Bernie199

n3wb
Joined
Sep 19, 2017
Messages
20
Reaction score
1
Bernie, what camera do you have for the LPR?
I'm only using it temporarily but it's
Dahua 4Mp PTZ Full HD 30x Network IR PTZ Dome Camera H.265 with logo SD59430U-HNI
I have Dahua 2MP IPC-HFW5231E-Z12 Bullet Camera Full HD WDR IP67 5.3mm ~64mm 12x zoom lens Network IR Starlight Security Camera on order to take over just hope I can get it to do as well as my ptz
 

ITHelpMe

Young grasshopper
Joined
Mar 13, 2017
Messages
35
Reaction score
5
I have the Z5 and it's working great for me. I may get the Z12 just to play with it and see what's the difference. I think the Z5 may have a wider FOV than the Z12 but in my street, the Z5 is working good and FOV is good for both incoming/outgoing traffic. Z12 has a better zoom but I'm unsure whether the FOV would work in my favor.
 
Top