Having a strange issue with AI...

dockdoc

Young grasshopper
Joined
Dec 27, 2021
Messages
32
Reaction score
16
Location
Charlotte NC
This is on external cameras facing my driveway (two cameras primarily). Camera 3 faces the front of the house (so catches cars / people on their way in) and Camera 2 faces the driveway going back past the house as well as the Side Door of the house.

I started using CodeSense AI (having no previous experience with DeepStack or anything else) a few days ago. It took a lot of trial and error to get set up but I LOVE it. The tech is really amazing, and I've cut down massively on my false alarms.

My basic configuration is: cameras are triggered by motion, record when triggered, and AI is set up to alert to person, car, dog, truck, bus. I have push alerts set up for testing purposes for any of alerts.

During the day everything works perfectly. I get tons of alerts, they're always accurate and seem to be not missing anything.

But as soon as it gets dark I'm missing things. Tonight I drove my truck out and then came back a couple hours later. Cameras didn't pick up any of it.

I arrived at 8:21pm. I checked the log found...

For Camera 3...
  • Cam3 8:21: MOTION_B
  • Cam3 821: AI: Alert cancelled [nothing found] 657ms

Now when I look at the Clips for Cam3 at 8:21, there's me pulling my truck as expected. When I put test overlays with AI it registers car/truck with over 70% confidence (it's set at 50% minimum) all the way through the clip. When testing with motion it clearly highlights the truck as well. So it makes no sense that the alert got cancelled.

Now here's where stuff gets even weirder, For Camera 2... the log is empty at 8:21/22. Nada. The next entry is 20 minutes later, which was appropriately dumped by AI.

However when I go look at the clips at 8:22, there you see my truck, being appropriately recognized by AI and motion.

AND a minute later it appropriately senses and alerts me walking back up the driveway. But none of this is found in the log.

Only thing I can figure is this is a bug. Anyone have any ideas?
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
16,394
Reaction score
30,477
Location
USA
Nighttime is when it struggles. Usually a contrast issue that needs to be adjusted in the camera GUI.

Providing video and photos of the field of view can help those of us experienced with how this works on offering suggestions.
 

dockdoc

Young grasshopper
Joined
Dec 27, 2021
Messages
32
Reaction score
16
Location
Charlotte NC
Nighttime is when it struggles. Usually a contrast issue that needs to be adjusted in the camera GUI.

Providing video and photos of the field of view can help those of us experienced with how this works on offering suggestions.
Here's the field of view as we speak... this is Cam3

One thing I didn't mention is that Cam2 has a motion sensing flood light that illuminates most of the field. So I'd think that would help...

If this doesn't work at night that's a real problem!

1668653227057.png
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
16,394
Reaction score
30,477
Location
USA
Yeah that is a problematic field of view. The edges and peripherals can always be a problem, especially at night. You are trying to do too much with one field of view.

What does the video look like with the motion sensing light - in many instances that temporarily blinds the camera as the exposure adjusts.

I only see headlight bounce on that image, which AI won't ID that as a car - what does it look like with the car in the field of view - are you on default settings resulting in the vehicle looking like more a blur than a vehicle? Or maybe it is a simple adjusting of adding an object you would never see into the to cancel box and add more real time images to be analyzed.

Which camera is this - does it have built in AI and have you tried it?

If you are running default/auto settings, dialing them in to your field of view may help. Adjusting the camera up so the street isn't at the top of the frame could help as well.
 
Last edited:

dockdoc

Young grasshopper
Joined
Dec 27, 2021
Messages
32
Reaction score
16
Location
Charlotte NC
Here's a shot of the truck in the field of view. As you can see the AI seems to work fine, it's detecting it with at least 50% confidence.

I take your point with the motion-light... it does blind the camera for a split second, but then it recovers and picks up people no problem. Just not the car. And even though it picked up the person, it didn't register it as an event of any sort in the log.

Cameras or Loryta
IPC-T3241T-ZAS


1668654051516.png
 

dockdoc

Young grasshopper
Joined
Dec 27, 2021
Messages
32
Reaction score
16
Location
Charlotte NC
I only see headlight bounce on that image, which AI won't ID that as a car - what does it look like with the car in the field of view - are you on default settings resulting in the vehicle looking like more a blur than a vehicle?

Which camera is this - does it have built in AI and have you tried it?
The camera is IPC-T3241T-ZAS and best I can tell it has built-in AI (Smart Motion Detection) and it's enabled (is it supposed to be disabled for Blue Iris to work properly?). I don't honestly know what you mean default settings.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
16,394
Reaction score
30,477
Location
USA
Keep in mind that the "Analyze with Deepstack/SenseAI" under "Testing & Tuning" will ALWAYS perform better than live as it is after the fact and should not be used as an analysis tool to try to figure out why it didn't see and trigger for a car or person. It should only be used to see what DeepStack can find in that clip, like "hmm I wonder if DeepStack can find a toothbrush" and then walk around with a toothbrush and have it identify it. I can run this on a camera not using Deepstack and it will show EVERYTHING that Deepstack has in its objects to find that it sees in the clip. This method will show you EVERY ITEM deepstack searches for.

Yeah the camera going from B/W to color can definitely cause it to be missed depending on which image is being sent.

Do you have the save .dat file for analysis checked to see what it is showing?

Did you manually set the shutter speed is it on auto? And are brightness, contrast, gamma, etc. all set to default 50?
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
16,394
Reaction score
30,477
Location
USA
OK that camera has AI built in, so try using it and see if it is better in detecting a vehicle:

Go into the camera and set up smart plan with IVS, then go to the IVS screen and draw IVS rules (tripwire or intrusion box) and then select the AI you want it to trigger on (human or vehicle).

Then in BI, there are a few places you need to set this up in BI (assuming you already set up the IVS rules in the camera GUI):

  • Go in to BI and select Add Camera
  • Type in the IP address, username, and password
  • Hit the Find/inspect button and let BI choose the right settings.
  • In Camera configure setting check the box "Get ONVIF triggers".
  • Hit Find/Inspect on the camera setting to pull the coding for the triggers.
  • Go into Motion Setting and select the "Cameras digital input" box.
  • On the Alerts tab uncheck the Motions Zones tab (those are alerting you to any BI motion in those areas)
  • On the alerts tab set up how to be notified.


 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
16,394
Reaction score
30,477
Location
USA
Here is my "standard" post that many use as a start for dialing in day and night that helps get the clean captures, but also helps with AI:

Every field of view is different, but I have found you need contrast to usually be 6-8 higher than the brightness number at night.

But first, run H264, smart codec off, CBR, and 8192 bitrate to start, along with 15 FPS and 15 i-frame.

We want the ability to freeze frame capture a clean image from the video at night, and that is only done with a shutter of 1/60 or faster. At night, default/auto may be on 1/12s shutter or worse to make the image bright.

In my opinion, shutter (exposure) and gain are the two most important parameters and then base the others off of it. Shutter is more important than FPS. It is the shutter speed that prevents motion blur, not FPS. 15 FPS is more than enough for surveillance cameras as we are not producing Hollywood movies. Match iframes to FPS. 15FPS is all that is usually needed.

Many people do not realize there is manual shutter that lets you adjust shutter and gain and a shutter priority that only lets you adjust shutter speed but not gain. The higher the gain, the bigger the noise and see-through ghosting start to appear because the noise is amplified. Most people select shutter priority and run a faster shutter than they should because it is likely being done at 100 gain, so it is actually defeating their purpose of a faster shutter.

Go into shutter settings and change to manual shutter and start with custom shutter as ms and change to 0-8.3ms and gain 0-50 (night) and 0-4ms exposure and 0-30 gain (day)for starters. Auto could have a shutter speed of 100ms or more with a gain at 100 and shutter priority could result in gain up at 100 which will contribute to significant ghosting and that blinding white you will get from the infrared or white light.

Now what you will notice immediately at night is that your image gets A LOT darker. That faster the shutter, the more light that is needed. But it is a balance. The nice bright night static image results in Casper blur and ghost during motion LOL. What do we want, a nice static image or a clean image when there is motion introduced to the scene?

In the daytime, if it is still too bright, then drop the 4ms down to 3ms then 2ms, etc. You have to play with it for your field of view.

Then at night, if it is too dark, then start adding ms to the time. Go to 10ms, 12ms, etc. until you find what you feel is acceptable as an image. Then have someone walk around and see if you can get a clean shot. Try not to go above 16.67ms (but certainly not above 30ms) as that tends to be the point where blur starts to occur. Conversely, if it is still bright, then drop down in time to get a faster shutter.

You can also adjust brightness and contrast to improve the image.

You can also add some gain to brighten the image - but the higher the gain, the more ghosting you get. Some cameras can go to 70 or so before it is an issue and some can't go over 50.

But adjusting those two settings will have the biggest impact. The next one is noise reduction. Want to keep that as low as possible. Depending on the amount of light you have, you might be able to get down to 40 or so at night (again camera dependent) and 20-30 during the day, but take it as low as you can before it gets too noisy. Again this one is a balance as well. Too smooth and no noise can result in soft images and contribute to blur.

Do not use backlight features until you have exhausted every other parameter setting. And if you do have to use backlight, take it down as low as possible.

After every setting adjustment, have someone walk around outside and see if you can freeze-frame to get a clean image. If not, keep changing until you do. Clean motion pictures are what we are after, not a clean static image.
 

dockdoc

Young grasshopper
Joined
Dec 27, 2021
Messages
32
Reaction score
16
Location
Charlotte NC
Thank you guys for this great advice! I'm going to take some time and mess around with settings based on this.

I also noticed in my camera settings that FPS and iFrame were at different settings (30 / 60, respectively). That's also ill advised, no? I changed it to 30 / 30 for now.
 
Top