mirror of
https://github.com/kerberos-io/documentation.git
synced 2026-08-23 15:18:31 +00:00
add people counting addon
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
* [USB camera](#usb-camera)
|
||||
* [IP camera](#ip-camera)
|
||||
* [Raspberry Pi Camera Module](#raspberry-pi-camera-module)
|
||||
* [Raspberry Pi camera](#raspberry-pi-camera)
|
||||
|
||||
The capture device is responsible to take images. The images are used in the four pass way.
|
||||
|
||||
@@ -16,7 +16,9 @@ Kerberos supports a whole range of USB cameras. You will find a complete list [h
|
||||
|
||||
Kerberos can be used with any IP camera, that provides a streaming URL. Make sure that you know the correct URL of your IP camera, you can find [a list here](http://www.ispyconnect.com/sources.aspx). Make sure you have updated the web interface, to make Kerberos aware you will be using an IP camera.
|
||||
|
||||
<a name="raspberry-pi-camera-module"></a>
|
||||
## Raspberry Pi Camera Module
|
||||
<a name="raspberry-pi-camera"></a>
|
||||
## Raspberry Pi camera
|
||||
|
||||
You can use the Raspberry Pi Camera Module with Kerberos, you just need to attach the camera module and you are ready to go. The Raspberry Pi Camera Module is enabled by default in the web interface. Please note that if you didn't installed Kerberos with the image, you will need to enable the camera module yourself.
|
||||
You can use the Raspberry Pi camera with Kerberos.io, you just need to attach the camera and you are ready to go. The Raspberry Pi Camera Module is enabled by default in the web interface. Please note that if you didn't installed Kerberos with the image, you will need to enable the camera module yourself.
|
||||
|
||||
#Streaming
|
||||
55
73_addons/4_People_Counting.md
Normal file
55
73_addons/4_People_Counting.md
Normal file
@@ -0,0 +1,55 @@
|
||||
# People Counting
|
||||
|
||||
Kerberos.io can be used as a people counter by selecting the [**Counter heuristic**](/machinery/heuristics/counter). The idea is that two lines are drawn: the incoming and the outgoing line. Those two lines are necessary to know if the object is incoming or outgoing.
|
||||
|
||||

|
||||
|
||||
If one ore more objects crossed both lines, the number of the incoming and outgoing objects are written to a JSON object (for more information see the [**Counter heuristic**](/machinery/heuristics/counter)). By using the [**Webhook IO device**](/machinery/Outputs/webhook) it's possible to fetch the JSON object and visualize it in your browser.
|
||||
|
||||

|
||||
|
||||
In this tutorial we'll show you how to configure **Kerberos.io**, so that it can be **used as a People counter**, and build a real-time counter which shows the number of incoming and outgoing objects (see screenshot above).
|
||||
|
||||
## Let's get started
|
||||
|
||||
To get started, make sure you have properly [**installed Kerberos.io**](/installation/KiOS) on your device. After the installation go to the settings page and change the settings to following configuration:
|
||||
|
||||
* Algorithm: Background Subtraction,
|
||||
* Heuristic: Counter and
|
||||
* Io: Disk and Webhook.
|
||||
|
||||
### Specific the incoming and outgoing lines
|
||||
|
||||
When opening the counter heuristic, you'll see two lines (a green and red one) which you can move to the position you prefer. Important to note is that the green line is used for counting incoming objects and the red line for outgoing objects. E.g. if we want to count the people which are entering your home, you should arrange the lines as follows.
|
||||
|
||||

|
||||
|
||||
### Specify the webhook url
|
||||
|
||||
The **Webhook Io device** is used to retrieve the number of incoming and outgoing objects; therefore we need to specify an endpoint to which the webhook will post the JSON object. The web application we will create in next paragraph will listen on port 25000, therefore we chage the url of the webhook to:
|
||||
|
||||
http://localhost:250000
|
||||
|
||||
### GUI
|
||||
|
||||
We will create a simple **nodejs** application using **socket.io** which will listen on port 250000 for **POST** events. When the application receives a **POST** event, it will dynamically increase the incoming and/or outgoing counters. To get started we will clone following repository:
|
||||
|
||||
git clone https://github.com/cedricve/kerberosio-people-counter
|
||||
cd kerberosio-people-counter
|
||||
|
||||
After the repository is cloned succesfully we will download the necessary packages using **npm**.
|
||||
|
||||
npm install
|
||||
|
||||
Run the app with following command
|
||||
|
||||
node server.js
|
||||
|
||||
Following output will be generated:
|
||||
|
||||
info - socket.io started
|
||||
Server running on port 25000
|
||||
|
||||
Open your browser and browse to **http://localhost:25000**
|
||||
|
||||

|
||||
BIN
73_addons/4_people_counting.png
Normal file
BIN
73_addons/4_people_counting.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 510 KiB |
BIN
73_addons/4_people_counting_gui.png
Normal file
BIN
73_addons/4_people_counting_gui.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 432 KiB |
BIN
73_addons/4_people_counting_hostname.png
Normal file
BIN
73_addons/4_people_counting_hostname.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 319 KiB |
BIN
73_addons/4_people_counting_lines.png
Normal file
BIN
73_addons/4_people_counting_lines.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 554 KiB |
Reference in New Issue
Block a user