how can I do a simple car counter?

General discussion about Blue Iris
Post Reply
bdfda
Posts: 5
Joined: Tue Mar 12, 2024 5:15 pm

how can I do a simple car counter?

Post by bdfda »

I have CodeProject.AI set up but not really using it yet.

Here are my "AI settings" in Blue Iris:
https://ibb.co/XZyP51S


I don't care about license plates right now, but I would like to count cars, ideally in both directions of the road in front of my property.

- How can I do this?
- can backtrack it and do it on already existing triggered videos?
User avatar
TimG
Posts: 2669
Joined: Tue Jun 18, 2019 10:45 am
Location: Nottinghamshire, UK.

Re: how can I do a simple car counter?

Post by TimG »

I don't think "simple" would be the word I would use. BI5 can identify "car" with CPAI, and it can output "car" via MQTT. The MQTT Payload could then be read by Homeseer or Home Assistant (other home automation systems exist) and the counting would be done there.

So the simplest and cheapest method would be BI5 sending MQTT messages to Home Assistant running on a Raspi.
Forum Moderator.
Problem ? Ask and we will try to assist, but please check the Help file.
bdfda
Posts: 5
Joined: Tue Mar 12, 2024 5:15 pm

Re: how can I do a simple car counter?

Post by bdfda »

Thanks @TimG – I see what you mean. Sounds like for anything more than simple object detection (direction of travel, speed) I'll need to continue to use my raspberry Pi system.

I guess what I was hoping is that I could "backtrack" the videos BlueIris already recorded, and do counts on those but it doesn't seem like that would be possible?

Going forward I'll set up an MQTT message - I just need to figure out how to set that up – I have CodeAI running and plugin Object Detection YOLOv5 6.2. But not sure how the integration with BlueIris is supposed to work.

I see how to set up an MQTT message upon blueIris trigger, but not how to do it when the CodeAI plugin detects a "vehicle".

Was also hoping I could classify large vehicles vs small (like trucks vs regular cars)
User avatar
TimG
Posts: 2669
Joined: Tue Jun 18, 2019 10:45 am
Location: Nottinghamshire, UK.

Re: how can I do a simple car counter?

Post by TimG »

You can, by adding more MQTT "On Alert" actions.

This is what my MQTT looks like from BI5 in my drive cam settings, only sending the MQTT if CPAI has identified a "person":

person.png
person.png (89.67 KiB) Viewed 481 times

That is then read by HomeSeer to turn the drive lights on with conditional (day/night/time ON/ reset) logic - but only when a person has been identified by CPAI. I could also lump together "car,person,truck" as "Required AI objects" and separate them at the Homeseer end, but I think that image makes it clear how simple it can be. Here is another example with a payload allowing variables to be used:

cartruck.png
cartruck.png (89.38 KiB) Viewed 481 times

Now if you figure out how to do you actual counting, please post back here and explain it, as there are always other people trying to figure out the same thing :idea:
Forum Moderator.
Problem ? Ask and we will try to assist, but please check the Help file.
Post Reply