Dedicated License Plate Cam project

j4co

Pulling my weight
Joined
Jan 17, 2016
Messages
502
Reaction score
175
Location
The Netherlands
To make it more clear, the road is perhaps 4 meter wide here (30 KM/H speeds)

With 2 European cars that looks like this:


2 normal vehicles can pass each other and no one drives this close to the side of the road, so the room between mirrors is something 20-30 cm only.
If there is a larger car (like delivery Van) one of the vehicles need to drive upon the side of the raod.

It appears if my field of view is like this picture (total picture) and I could mask the red zone for ALPR processing only I should be able to catch most if not all license plates (even if cars drive half on the raised edge of the road)
 
Last edited:

bigbadw

Getting the hang of it
Joined
Sep 16, 2014
Messages
203
Reaction score
42
j4co, might I also suggest you design in two License Plate cameras, if possible. What I have found is that, if for a number of reasons, you do not capture a clear picture of the cars License plate looking one direction, the other camera will capture the car after it passes you.

I would place the second camera on the top far end of your house, looking back toward the intersection at the bottom of your drawing.

It has been my experience that having the two opposing cameras captures 98% of all license plates.

Again, just an idea for you as you refine your system.
------------------------------------------------------------------------------------------------------

Would the new IPC-HF5231E box starlight 2MP be a good unit for lpr camera ?
IPC-HF5231E | Dahua Technology

If you can add a lens that brings you close enough to do enough pixels for reliable results, does the 2 MP matter ?
I bought a light cannot already, but need to wait for new house built, but i could prepare cable runs now in the planning phase.

I will have garage/carport near the fence which will be at about 250 cm high.
That looks at an angle on the road which is the entry to the street where the houses are on.


This is a very rough drawing (copyd house outline into the environment drawing) but it shows the environment pretty well.

Number 1 is the road.
The area marked 3 are car parking positions.
Number 6 is walking path in between bushes or lawn (short type of grass or lower plants) and higher bushes (will grown in time, but has all kind of trees.
The trees/bushes are listed as:
Prunus spinosa (1½ tot 3 metres)
Cornus mas (5 en 6 metres)
Ligustrum vulgare (5 metrer)
Crataegus monogyna (5–14 metres)
Rosa canina (1 tot 3 metres)
Viburnum opulus (1.80 - 3 metres)
Euonymus europeaus (4 to 5 metres)

Some of them will grow beyond the camera height so I should stay away from that area.

Could move the camera to green position on the carport roof also, so angle would be less, but distance somewhat longer.
Distance of the area where we built on is like 25 meter deep. So the orange lines are under 20 meter lenght.

Perhaps I could install it lower at just above 2 meter height so it would look direct over the fence wall I intend to install. I will have a Pole for the perimeter units, and could make a bird house on top of it.

The arrow points North, so there will not be any sunlight into this lens.
Only issue might be the * sign with yellow circle round it, in the drawing, which are public lamp posts and they tend to be on when it is dark throughout the night.

I see one other issue, it is max 30 kmh speed there, but people tend to drive faster. Will that be an issue for LPR ?
 

afrmthabay

Young grasshopper
Joined
Dec 9, 2016
Messages
77
Reaction score
9
For the LPR: HF5421E would it reach 35 feet the way it comes or would I have to change the lens out also do you purchase the LPR software separately or did it come with the camera? Thanks for the help?
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
it dont come with a lens.. you must provide a CS Mount lens of your own.
 

MakoMillenium

Young grasshopper
Joined
Dec 17, 2016
Messages
66
Reaction score
20
This is interesting. Some points that don't seem to be obvious.
Zoom lenses are less efficient than fixed focal length lenses as they have more internal elements and pass less light.
More zoom requires a more solid mount.
Starlight cameras will allow a smaller f-stop (for a given shutter speed) and therefore greater depth of field (area in focus)
Depth of field gets shorter and shorter as focal length (zoom) increases.
At night, WDR is the difference between seeing the plate against the lights. Rear lights and plates need less WDR than headlights against plates. With enough WDR the plates can be seen using the light reflected from the headlights.
Plate capture is best done in black and white day and night with a separate camera overview for the rest.
Privacy masking can be used on non plate areas to improve resolution on plate areas for the same bandwidth especially during daylight.
 

hmjgriffon

Known around here
Joined
Mar 30, 2014
Messages
3,386
Reaction score
979
Location
North Florida
Thanks to nextdoor.com, I now hear about break-in's almost weekly in our neighborhood of about 1500 homes...

I have 2 Hikvision 2032's over the driveway and a 2432 on the porch, but they are 4mm and not really enough to catch any plate numbers...

I was thinking about putting up another 2032 at 12mm, but before I go do that, I thought I would ask if there is a better way to detect and track license plates?

Also any software recommendations for this project other than BI that can automagically detect and store plate numbers?



Here's my Hikvision 2032 @ 4mm view...

View attachment 498
How has that cube been working outdoors? I got one the other day for inside of the house to test the motion sensor, which works amazingly, and I was considering putting some outside under the roof of the house, in florida it won't get too extreme of temps and if it doesn't get wet I would think it would be okay but since you've had one outside you'd know.
 

j4co

Pulling my weight
Joined
Jan 17, 2016
Messages
502
Reaction score
175
Location
The Netherlands
Questions regard image storage for alpr.
Nayr posted in dahua thread he stores jpeg images in a database.

Is this standard functionality ? Or do you need a seperate database and some scripting to be able tonstore them.

Would be interested to do this and i can start working on that already before i can put the lpr cam up i guess.
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
actually images are just dumped into a large folder, i just store the image name in the database along with all the output from OpenALPR..

out of the box openalprd will simply dump out jpeg files of suspected plates, and some json data containing its output.. I scrape that json data for database storage.
 

mauzer

n3wb
Joined
Apr 2, 2016
Messages
20
Reaction score
2
actually images are just dumped into a large folder, i just store the image name in the database along with all the output from OpenALPR..

out of the box openalprd will simply dump out jpeg files of suspected plates, and some json data containing its output.. I scrape that json data for database storage.
What do you use for a database? Maybe do you have some teaser of WebGUI for OpenALPR already? Your Github space is still empty. I think you will get a contribution there :)
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
right now its a simple sqlite db but its grown to so many entries I should really reconsider this, its starting to slow down significantly.. it was just something quick and dirty to hold me over and I am not going to expose anyone else to its poor deisgn heh

I have no front end or anything scoped out right now; because infact I need to spend more time designing a proper db backend first.. I cant even list files in the dump folder because there are so many jpg's in there.. I rarely access the data, but when I do need to find something I can manage by hand if I am willing to dig for it.

I probably should do something about it, but I'm thinking of setting up a 2nd camera and that might change how I want to do things in the backend.

i need it to search and see if it has an entry already and just add a new record to that identity instead of duplicating data all the damn time, needs much more logic and thats the trick.. front end will be easy.. I dont have 250k cars that have driven by my house, just captures.. and I only need to keep the last few captures and the textual data.. I also want to be able to have a list of common misreads with correct reads just incase there's a car with a fucked up plate that lives nearby.

I can afford to spend the time analyzing the data and storing it first so searching/parsing through it later is fast and quick.. I dont have that much traffic and it'll all be in a queue.. realtime data on the front end is not really required if traffic is heavy for some reason.

basically I just want one db entry per car, with logs of times it was seen.. and any notes I might have on that vehicle and perhaps images of the last few dozen times it was seen.. so this thing can just run w/out maintenance.. I need a much more complex database, and storage parsing system.. one event can generate multiple captures. sometimes if someone parks in the street (delivery vehicles, taxis, etc) it can generate hundreds of captures, etc.. gotta filter out this junk too.

I'm happy to collaborate, but right now its just drawing board stuff in my head that im learning from field use.
 
Last edited:

j4co

Pulling my weight
Joined
Jan 17, 2016
Messages
502
Reaction score
175
Location
The Netherlands
Mysql seems to have the blob type. I looked at a youtube example and it does not seem to be very hard to insert and retrieve images.

First some cisco exams and than i hope to have time to look at it.
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
id rather keep the image on the filesystem and just store the filename in the database; it will make browsing through a ton of images in the WebUI much less DB intensive..

I'd also like to store some of the alpr data in the jpeg's exif data so if I save off just an image the metadata is retained.

I want this to scale well and the front end to be very fast; so I am very sensitive to designing the database/storage right..
 

j4co

Pulling my weight
Joined
Jan 17, 2016
Messages
502
Reaction score
175
Location
The Netherlands
I am not really limited through experience with databases the last 20 years :)

I can see the advantage of having only pointers/links in a database and not jpeg images as blobs.
On the other hand if you have metadata, it should also easy to store that in the db, and than you could search through that metadata also.

I just looked at openalpr cloud demo and there they also do car color, brand and modell of a car.
If you could store those, it gives also extra possibilitys. But this could be a commecially only option perhaps.
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
im not going to identify those but I will have note fields you can put that info in if you want for cars that frequent the area, for searching reasons.. It'll be usefull when your looking for a vehicle at night, to show pictures taken in the daytime if there are any.

all openalprd does is post json via http with metadata and dump the jpg to a folder.. I have a nodejs app listening for http on local host at that post url and it takes the json and does a http api update to my camera to put the best guess on the OSD, then it dumps the raw json to a .json file for backup, and then inserts the data into a database for easier parsing.. thats it, pretty simple. Each capture has a unique ID thats part of the filename and I use that as the prmary index, the json data also includes the filename.
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
here's a sample of the json data alprd outputs:
Code:
{
  "version": 2,
  "data_type": "alpr_results",
  "epoch_time": 1482438721603,
  "img_width": 2688,
  "img_height": 1520,
  "processing_time_ms": 75.453873,
  "regions_of_interest": [],
  "results": [
    {
      "plate": "128SPH",
      "confidence": 80.330948,
      "matches_template": 1,
      "plate_index": 0,
      "region": "co",
      "region_confidence": 0,
      "processing_time_ms": 32.06918,
      "requested_topn": 10,
      "coordinates": [
        {
          "x": 583,
          "y": 896
        },
        {
          "x": 783,
          "y": 905
        },
        {
          "x": 783,
          "y": 1003
        },
        {
          "x": 583,
          "y": 994
        }
      ],
      "candidates": [
        {
          "plate": "12B5PH",
          "confidence": 90.140877,
          "matches_template": 0
        },
        {
          "plate": "1285PH",
          "confidence": 89.209938,
          "matches_template": 0
        },
        {
          "plate": "12G5PH",
          "confidence": 82.178856,
          "matches_template": 0
        },
        {
          "plate": "12BSPH",
          "confidence": 81.261894,
          "matches_template": 0
        },
        {
          "plate": "128SPH",
          "confidence": 80.330948,
          "matches_template": 1
        },
        {
          "plate": "12BGPH",
          "confidence": 76.701424,
          "matches_template": 0
        },
        {
          "plate": "128GPH",
          "confidence": 75.770485,
          "matches_template": 1
        },
        {
          "plate": "I2B5PH",
          "confidence": 75.552254,
          "matches_template": 0
        },
        {
          "plate": "I285PH",
          "confidence": 74.621315,
          "matches_template": 0
        },
        {
          "plate": "12B5FH",
          "confidence": 74.33007,
          "matches_template": 0
        }
      ]
    }
  ],
  "uuid": "galileo-cam1-1482438721688",
  "camera_id": 1,
  "site_id": "galileo"
}
I could probably determine coming going based off the height of the plate, and when I get multiple captures of same vehicle it'd be dope if I could encode those into a short animated web image, pick the one with highest confidence and then discard the rest.

I'll do grouping based off coordinates and time, if a bunch of requests come in within a second or two then it will see how far the top left corner was from the previous one and just consider em all a continuous read.. sometimes with bike racks/hitches/trailers and stuff it will get a bunch of partials.. If someone parks and the coordinates remain the same then it'll just discard em.

finally captures that get retained in main database will just get moved to a new folder and I'll have a periodic maintenance task to clear the 'cache' of old captures.. so u can still have raw data of everything for last month or so but start getting more frugal with whats kept after that, good for debugging/testing.
 
Last edited:

trock

Young grasshopper
Joined
Feb 7, 2016
Messages
41
Reaction score
2
Quick question for you guys. I am looking to add an LPR camera to my home setup and I wondering if this would be thread to add it to? I wanted to confirm before posting a bunch of information and pics if it was the wrong thread. Thanks again.
 

trock

Young grasshopper
Joined
Feb 7, 2016
Messages
41
Reaction score
2
I am looking at capturing plates as they leave my dead end street. No front plates in my state. Is is possible to mount a camera to the soffit to capture the plates leaving? I have attached a picture (just a screenshot from my mobile phone - I apologize for the quality) of another camera that views my driveway to get an idea of the location of where I would like to mount the LPR and where I would need to grab the plate.

When I get home I can take a picture from the actual spot I would mount the camera to get a more accurate perspective of what the LPR would see it if that helps. I will also measure the exact distance, but I will guesstimate its at-least 60' feet?

Please let me know if you have any questions or if i can provide further details in the meantime.

I was reading through all the pages, however I still am uncertain of what camera to buy. I am currently running HIks with BI. Thanks again.
 

Attachments

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
that one's going to be tough, what about a birdhouse cam near that big electrical box?
 

trock

Young grasshopper
Joined
Feb 7, 2016
Messages
41
Reaction score
2
Yeah. my first thoughts were planting a little tree and mounting in the middle on a pole. However, that involves a considerable amount more in time and money. :) Just for my own knowledge, what makes it tough? The height of the camera off the ground? The distance shouldn't be an issue; it looks like other from reading are capturing past that distance. Thanks again nayr.
 
Top