Page 1 of 1
Counting people
Posted: Wed Oct 18, 2017 11:28 am
by davsilveira
Hi guys, I would like to use Zone Minder to create a monitoring system that counts how many people reach an specific point in the camera, this point will be a door, and every time someone pass through this door I want to add to counter.
I've been studing Zone Minder and other open source solutions, and I've been thinking if using Zone Minder blobs and events I can achieve something like that.
Is that possible?
Re: Counting people
Posted: Thu Oct 19, 2017 11:09 pm
by rockedge
yes it is possible. There is a user that did a counter for cars going by on a street. You need to create a zone for the door and then retrieve the count from the amount of events that the zone for the door creates.
this is the thread that contains the code for how one solution works.
viewtopic.php?f=36&t=26066
Re: Counting people
Posted: Fri Oct 20, 2017 12:58 pm
by davsilveira
Thanks rockedge, that was exactly what I was looking for.
Re: Counting people
Posted: Fri Oct 20, 2017 2:54 pm
by rockedge
I added the corrected line to the script for the count per day :
set
$which_monitor to your monitor id.
Code: Select all
<?php
$which_monitor = 2;
$link = mysqli_connect("localhost", "zmuser", "zmpass", "zm");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
if ($result = mysqli_query($link, "SELECT * FROM `Events` WHERE `MonitorId`=$which_monitor AND `StartTime` >= DATE_SUB(CURDATE(), INTERVAL 0 DAY)")) {
echo "Total # of Events :".mysqli_num_rows($result);
/* free result set */
mysqli_free_result($result);
}
?>