CodeProject.AI Version 2.0

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
25,744
Reaction score
50,264
Location
USA
Is anyone having an issue where with a 4k Camera Codeproject.ai is not detecting and reading plates even when they are visible if zooming a little on the image.

However, If I crop the same 4k snapshot to just a smaller part of the same image, like just the vehicle and then use the c.ai explorer to test it, it does find the plate in the crop.

Frustrating that it doesn't find and OCR the plate in same whole image. Am I missing some Codeproject.AI setting?
Post the full field of screenshot of the image.
 

carteriii

Pulling my weight
Joined
Jan 8, 2016
Messages
154
Reaction score
159
Location
USA
However, If I crop the same 4k snapshot to just a smaller part of the same image, like just the vehicle and then use the c.ai explorer to test it, it does find the plate in the crop.
Does CodeProject.AI explorer also fail on the full image? I ask to help determine whether the problem is CP.AI recognition, or perhaps BlueIris passing a lower-res version to CP.AI. If you're willing to share an attachment here (I assume an embedded image would get reduced) then others can better help. FYI, I use a 4MP (not 4K, but 4MP) camera and it does great.
 

brad9dk32

n3wb
Joined
Jun 7, 2024
Messages
2
Reaction score
0
Location
Bay Area
Does CodeProject.AI explorer also fail on the full image? I ask to help determine whether the problem is CP.AI recognition, or perhaps BlueIris passing a lower-res version to CP.AI. If you're willing to share an attachment here (I assume an embedded image would get reduced) then others can better help. FYI, I use a 4MP (not 4K, but 4MP) camera and it does great.
Post the full field of screenshot of the image.
Which exact camera model?
Camera is IP8M-VB2696EW-AI
Here is an example of photo that with codeproject.ai explorer I get no license plate found but if I crop it to just the car, it finds the license plate and does OCR on it.
Crop of same photo: Dropbox

In codeproject.ai explorer the license plate reader only finds and reads the plate of the crop.
In codeproject.ai explorer yolov5 or yolov8 license-plate model the plate is only found in the crop.

So it does seem like a codeproject.ai problem of not finding the plate in a 4k image.
 
Last edited:

carteriii

Pulling my weight
Joined
Jan 8, 2016
Messages
154
Reaction score
159
Location
USA
I see exactly the same thing with your images, using both CodeProject.AI v2.5.4 and 2.6.2, so this does appear to be an issue with CodeProject.AI and I don't think it has anything to do with BlueIris (with the disclaimer that my wife says I'm often wrong). Perhaps CodeProject.AI is reducing the resolution. I don't know, but at this point you should post the image on the CodeProject.AI forums so someone there can investigate.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
25,744
Reaction score
50,264
Location
USA
Yeah that is a problematic field of view and the wrong camera. You need more OPTICAL zoom.

That is a 4K camera on a sensor designed for 2MP, so it will be really poor at night. And it maxes out at 13.5mm focal length, so you need to have vehicles realistically within 25 feet or so of the camera.

And then in a cul-de-sac, you have the wrong angle and location to get many plates.

Sure you will get some on ideal situations like this parked car, but a car moving thru at a decent speed like a perp...probably not...

Looks like the classic case of trying to do too much with one camera.

Keep in mind CodeProject downrezes the image before being processed, thus compounding your problem.



1718833094254.png

Sure you can get lucky with a lot of digital zoom, but it won't be consistent and will do poorly at night for any vehicle in motion.


1718833146670.png


For best performance, you would have to set the camera up specifically to read plates. You need the proper camera with OPTICAL zoom for the distance you are covering and the angle to get plates.

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 for more details.
 

carteriii

Pulling my weight
Joined
Jan 8, 2016
Messages
154
Reaction score
159
Location
USA
@wittaj As I hope you know, I agree with everything you said about cameras, optical zoom, etc. etc. Having said that, do you know why CP.AI drops the resolution by default? I realize there's a significant performance issue, but shouldn't that be left up to the client application to decide? If someone wants to burn CPU/GPU, why not allow it? If the issue is customer support or reputation for CP.AI because too many people would complain that it's slow, then perhaps CP.AI can default to a downsized image while still allowing a 4k image through some configuration option. That in turn makes me wonder whether in fact CP.AI does allow it with some option that I just don't know about???

Is there some other factor in the decision to downsize images by default that I'm just not thinking about?
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
25,744
Reaction score
50,264
Location
USA
@wittaj As I hope you know, I agree with everything you said about cameras, optical zoom, etc. etc. Having said that, do you know why CP.AI drops the resolution by default? I realize there's a significant performance issue, but shouldn't that be left up to the client application to decide? If someone wants to burn CPU/GPU, why not allow it? If the issue is customer support or reputation for CP.AI because too many people would complain that it's slow, then perhaps CP.AI can default to a downsized image while still allowing a 4k image through some configuration option. That in turn makes me wonder whether in fact CP.AI does allow it with some option that I just don't know about???

Is there some other factor in the decision to downsize images by default that I'm just not thinking about?
It was stated by @MikeLud1 that the AI models are trained for an image no more than 640 x 640 resolution, so when the plate is as small as it is in the example above because the field of view and thus PPF is too low, CPAI will fail every time even if you can digital zoom some images and read the plate.
 

mailseth

Getting the hang of it
Joined
Dec 22, 2023
Messages
138
Reaction score
92
Location
California
FWIW, older models like MobileNet are even lower resolution at 320x320px. I put some tiling functionality into the Coral CPAI module, but don’t expect it to see much use. Maybe if the Coral TPU was more capable, tiling would be more useful, since it would mean running 2x or 4x the number of inferences.
 
Top