Blue Iris and CodeProject.AI ALPR

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...
 
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:
@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

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
 
  • Like
Reactions: woolfman72
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.
 
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
 
  • Like
Reactions: truglo
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.
 
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.
 
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.
 
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
 
  • Like
Reactions: InovoEntron
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
 
  • Like
Reactions: InovoEntron
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!
 
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.
 
Yeah, taking the shutter up will help that a lot. Then can work from there.
 
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?

c2kv6ti.jpg


iOMsvvC.jpg
 
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?

c2kv6ti.jpg


iOMsvvC.jpg
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
    }
  }
}