Blue Iris and CodeProject.AI ALPR

Alan_F

Getting the hang of it
Joined
May 17, 2019
Messages
64
Reaction score
57
Location
Maryland
Can both you and @Alan_F send BI support what you have done and ask if Ken can add something like this in BI.
I can email it to Ken, but I doubt he'd want to support it being done this way, with so many external applications. Maybe he can produce similar results inside Blue Iris application without too much effort. He already has the internal database with the reads. He would just have to have a way of filtering the clip list based on the Memo field that contains the tag and allow wildcards in the search.

I would probably still run this externally even if Blue Iris added that feature, since having the MySQL database allows for more complicated queries than I would expect to find in a built-in feature. Like, get me all the tags/alerts for midnight to 0200 for the last 4 Saturday and Sunday mornings...
 

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,141
Reaction score
4,118
Location
Brooklyn, NY
I can email it to Ken, but I doubt he'd want to support it being done this way, with so many external applications. Maybe he can produce similar results inside Blue Iris application without too much effort. He already has the internal database with the reads. He would just have to have a way of filtering the clip list based on the Memo field that contains the tag and allow wildcards in the search.

I would probably still run this externally even if Blue Iris added that feature, since having the MySQL database allows for more complicated queries than I would expect to find in a built-in feature. Like, get me all the tags/alerts for midnight to 0200 for the last 4 Saturday and Sunday mornings...
I was able to get it done LOL now to just make it work. This does not exist at this time maybe BI will add this in future updates

1675353845029.png
 
Last edited:

kccustom

Getting the hang of it
Joined
Nov 8, 2014
Messages
100
Reaction score
30
@Alan_F

I am confused here;
  • Create a separate folder to store the images where ALPR detected a tag (outside Blue Iris)
    • The original images are deleted when Blue Iris deletes the clip/alert. Copying them elsewhere allows you to keep them as long as you want
    • This folder should be local to the Node Red instance
Who is writing to this folder Blue Iris or Node Red? Do I have to put a path to it in node red? (My first time using node red)
 

Alan_F

Getting the hang of it
Joined
May 17, 2019
Messages
64
Reaction score
57
Location
Maryland
@Alan_F

I am confused here;
  • Create a separate folder to store the images where ALPR detected a tag (outside Blue Iris)
    • The original images are deleted when Blue Iris deletes the clip/alert. Copying them elsewhere allows you to keep them as long as you want
    • This folder should be local to the Node Red instance
Who is writing to this folder Blue Iris or Node Red? Do I have to put a path to it in node red? (My first time using node red)

Reply is in a new thread: Node Red Dashboard for Blue Iris ALPR
 

sp3ctre

Getting the hang of it
Joined
Sep 29, 2018
Messages
53
Reaction score
28
Location
UK
I am having issues where 0 and O are getting confused. This is understandable as they are identical on UK plates. It is quite a complex issue though as there have been several variations on UK plates over the years, including:

AAA000A
A000AAA
AA00AAA (current one)

Does anyone know if there is any logic to enable us to "figure it out in code"? When I used Rekor Scout it seemed to figure it out ok, so I assume it's possible.

Other than that issue it seems to be doing ok.
 

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,141
Reaction score
4,118
Location
Brooklyn, NY
I am having issues where 0 and O are getting confused. This is understandable as they are identical on UK plates. It is quite a complex issue though as there have been several variations on UK plates over the years, including:

AAA000A
A000AAA
AA00AAA (current one)

Does anyone know if there is any logic to enable us to "figure it out in code"? When I used Rekor Scout it seemed to figure it out ok, so I assume it's possible.

Other than that issue it seems to be doing ok.
Can you PM me some clean images (no BI boxes) so I can see what can be done. I am also see the issues with C & G, Y & V, M, N, & W
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,428
Reaction score
47,545
Location
USA
I am having issues where 0 and O are getting confused. This is understandable as they are identical on UK plates. It is quite a complex issue though as there have been several variations on UK plates over the years, including:

AAA000A
A000AAA
AA00AAA (current one)

Does anyone know if there is any logic to enable us to "figure it out in code"? When I used Rekor Scout it seemed to figure it out ok, so I assume it's possible.

Other than that issue it seems to be doing ok.
You have to remember that Rekor is also a paid service, so they have money, resources, and staff to address this. They will lose paying customers if they cannot get it correct a high percentage of time.

In the USA, most, if not all, states have a format that their state goes by. They may say the first 3 characters are always letters, so then Rekor codes that so that if a number is seen as the first three characters, it will change it to the closest looking letter.

This also requires the additional ability for the AI to recognize states as every state may have a different format.

I see that the UK follows a similar thing.

1675443208376.png


But then of course you also have specialty/vanity plates, older plates with a different format, etc.

It is surprising Rekor can get it right as often as they do.

This CodeProject ALPR program, while great and all, is still a hobbyist type solution, so unless @MikeLud1 clones himself or it becomes a paid subscription service, these types of things will always pop up. It is certainly better than nothing and with a history of plates, it is still valuable. And it is free.

He busts his butt to get it to where it is now and has done a fabulous job and is continuing to do a great job improving this, but to take it to that next level will require a ton of time and resources. He would have to first figure out how to determine which state the plate is and then program it to their naming convention. Then you raise a point about different countries. When do you say it is good enough?

And he may get to a point to where it works for him and thus loses interest in maintaining/supporting this and moves on to something else in his life.
 

sp3ctre

Getting the hang of it
Joined
Sep 29, 2018
Messages
53
Reaction score
28
Location
UK
You have to remember that Rekor is also a paid service, so they have money, resources, and staff to address this. They will lose paying customers if they cannot get it correct a high percentage of time.

In the USA, most, if not all, states have a format that their state goes by. They may say the first 3 characters are always letters, so then Rekor codes that so that if a number is seen as the first three characters, it will change it to the closest looking letter.

This also requires the additional ability for the AI to recognize states as every state may have a different format.

I see that the UK follows a similar thing.

View attachment 152937


But then of course you also have specialty/vanity plates, older plates with a different format, etc.

It is surprising Rekor can get it right as often as they do.

This CodeProject ALPR program, while great and all, is still a hobbyist type solution, so unless @MikeLud1 clones himself or it becomes a paid subscription service, these types of things will always pop up. It is certainly better than nothing and with a history of plates, it is still valuable. And it is free.

He busts his butt to get it to where it is now and has done a fabulous job and is continuing to do a great job improving this, but to take it to that next level will require a ton of time and resources. He would have to first figure out how to determine which state the plate is and then program it to their naming convention. Then you raise a point about different countries. When do you say it is good enough?

And he may get to a point to where it works for him and thus loses interest in maintaining/supporting this and moves on to something else in his life.
I wasn't criticising, I was just asking if anyone knew of existing logic we can use. For example, UK plates do not use the letter I (capital i), so I have a replace function that replaces any instance of I with the number 1. I can do other such cleanup routines before entering the final plate into my database, I just need to understand the logic. I wan't ectually expecting the AI to do this for me.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,428
Reaction score
47,545
Location
USA
I wasn't criticising, I was just asking if anyone knew of existing logic we can use. For example, UK plates do not use the letter I (capital i), so I have a replace function that replaces any instance of I with the number 1. I can do other such cleanup routines before entering the final plate into my database, I just need to understand the logic. I wan't ectually expecting the AI to do this for me.
Oh I know you weren't; I was also pointing it out for anyone else that sees the post after a similar issue. Scattered thru this thread and others are people saying that Rekor or Plate Recognizer is more accurate than this one. Well they should be as they are paid services.

But yeah Mike or someone can certainly write code to fix this by programming the logic of naming convention and tell it for UK plates that replaces a capital i with the number 1.

This is so new that I doubt many have had a chance to start processing post AI with that type of cleanup, although I see that someone has figured out to use Node Red to take it to the next step of logging the plates in a format that will become easily searchable.

It is exciting for sure and I hope I figure out why my computer doesn't like CodeProject so I can start the migration towards this.
 

digger11

Getting comfortable
Joined
Mar 26, 2014
Messages
355
Reaction score
373
Hey @MikeLud1, was the OCR trained with handicap plates? I just captured my first one, and the wheelchair emblem plays hell with the OCR. I think this is the very first DayPlate the ALPR has encountered where at least one of the analyzed images weren't correct.

Below is a composite of the 17 images in the AI analysis of the alert. The 90% result highlighted in red is the one BI returned.

composite.jpg
 

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,141
Reaction score
4,118
Location
Brooklyn, NY
Hey @MikeLud1, was the OCR trained with handicap plates? I just captured my first one, and the wheelchair emblem plays hell with the OCR. I think this is the very first DayPlate the ALPR has encountered where at least one of the analyzed images weren't correct.

Below is a composite of the 17 images in the AI analysis of the alert. The 90% result highlighted in red is the one BI returned.

View attachment 152950
I am also see the same thing. For the OCR I am using PaddleOCR pretrained model. I have tested several of the most popular OCRs and found PaddleOCR to work the best. You can finetune the model that should help with issues like this. I am going to look into finetuning the model in the future.

1675456104161.png
 

TheWaterbug

Getting comfortable
Joined
Oct 20, 2017
Messages
707
Reaction score
1,521
Location
Palos Verdes
I'm definitely going to need a different camera (or a different config). I just installed CPAI and got it functioning, and I thought I'd try to give it some sample images. So I drove my car right in front of the camera, both ways, with my lights on and off, for several seconds, and here's what I got:


I think there's exactly 1 frame in there that was recognizable by the CPAI Explorer: Image: License Plate Reader or Vision: Custom Object: License Plates v2, and that's only after I cropped way in.

Do you think there will ever be a Wiki article on CPAI setup and/or LPR? These are topics that would definitely benefit from a definitive reference!
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,428
Reaction score
47,545
Location
USA
I'm definitely going to need a different camera (or a different config). I just installed CPAI and got it functioning, and I thought I'd try to give it some sample images. So I drove my car right in front of the camera, both ways, with my lights on and off, for several seconds, and here's what I got:


I think there's exactly 1 frame in there that was recognizable by the CPAI Explorer: Image: License Plate Reader or Vision: Custom Object: License Plates v2, and that's only after I cropped way in.

Do you think there will ever be a Wiki article on CPAI setup and/or LPR? These are topics that would definitely benefit from a definitive reference!
That will almost NEVER read a plate at night. The shutter speed is to slow and with all the IR bounce the plate will be all white.

Regarding plates, keep in mind that this is a camera dedicated to plates and not an overview camera also. It is as much an art as it is a science. You will need two cameras. For LPR we need to OPTICALLY zoom in tight to make the plate as large as possible. For most of us, all you see is the not much more than a vehicle in the entire frame. Now maybe in the right location during the day it might be able to see some other things, but not at night.

At night, we have to run a very fast shutter speed (1/2,000) and in B/W with IR and the image will be black. All you will see are head/tail lights and the plate. Some people can get away with color if they have enough street lights, but most of us cannot. Here is a representative sample of plates I get at night of vehicles traveling about 45MPH at 175 feet from my 2MP 5241-Z12E camera (that is all that is needed for plates):

1675078711764.png




See the LPR subforum as this is not a CodeProject issue but a camera setup issue.
 

Mike A.

Known around here
Joined
May 6, 2017
Messages
3,825
Reaction score
6,377
Yeah, taking the shutter up will help that a lot. Then can work from there.
 

brcarls

n3wb
Joined
Jun 30, 2017
Messages
28
Reaction score
16
When I try to enable GPU (CUDA) for the license plate reader module, it stops, then starts and is still in CPU only mode. I have noticed screenshots of other users who have Object Detection set for GPU and LRP is CPU only like my install, so I'm not sure if I should expect GPU mode to work or not... Are there min requirements that my system doesn't meet? Or I have something misconfigured? Or?



 

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,141
Reaction score
4,118
Location
Brooklyn, NY
When I try to enable GPU (CUDA) for the license plate reader module, it stops, then starts and is still in CPU only mode. I have noticed screenshots of other users who have Object Detection set for GPU and LRP is CPU only like my install, so I'm not sure if I should expect GPU mode to work or not... Are there min requirements that my system doesn't meet? Or I have something misconfigured? Or?



Post your modulesettings.json, below are my settings

1675519298420.png

JSON:
{
  "Modules": {
    "ObjectDetectionYolo": {
      "Activate": false,
      "EnvironmentVariables": {
        "USE_CUDA": "True",
        "CPAI_MODULE_SUPPORT_GPU": "True",
        "MODEL_SIZE": "Large"
      }
    },
    "ObjectDetectionNet": {
      "Activate": true,
      "SupportGPU": true,
      "EnvironmentVariables": {
        "USE_CUDA": "True",
        "CPAI_MODULE_SUPPORT_GPU": "True",
        "MODEL_SIZE": "medium"
      }
    },
    "FaceProcessing": {
      "Activate": false,
      "EnvironmentVariables": {
        "USE_CUDA": "True",
        "CPAI_MODULE_SUPPORT_GPU": "True"
      }
    },
    "YOLOv5-3.1": {
      "Activate": false,
      "EnvironmentVariables": {
        "USE_CUDA": "True",
        "CPAI_MODULE_SUPPORT_GPU": "True"
      }
    },
    "TextSummary": {
      "Activate": false
    },
    "OCR": {
      "Activate": false
    },
    "ALPR": {
      "SupportGPU": true
    }
  }
}
 
Top