mirror of
https://github.com/kerberos-io/documentation.git
synced 2026-09-09 17:58:34 +00:00
fixes for new parser
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
* [Features](#features)
|
||||
* [Installation](#installation)
|
||||
|
||||
|
||||
<a name="why-kerberos-io"></a>
|
||||
## Why Kerberos.io?
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#CC-NC-ND
|
||||
# CC-NC-ND
|
||||
|
||||
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
|
||||
|
||||
@@ -6,9 +6,9 @@ BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE B
|
||||
|
||||
## Exceptions / Commercial use
|
||||
|
||||
Any exceptions regarding this license, and/or business opportunities should be discussed with **cedric@verstraeten.io**.
|
||||
Any exceptions regarding this license, and/or business opportunities should be discussed with **cedric@verstraeten.io**.
|
||||
|
||||
##Definitions
|
||||
## Definitions
|
||||
|
||||
"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
|
||||
"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
|
||||
@@ -72,4 +72,4 @@ If any provision of this License is invalid or unenforceable under applicable la
|
||||
No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
|
||||
|
||||
This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
|
||||
The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
|
||||
The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#First things first
|
||||
# First things first
|
||||
|
||||
The reason why you're on this page is because you want to know **how to install Kerberos.io** on your microcontroller, Docker, local working station, server or whatever Linux environment you prefer. The good news is that we have **different approaches** from basic to advanced; it depends on how you want to install it.
|
||||
|
||||
@@ -8,13 +8,13 @@ Before you decide which installation method you will use, it might be interestin
|
||||
|
||||
When deploying on the Raspberry Pi there are two possible solutions. You can use our custom OS, [**KiOS**](installation/KiOS) (Kerberos.io Operating System), which is production-ready or install it on an existing OS, [**Raspbian**](installation/Raspbian).
|
||||
|
||||
###KiOS
|
||||
### KiOS
|
||||
|
||||
[KiOS](https://github.com/kerberos-io/kios) is a custom linux OS (created by Buildroot) which runs Kerberos.io out-of-the-box. This is the **most simple** and **basic** installation procedure. Note that with KiOS you don't have multiple camera support.
|
||||
|
||||
<div style="float:right;margin-top:-15px;"><a href="installation/KiOS" style="color:#fff;background-color:#943633;border-radius:7px;padding:8px;">Install KiOS</a></div>
|
||||
|
||||
###Raspbian
|
||||
### Raspbian
|
||||
|
||||
If you already have a Raspberry Pi running with Raspbian, you probably **don't want to reflash your SD card**. Therefore you can install and download the different parts of Kerberos.io (the machinery and the web) without the need for complex and time consuming compiling.
|
||||
|
||||
@@ -26,13 +26,13 @@ If you have <a target="_blank" href="https://www.armbian.com/download/">*an Armb
|
||||
|
||||
<div style="float:right;margin-top:-15px;"><a href="installation/Armbian" style="color:#fff;background-color:#943633;border-radius:7px;padding:8px;">Install on Armbian</a></div>
|
||||
|
||||
##Docker
|
||||
## Docker
|
||||
|
||||
A Docker image is available on the Docker Hub for **x86 machines**. By using docker-compose you can run Kerberos.io with a one-liner.
|
||||
|
||||
<div style="float:right;margin-top:-15px;"><a href="installation/Docker" style="color:#fff;background-color:#943633;border-radius:7px;padding:8px;">Run on Docker</a></div>
|
||||
|
||||
##Generic
|
||||
## Generic
|
||||
|
||||
You can install Kerberos.io on any Linux based OS like Ubuntu, Debian, Raspbian, OSX, etc. The only thing you need to do is to compile the machinery and install the web interface. Kerberos.io can't be compiled on a native Windows machine, if you want to use Kerberos.io on windows you should Docker.
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ Reboot the system (or only Nginx).
|
||||
|
||||
When a new release is available, new docker images are available [**on the docker hub**](https://hub.docker.com/u/kerberos/). There are two possible ways to upgrade your docker containers.
|
||||
|
||||
### Append or change versio number
|
||||
### Append or change version number
|
||||
|
||||
The easiest way is to update your **docker-compose.yml** file by changing or adding the version number.
|
||||
|
||||
@@ -62,7 +62,6 @@ The easiest way is to update your **docker-compose.yml** file by changing or add
|
||||
image: kerberos/machinery:v2.2.0
|
||||
ports:
|
||||
- "8889"
|
||||
|
||||
web:
|
||||
image: kerberos/web:v2.2.0
|
||||
ports:
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
* [Power on the Raspberry Pi](#poweron)
|
||||
* [Access the Raspberry Pi with SSH](#access)
|
||||
|
||||
|
||||
## Introduction
|
||||
|
||||
[KiOS](https://github.com/kerberos-io/kios) (Kerberos.io Operating System) is our own **custom linux OS**, which runs Kerberos.io out-of-the-box. KiOS is **installed like every other OS** for the Raspberry Pi, you need to flash the OS (.img) to a SD card. If you want to get Kerberos.io up and running at a short time frame, this is the **most simple** and **basic** installation procedure.
|
||||
@@ -52,14 +53,14 @@ Installing <b>Kerberos.io</b> to your IoT device, has never been so easy. By usi
|
||||
|
||||
<p>All releases are stored on the KiOS <a href="https://github.com/kerberos-io/kios"><b>Github repository</b></a>, each release contains several images (for every Raspberry Pi version a different image is created). It's important to download the correct image; installing an image for another Raspberry Pi version will not work. After downloading, make sure to unzip the release.</p>
|
||||
|
||||
<a href="https://github.com/kerberos-io/kios/releases"><img alt="Download KiOS" src="2_kerberos-image.png"/></a>
|
||||
<a href="https://github.com/kerberos-io/kios/releases"><img src="2_kerberos-image.png" alt="Download KiOS"/></a>
|
||||
|
||||
<a name="flash"></a>
|
||||
<h2>2. Flash the .img to a SD card with Etcher.io</h2>
|
||||
|
||||
<p>For the advanced installation <b>we'll use Etcher</b>, it will handle the flashing for us. As you may have noticed the installer, used in the <b>Basic installation</b>, is forked from the original Etcher application. The major difference between Etcher and our own installer is that we've added some configurational sugar on top of Etcher, setup your network configuration and automatic downloading of the KiOS release.</p>
|
||||
|
||||
<a target="_blank" href="https://etcher.io"><img alt="Installing Etcher.io" src="2_etcher.png"/></a>
|
||||
<a target="_blank" href="https://etcher.io"><img src="2_etcher.png" alt="Installing Etcher.io"/></a>
|
||||
|
||||
<p>So the only thing you'll need to do for flashing, the hard way, is to <b><a target="_blank" href="https://etcher.io">go to Etcher.io</a></b> and download the Etcher installer that matches your OS. After installation you can simply open Etcher and go with the flow: <b>select the KiOS image</b> which you've previously downloaded, <b>select your SD card</b> and <b>click the flash button</b>. Tadaaaa, and you're ready to rumble.</p>
|
||||
|
||||
@@ -75,13 +76,10 @@ Installing <b>Kerberos.io</b> to your IoT device, has never been so easy. By usi
|
||||
<pre><code>#####################################################################
|
||||
# Enter the IP-address you want to have, followed by the subnet mask
|
||||
# e.g. 192.168.0.10/24
|
||||
|
||||
static_ip=""
|
||||
|
||||
#####################################################################
|
||||
# Enter the Gateway and DNS, this will be your router in most cases
|
||||
# e.g. 192.168.0.1
|
||||
|
||||
static_gw=""
|
||||
static_dns=""</code></pre>
|
||||
|
||||
@@ -91,7 +89,6 @@ static_dns=""</code></pre>
|
||||
|
||||
<pre><code>update_config=1
|
||||
ctrl_interface=/var/run/wpa_supplicant
|
||||
|
||||
network={
|
||||
scan_ssid=1
|
||||
ssid=""
|
||||
|
||||
@@ -20,7 +20,7 @@ A short video explaining how to install Kerberos.io on Raspbian.
|
||||
## Machinery
|
||||
|
||||
<a name="machinery-install-package"></a>
|
||||
###Install package
|
||||
### Install package
|
||||
|
||||
Update system
|
||||
|
||||
@@ -43,12 +43,12 @@ Start the machinery on start-up, and reboot the system.
|
||||
sudo systemctl enable kerberosio && sudo reboot
|
||||
|
||||
<a name="machinery-configure"></a>
|
||||
###Configure
|
||||
### Configure
|
||||
|
||||
The configuration files can be found at **/etc/opt/kerberosio/config**. By default the Raspberry Pi Camera module is set as capture device. You can update the **config.xml** file to change it to **USBCamera** or **IPCamera**. Images are stored in the **/etc/opt/kerberosio/capture** directory by default; this location can be changed by editing the **io.xml** file.
|
||||
|
||||
<a name="machinery-run"></a>
|
||||
###Run
|
||||
### Run
|
||||
|
||||
After kerberos is installed a binary is available at **/usr/bin/kerberosio**. Just run following command in your terminal to start kerberosio
|
||||
|
||||
@@ -82,19 +82,15 @@ Copy and paste following config file; this file tells nginx where the web will b
|
||||
{
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
|
||||
root /var/www/web/public;
|
||||
index index.html index.htm index.nginx-debian.html;
|
||||
|
||||
server_name kerberos.rpi kerberos.rpi;
|
||||
index index.php index.html index.htm;
|
||||
|
||||
location /
|
||||
{
|
||||
autoindex on;
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
location ~ \.php$
|
||||
{
|
||||
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#Armbian
|
||||
# Armbian
|
||||
|
||||
* [How to install](#how-to-install)
|
||||
* [Machinery](#machinery)
|
||||
@@ -14,7 +14,7 @@
|
||||
## Machinery
|
||||
|
||||
<a name="machinery-install-package"></a>
|
||||
###Install package
|
||||
### Install package
|
||||
|
||||
Update system and install dependency avcodec. These installation instructions assume that a fresh Armbian 5.24 or 5.25 installed.
|
||||
|
||||
@@ -33,12 +33,12 @@ Start the machinery on start-up, and reboot the system.
|
||||
sudo systemctl enable kerberosio && sudo reboot
|
||||
|
||||
<a name="machinery-configure"></a>
|
||||
###Configure
|
||||
### Configure
|
||||
|
||||
The configuration files can be found at **/etc/opt/kerberosio/config**. By default the Raspberry Pi Camera module is set as capture device. This must be changed in the **config.xml** to **USBCamera** or **IPCamera** depending on your camera. Images / videos are stored in the **/etc/opt/kerberosio/capture** directory by default; this location can be changed by editing the **io.xml** file.
|
||||
|
||||
<a name="machinery-run"></a>
|
||||
###Run
|
||||
### Run
|
||||
|
||||
After kerberos is installed a binary is available at **/usr/bin/kerberosio**. Just run following command in your terminal to start kerberosio
|
||||
|
||||
@@ -54,8 +54,9 @@ In case kerberosio does not start and complains about missing libraries, install
|
||||
<a name="web-installation-webserver"></a>
|
||||
### Install webserver + PHP (optional)
|
||||
|
||||
Update the packages and kernel.
|
||||
Add Raspbian package repo and update the packages and kernel.
|
||||
|
||||
echo "deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi" | sudo tee --append /etc/apt/sources.list
|
||||
sudo apt-get update && sudo apt-get upgrade
|
||||
|
||||
Install Nginx and PHP (+extension).
|
||||
@@ -73,19 +74,15 @@ Copy and paste following config file; this file tells nginx where the web will b
|
||||
{
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
|
||||
root /var/www/web/public;
|
||||
index index.html index.htm index.nginx-debian.html;
|
||||
|
||||
server_name kerberos.rpi kerberos.rpi;
|
||||
index index.php index.html index.htm;
|
||||
|
||||
location /
|
||||
{
|
||||
autoindex on;
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
location ~ \.php$
|
||||
{
|
||||
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
A Docker image (x86) is available on [**the Docker Hub**](https://hub.docker.com/u/kerberos/). Before you can run this image you will have to get [**Docker**](https://docker.com) installed. After the installation you can use **docker-compose** to get Kerberos.io up and running. More detailed information can be [**found here**](https://blog.cedric.ws/kerberosio-available-on-docker).
|
||||
|
||||
##Docker Compose
|
||||
## Docker Compose
|
||||
|
||||
Create a **docker-compose.yml** file and following configuration:
|
||||
|
||||
|
||||
@@ -105,19 +105,15 @@ Copy and paste following config file; this file tells nginx where the web will b
|
||||
{
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
|
||||
root /var/www/web/public;
|
||||
index index.html index.htm index.nginx-debian.html;
|
||||
|
||||
server_name kerberos.rpi kerberos.rpi;
|
||||
index index.php index.html index.htm;
|
||||
|
||||
location /
|
||||
{
|
||||
autoindex on;
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
location ~ \.php$
|
||||
{
|
||||
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Multi-camera with Docker
|
||||
|
||||
** --- For the moment this approach only works for IP cameras, we don't have a cross-platform method to inject a USB camera or Raspberry Pi camera --- **
|
||||
**--- For the moment this approach only works for IP cameras, we don't have a cross-platform method to inject a USB camera or Raspberry Pi camera ---**
|
||||
|
||||
If you own multiple IP-cameras, then you probably **don't want** to setup **a Raspberry Pi for each camera**. Thanks to Docker there is an easier approach: instead of running multiple machines you can run multiple containers on a single machine. When you're processing a lot of cameras, you can **distribute the cameras/containers across multiple machines** by using **Docker Swarm**.
|
||||
|
||||
@@ -12,7 +12,6 @@ The approach is equal to [**the traditional Docker approach**](/installation/doc
|
||||
image: kerberos/machinery
|
||||
ports:
|
||||
- "8889"
|
||||
|
||||
web:
|
||||
image: kerberos/web
|
||||
ports:
|
||||
@@ -31,7 +30,6 @@ Instead of running docker-compose up, we add an additional parameter **-p**. Thi
|
||||
If you type in the **docker ps** command, you'll get an overview of all the containers that are started; see a stripped output below. In the ports section you'll see the ports that have been exposed to access the web interface of each project.
|
||||
|
||||
$ docker ps
|
||||
|
||||
CONTAINER ID IMAGE CREATED PORTS NAMES
|
||||
30f74ea52852 kerberos/web 3 seconds ago 443/tcp, 0.0.0.0:32779->80/tcp cameragarden_web_1
|
||||
873d6bae8ea1 kerberos/machinery 5 seconds ago 0.0.0.0:32778->8889/tcp cameragarden_machinery_1
|
||||
@@ -42,4 +40,4 @@ If you type in the **docker ps** command, you'll get an overview of all the cont
|
||||
|
||||
If we want to connect to the web interface of the **cameragarden** container, we can open our browser and enter the url **http://your-ip:32779**.
|
||||
|
||||

|
||||

|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Multi-camera on Raspbian
|
||||
|
||||
When you've installed Kerberos.io on your **Raspbian** installation, then you have the possibility **to connect one or more cameras** to the Raspberry Pi. Please note that this functionality **isn't available out-of-the-box**, and therefore requires some technical skills to configure.
|
||||
When you've installed Kerberos.io on your **Raspbian** installation, then you have the possibility **to connect one or more cameras** to the Raspberry Pi. Please note that this functionality **isn't available out-of-the-box**, and therefore requires some technical skills to configure.
|
||||
|
||||
## Install Raspbian
|
||||
|
||||
@@ -24,7 +24,7 @@ What this will do is start two new kerberosio processes, and **connect each USB
|
||||
|
||||
## Where can I find those variables?
|
||||
|
||||
When Kerberos.io is started it will write to a log file located at**/etc/opt/kerberosio/logs/log.stash**, which you can see on the system page of the web interface. In the log file you'll see the startup configuration with all the different settings. You can overwrite every setting which is listed in this overview, just keep in mind that you have to prefix every option with **a double dash --**.
|
||||
When Kerberos.io is started it will write to a log file located at **/etc/opt/kerberosio/logs/log.stash**, which you can see on the system page of the web interface. In the log file you'll see the startup configuration with all the different settings. You can overwrite every setting which is listed in this overview, just keep in mind that you have to prefix every option with **a double dash --**.
|
||||
|
||||
26/10/2016 08:11:36.135 INFO [trivial] Reading configuration
|
||||
26/10/2016 08:11:36.141 INFO [trivial] Final configuration:
|
||||
@@ -57,4 +57,3 @@ When Kerberos.io is started it will write to a log file located at**/etc/opt/ker
|
||||
## Where can I find my images?
|
||||
|
||||
All images will be stored at the same location, so they will be mixed in the webinterface. We don't provide a way to see the images independent (on a camera basis), if you would like to have this then you should check out our [**cloud application**](https://cloud.kerberos.io) which has some additional features.
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ The web is created with two frameworks and a lot of third-party libraries.
|
||||
<a name="laravel"></a>
|
||||
### Laravel 5.4
|
||||
|
||||
[**Laravel**]((http://laravel.com) is a very **powerful** and **popular** PHP framework. This is also the main reason why the web is created with Laravel, the community is huge. A lot of people are writing tutorials and recording webcasts. This makes **getting started** with contributing to the web repository so **easy**. You will find all the information you need on the Laravel [**documentation site**](http://laravel.com/docs/5.4).
|
||||
[**Laravel**](http://laravel.com) is a very **powerful** and **popular** PHP framework. This is also the main reason why the web is created with Laravel, the community is huge. A lot of people are writing tutorials and recording webcasts. This makes **getting started** with contributing to the web repository so **easy**. You will find all the information you need on the Laravel [**documentation site**](http://laravel.com/docs/5.4).
|
||||
|
||||
<a name="backbonejs"></a>
|
||||
### BackboneJS
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* [Client](#client)
|
||||
* [Settings page](#settings-page)
|
||||
|
||||
|
||||
The web contains several important concepts and this is the right place where we will explain them briefly.
|
||||
|
||||
<a name="file-structure"></a>
|
||||
|
||||
@@ -11,7 +11,7 @@ If you want to integrate Kerberos.io into your own application, you're at the ri
|
||||
|
||||
## Authentication
|
||||
|
||||
To use the RESTfull API of your Kerberos.io instance you need to define an **Authorization header** with each request. We use **Basic Authentication** to secure the different **endpoints**.
|
||||
To use the RESTfull API of your Kerberos.io instance you need to define an **Authorization header** with each request. We use **Basic Authentication** to secure the different **endpoints**.
|
||||
|
||||
"Authorization": "Basic root:root"
|
||||
|
||||
@@ -54,7 +54,8 @@ A list of all API methods available for version 1.
|
||||
GET api/v1/name
|
||||
</div>
|
||||
<br/>
|
||||
**Description**
|
||||
|
||||
**Description**
|
||||
|
||||
Retrieve the name of your instance.
|
||||
|
||||
@@ -68,7 +69,8 @@ Retrieve the name of your instance.
|
||||
PUT api/v1/name
|
||||
</div>
|
||||
<br/>
|
||||
**Description**
|
||||
|
||||
**Description**
|
||||
|
||||
Change the name of your instance.
|
||||
|
||||
@@ -86,7 +88,8 @@ Similar to **GET api/v1/name**.
|
||||
GET api/v1/condition/enabled
|
||||
</div>
|
||||
<br/>
|
||||
**Description**
|
||||
|
||||
**Description**
|
||||
|
||||
Check if enabled or disabled.
|
||||
|
||||
@@ -101,7 +104,8 @@ Check if enabled or disabled.
|
||||
PUT api/v1/condition/enabled
|
||||
</div>
|
||||
<br/>
|
||||
**Description**
|
||||
|
||||
**Description**
|
||||
|
||||
Activate or disable the system
|
||||
|
||||
@@ -119,7 +123,8 @@ Similar to **GET api/v1/condition/enabled**.
|
||||
GET api/v1/system/health
|
||||
</div>
|
||||
<br/>
|
||||
**Description**
|
||||
|
||||
**Description**
|
||||
|
||||
Check if the machinery is running (the stream is connected).
|
||||
|
||||
@@ -133,7 +138,8 @@ Check if the machinery is running (the stream is connected).
|
||||
POST api/v1/system/reboot
|
||||
</div>
|
||||
<br/>
|
||||
**Description**
|
||||
|
||||
**Description**
|
||||
|
||||
Restart the system.
|
||||
|
||||
@@ -141,6 +147,7 @@ Restart the system.
|
||||
POST api/v1/system/shutdown
|
||||
</div>
|
||||
<br/>
|
||||
**Description**
|
||||
|
||||
**Description**
|
||||
|
||||
Shutdown the system.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* [Compile](#compile)
|
||||
* [Adding a test](#adding-a-test)
|
||||
* [Create the test file](#create-the-test-file)
|
||||
|
||||
|
||||
Contributing to the **machinery** repository requires C++ sklls. This document describes how to contribute to Kerberos.io and describes all the technical stuff you will need to know. If you want to contribute, the first thing you will need to do is installing the source code on your local environment.
|
||||
|
||||
<a name="installation"></a>
|
||||
@@ -41,7 +41,7 @@ That's it..
|
||||
<a name="versioning"></a>
|
||||
## Versioning
|
||||
|
||||
As you've probably seen in the **installation summary** we are hosting our repositories on [**github**](https://github.com/kerberos-io). As any larger project we are also using a versioning strategy; an easy one :) we don't want to get the things complicated. The version strategy is based on this [**branching model**](http://nvie.com/posts/a-successful-git-branching-model/).
|
||||
As you've probably seen in the **installation summary** we are hosting our repositories on [**github**](https://github.com/kerberos-io). As any larger project we are also using a versioning strategy; an easy one :) we don't want to get the things complicated. The version strategy is based on this [**branching model**](http://nvie.com/posts/a-successful-git-branching-model/).
|
||||
|
||||
The model includes:
|
||||
|
||||
@@ -52,7 +52,7 @@ The model includes:
|
||||
The idea is that the **master** branch always contains a stable release and development happens on the **develop** branch. When we plan to create a new release we merge the develop branch to the master branch and create a new release. If **bugs are introduced** in the master branch (stable release), **hotfixes** are pushed to the master branch and merged back to the develop branch. Believe me, it's very straight-forward if you are into it.
|
||||
|
||||
<a name="IDE"></a>
|
||||
##IDE
|
||||
## IDE
|
||||
|
||||
<a name="setup-clion"></a>
|
||||
### CLion
|
||||
@@ -60,7 +60,7 @@ The idea is that the **master** branch always contains a stable release and deve
|
||||
Contributing to the machinery by using CLion is **very easy**. You just need to **open the root folder** of the machinery and run the project. CLion will compile the source code by using cmake. You don't have to do anything.
|
||||
|
||||
<a name="testing"></a>
|
||||
## Testing
|
||||
## Testing
|
||||
|
||||
<a name="continous-integration"></a>
|
||||
### Continous integration
|
||||
@@ -73,7 +73,7 @@ The machinery is build automatically on **Travis-CI**, when a new commit/release
|
||||
We strongly recommend testing as a best practice in complex projects. Therefore the machinery uses the popular C++ test library: Google Test and Google Mock. The tests can be found in the **test** directory. You can run the test by executing following command:
|
||||
|
||||
make check
|
||||
|
||||
|
||||
<a name="adding-a-new-class"></a>
|
||||
## Adding a new class
|
||||
|
||||
@@ -97,12 +97,9 @@ First we will need to create a new header file in the **include/kerberos/machine
|
||||
// The program(s) may be used and/or copied .
|
||||
//
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __AnotherAlgorithm_H_INCLUDED__ // if AnotherAlgorithm.h hasn't been included yet...
|
||||
#define __AnotherAlgorithm_H_INCLUDED__ // #define this so the compiler knows it has been included
|
||||
|
||||
#include "machinery/algorithm/Algorithm.h"
|
||||
|
||||
namespace kerberos
|
||||
{
|
||||
char AnotherAlgorithmName[] = "AnotherAlgorithm";
|
||||
@@ -111,11 +108,9 @@ First we will need to create a new header file in the **include/kerberos/machine
|
||||
private:
|
||||
Image m_result;
|
||||
int m_parameter;
|
||||
|
||||
public:
|
||||
AnotherAlgorithm(){}
|
||||
void setup(const StringMap & settings);
|
||||
|
||||
void initialize(ImageVector & images);
|
||||
Image evaluate(ImageVector & images, JSON & data);
|
||||
void setParameter(int parameter);
|
||||
@@ -135,7 +130,6 @@ The inheritance of the creator class can be a little bit strange, but it is requ
|
||||
Ofcourse we also need to have an implementation file, therefore we need to create a new source file in the **src/kerberos/machinery/algorithm** directory. Just like the previous example, you can copy an existing class and implement the member functions you've declared in the header file. An example would be:
|
||||
|
||||
#include "machinery/algorithm/AnotherAlgorithm.h"
|
||||
|
||||
namespace kerberos
|
||||
{
|
||||
void AnotherAlgorithm::setup(const StringMap & settings)
|
||||
@@ -144,24 +138,19 @@ Ofcourse we also need to have an implementation file, therefore we need to creat
|
||||
int parameter = std::atoi(settings.at("algorithms.AnotherAlgorithm.parameter").c_str());
|
||||
setParameter(parameter);
|
||||
}
|
||||
|
||||
void AnotherAlgorithm::initialize(ImageVector & images)
|
||||
{
|
||||
....
|
||||
}
|
||||
|
||||
Image AnotherAlgorithm::evaluate(ImageVector & images, JSON & data)
|
||||
{
|
||||
Image evaluation;
|
||||
|
||||
... do something ..
|
||||
|
||||
Image evaluation;
|
||||
... do something ..
|
||||
return evaluation;
|
||||
}
|
||||
|
||||
void AnotherAlgorithm::setParameter(int parameter)
|
||||
{
|
||||
m_parameter = parameter;
|
||||
m_parameter = parameter;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +164,6 @@ Open the CMakeLists.txt in the **src/kerberos** directory file and append the na
|
||||
# - classes are registered on compile time, so they
|
||||
# don't belong to a library. New algorithms, expositors
|
||||
# or Io classes belong here.
|
||||
|
||||
set(KERBEROS_FACTORY_ENTITIES
|
||||
capture/USBCamera.cpp
|
||||
machinery/condition/Time.cpp
|
||||
@@ -194,16 +182,14 @@ Open the CMakeLists.txt in the **src/kerberos** directory file and append the na
|
||||
<a name="create-a-new-entry-in-the-config-file"></a>
|
||||
### Create a new entry in the config file
|
||||
|
||||
Open the algorithm.xml file in the **config** directory, and add a new tag with exactly the same name you've used in the header file; so in our example "AnotherAlgorithm". Within the new tag we can add properties that we will be use to configure our algorithm, in our example we defined a field **parameter** so we can add this field in the config file.
|
||||
Open the algorithm.xml file in the **config** directory, and add a new tag with exactly the same name you've used in the header file; so in our example "AnotherAlgorithm". Within the new tag we can add properties that we will be use to configure our algorithm, in our example we defined a field **parameter** so we can add this field in the config file.
|
||||
|
||||
One thing you will need to do is to attach a **type** to a property. The type will be used by the web to **automatically render** the properties. For simplicity we can use the type number, this will show an input box on the settings page of the web where we are able to add numbers.
|
||||
|
||||
<algorithms>
|
||||
|
||||
<AnotherAlgorithm>
|
||||
<parameter type="number">5</parameter>
|
||||
</AnotherAlgorithm>
|
||||
|
||||
</algorithms>
|
||||
|
||||
You can retrieve the parameter in the **setup** function with the settings parameter.
|
||||
@@ -229,40 +215,33 @@ Add a new file to the **test/** directory, prefix the file with **test_** e.g. t
|
||||
#include "gmock/gmock.h"
|
||||
#include "Factory.h"
|
||||
#include "Types.h"
|
||||
|
||||
using ::testing::AtLeast;
|
||||
using ::testing::Return;
|
||||
using namespace kerberos;
|
||||
|
||||
// ----------------------------------------
|
||||
// Enabled condition: allowed function
|
||||
|
||||
TEST(ENABLED_CONDITION, ALLOWED)
|
||||
{
|
||||
Condition * condition = Factory<Condition>::getInstance()->create("Enabled");
|
||||
|
||||
// This is only for mocking
|
||||
ImageVector images;
|
||||
|
||||
StringMap settings;
|
||||
settings["conditions.Enabled.delay"] = "2000";
|
||||
|
||||
// Enable condition
|
||||
settings["conditions.Enabled.active"] = "true";
|
||||
condition->setup(settings);
|
||||
bool canExecute = condition->allowed(images);
|
||||
EXPECT_EQ(true, canExecute);
|
||||
|
||||
// Disable condition
|
||||
settings["conditions.Enabled.active"] = "false";
|
||||
condition->setup(settings);
|
||||
canExecute = condition->allowed(images);
|
||||
EXPECT_EQ(false, canExecute);
|
||||
}
|
||||
}
|
||||
|
||||
### Run tests
|
||||
|
||||
To execute the test you can run the **make check** in the **build/** directory. When you've added a new test file, you will need to execute the **cmake** command again.
|
||||
To execute the test you can run the **make check** in the **build/** directory. When you've added a new test file, you will need to execute the **cmake** command again.
|
||||
|
||||
cd build/
|
||||
cmake ..
|
||||
@@ -285,31 +264,26 @@ You will get following output
|
||||
[ RUN ] ENABLED_CONDITION.ALLOWED
|
||||
[ OK ] ENABLED_CONDITION.ALLOWED (2002 ms)
|
||||
[----------] 1 test from ENABLED_CONDITION (2002 ms total)
|
||||
|
||||
[----------] 2 tests from HELPER
|
||||
[ RUN ] HELPER.T_TO_STRING
|
||||
[ OK ] HELPER.T_TO_STRING (0 ms)
|
||||
[ RUN ] HELPER.NORMALIZE_PATH
|
||||
[ OK ] HELPER.NORMALIZE_PATH (0 ms)
|
||||
[----------] 2 tests from HELPER (0 ms total)
|
||||
|
||||
[----------] 1 test from HULL_EXPOSITOR
|
||||
[ RUN ] HULL_EXPOSITOR.CALCULATE
|
||||
[ OK ] HULL_EXPOSITOR.CALCULATE (1 ms)
|
||||
[----------] 1 test from HULL_EXPOSITOR (1 ms total)
|
||||
|
||||
[----------] 1 test from RECTANGLE_EXPOSITOR
|
||||
[ RUN ] RECTANGLE_EXPOSITOR.CALCULATE
|
||||
[ OK ] RECTANGLE_EXPOSITOR.CALCULATE (0 ms)
|
||||
[----------] 1 test from RECTANGLE_EXPOSITOR (0 ms total)
|
||||
|
||||
[----------] 1 test from SEQUENCE_HEURISTIC
|
||||
[ RUN ] SEQUENCE_HEURISTIC.IS_VALID
|
||||
[ OK ] SEQUENCE_HEURISTIC.IS_VALID (1005 ms)
|
||||
[----------] 1 test from SEQUENCE_HEURISTIC (1005 ms total)
|
||||
|
||||
[----------] Global test environment tear-down
|
||||
[==========] 6 tests from 5 test cases ran. (3008 ms total)
|
||||
[ PASSED ] 6 tests.
|
||||
[100%] Built target check
|
||||
macbook:build cedricverstraeten$
|
||||
macbook:build cedricverstraeten$
|
||||
|
||||
@@ -7,7 +7,6 @@ Kerberos.io supports a whole range of USB-cameras. You will find a complete list
|
||||
The parameters of the USB-camera can be found in the **config/capture.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
|
||||
|
||||
<captures>
|
||||
|
||||
<USBCamera>
|
||||
<frameWidth type="number">1280</frameWidth>
|
||||
<frameHeight type="number">720</frameHeight>
|
||||
@@ -15,7 +14,6 @@ The parameters of the USB-camera can be found in the **config/capture.xml** file
|
||||
<delay type="number">0</delay>
|
||||
<angle type="number">0</angle>
|
||||
</USBCamera>
|
||||
|
||||
</captures>
|
||||
|
||||
### Framewidth and -height
|
||||
|
||||
@@ -7,7 +7,6 @@ Kerberos.io can be used with any IP-camera, that provides a RTSP (or MJPEG) stre
|
||||
The parameters of the IP capture device can be found in the **config/capture.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
|
||||
|
||||
<captures>
|
||||
|
||||
<IPCamera>
|
||||
<url type="text">http://username:password@ipaddress/image.jpg</url>
|
||||
<frameWidth type="number">800</frameWidth>
|
||||
@@ -15,7 +14,6 @@ The parameters of the IP capture device can be found in the **config/capture.xml
|
||||
<delay type="number">0</delay>
|
||||
<angle type="number">0</angle>
|
||||
</IPCamera>
|
||||
|
||||
</captures>
|
||||
|
||||
### URL
|
||||
|
||||
@@ -7,7 +7,6 @@ You can use the Raspberry Pi Camera Module with Kerberos.io. You just need [**to
|
||||
The parameters of the Raspberry Pi Camera Module can be found in the **config/capture.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
|
||||
|
||||
<captures>
|
||||
|
||||
<RaspiCamera>
|
||||
<frameWidth type="number">640</frameWidth>
|
||||
<frameHeight type="number">480</frameHeight>
|
||||
@@ -19,7 +18,6 @@ The parameters of the Raspberry Pi Camera Module can be found in the **config/ca
|
||||
<contrast type="number">0</contrast>
|
||||
<brightness type="number">50</brightness>
|
||||
</RaspiCamera>
|
||||
|
||||
</captures>
|
||||
|
||||
### Framewidth and -height
|
||||
|
||||
@@ -7,12 +7,10 @@ It can be helpful to **enable or disable Kerberos.io at specific times**. Theref
|
||||
The parameters of the Time condition can be found in the **config/condition.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
|
||||
|
||||
<conditions>
|
||||
|
||||
<Time>
|
||||
<times type="timeselection">13:00,15:00-0:01,20:58-0:01,20:59-0:01,19:20-0:01,21:59-0,0-0,0</times>
|
||||
<delay type="number">10000</delay>
|
||||
</Time>
|
||||
|
||||
</conditions>
|
||||
|
||||
|
||||
@@ -22,4 +20,4 @@ The times property contains a list of times, delimited by a "-". The first item
|
||||
|
||||
### Delay
|
||||
|
||||
The delay value is used when the condition failed, so when the current time isn't in the selected time range for that day. In that case Kerberos.io will idle for the specified delay time. The value of the delay is expressed in miliseconds.
|
||||
The delay value is used when the condition failed, so when the current time isn't in the selected time range for that day. In that case Kerberos.io will idle for the specified delay time. The value of the delay is expressed in miliseconds.
|
||||
|
||||
@@ -7,12 +7,10 @@ This condition makes it possible to **disable/enable Kerberos.io**, with a simpl
|
||||
The parameters of the Time condition can be found in the **config/condition.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
|
||||
|
||||
<conditions>
|
||||
|
||||
<Enabled>
|
||||
<active type="bool">true</active>
|
||||
<delay type="number">5000</delay>
|
||||
</Enabled>
|
||||
|
||||
</conditions>
|
||||
|
||||
### Active
|
||||
@@ -21,4 +19,4 @@ The active field is boolean value (true/false). When the active field is true, K
|
||||
|
||||
### Delay
|
||||
|
||||
The delay value is used when the condition failed, so when enabled is set to false. In that case Kerberos.io will idle for the specfied delay time. The value of the delay is expressed in miliseconds.
|
||||
The delay value is used when the condition failed, so when enabled is set to false. In that case Kerberos.io will idle for the specfied delay time. The value of the delay is expressed in miliseconds.
|
||||
|
||||
@@ -6,7 +6,7 @@ To get a more technical explanation: the algoritm will substract 2 or more image
|
||||
|
||||

|
||||
|
||||
In the image above the method of *Collins et al.* is illustrated. For this method we will process three images. The images are a sequence (from left to right), so the first (A) image was taken before the second (B) one, and the second (B) before the third (C) one. Next we will do a first comparision (C-B) of the third (C) image and the second (B) image, and after that we will do a second comparison (C-A) of the third (C) image and first (A) image.
|
||||
In the image above the method of *Collins et al.* is illustrated. For this method we will process three images. The images are a sequence (from left to right), so the first (A) image was taken before the second (B) one, and the second (B) before the third (C) one. Next we will do a first comparision (C-B) of the third (C) image and the second (B) image, and after that we will do a second comparison (C-A) of the third (C) image and first (A) image.
|
||||
|
||||
After the comparison we will end up with two difference images (C-B) and (C-A); both will mark the white pixels as changed pixels and black as non-changed pixels. To finish the algorithm we will do a logical AND-operation of the two difference images; this will give us the final black and white image ((C-B)&&(C-A)).
|
||||
|
||||
@@ -19,12 +19,10 @@ A more detailed explanation can be found [here](http://blog.cedric.ws/opencv-sim
|
||||
The parameters of the Differential images algorithm can be found in the *config/algorithm.xml* file, but you can also use the web to modify the parameters. Below you see a default configuration file.
|
||||
|
||||
<algorithms>
|
||||
|
||||
<DifferentialCollins>
|
||||
<erode type="number">5</erode>
|
||||
<threshold type="number">20</threshold>
|
||||
</DifferentialCollins>
|
||||
|
||||
</algorithms>
|
||||
|
||||
### Erode
|
||||
@@ -35,6 +33,6 @@ The higher the number of the erode parameter, the more aggressive the eroding wi
|
||||
|
||||
### Threshold
|
||||
|
||||
When doing the comparison of two images, we won't end up with a clean black and white image. In most of the cases the values will be between 0 and 255; so gray values. This means that the value **0** will mean that both pixels where the same in both image, and values **255** mean that both pixels where totally different in both images. Of course we will also have values between 0-255, so pixels that are a little bit different in both images. So to make the resulting black and white image, we will need to apply a threshold value.
|
||||
When doing the comparison of two images, we won't end up with a clean black and white image. In most of the cases the values will be between 0 and 255; so gray values. This means that the value **0** will mean that both pixels where the same in both image, and values **255** mean that both pixels where totally different in both images. Of course we will also have values between 0-255, so pixels that are a little bit different in both images. So to make the resulting black and white image, we will need to apply a threshold value.
|
||||
|
||||
The threshold will specify how much a pixel has to be different in the two images. So for example when the threshold is 30, it means that the difference between two pixels has to be equal or more then 30. The higher the threshold the more the pixel needs to be different, to be marked as changed.
|
||||
The threshold will specify how much a pixel has to be different in the two images. So for example when the threshold is 30, it means that the difference between two pixels has to be equal or more then 30. The higher the threshold the more the pixel needs to be different, to be marked as changed.
|
||||
|
||||
@@ -9,7 +9,6 @@ The algorithm is described in [**following paper**](http://personal.ee.surrey.ac
|
||||
The parameters of the Background images algorithm can be found in the *config/algorithm.xml* file, but you can also use the web to modify the parameters. Below you see a default configuration file.
|
||||
|
||||
<algorithms>
|
||||
|
||||
<BackgroundSubtraction>
|
||||
<shadows type="text">true</shadows>
|
||||
<history type="number">50</history>
|
||||
@@ -19,7 +18,6 @@ The parameters of the Background images algorithm can be found in the *config/al
|
||||
<dilate type="number">7</dilate>
|
||||
<threshold type="number">20</threshold>
|
||||
</BackgroundSubtraction>
|
||||
|
||||
</algorithms>
|
||||
|
||||
### Shadows
|
||||
@@ -28,7 +26,7 @@ The shadows parameter is a true or false. By using this parameter you can make t
|
||||
|
||||
### History
|
||||
|
||||
This is an integer which tells the system, **the amount of images the system should take into account (history)**, to calculate the background model. The higher the history integer, the more images it will use to calculate the background model. By **increasing the history** you get **a more stable background** model, but a **less flexibl**e. As more images from the past are taken into account, the slower the background model will adapt to a new scenario. E.g. when a car drives into your street, and stands still for 5 minutes.
|
||||
This is an integer which tells the system, **the amount of images the system should take into account (history)**, to calculate the background model. The higher the history integer, the more images it will use to calculate the background model. By **increasing the history** you get **a more stable background** model, but a **less flexibl**e. As more images from the past are taken into account, the slower the background model will adapt to a new scenario. E.g. when a car drives into your street, and stands still for 5 minutes.
|
||||
|
||||
Finding the ideal history parameters, depends heavily in the application you want to use it. In practice this **is achieved by trial and error**.
|
||||
|
||||
@@ -50,4 +48,4 @@ Dilate is exactly the same as the erode parameter, except that it has the revers
|
||||
|
||||
### Threshold
|
||||
|
||||
Find a more detailed explanation at the [**Differential images section**](algorithms/Differential_images).
|
||||
Find a more detailed explanation at the [**Differential images section**](algorithms/Differential_images).
|
||||
|
||||
@@ -7,7 +7,6 @@ This rectangle is a trivial expositor. A rectangle region can be defined to cons
|
||||
The parameters of the rectangle expositor can be found in the **config/expositor.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
|
||||
|
||||
<expositors>
|
||||
|
||||
<Rectangle>
|
||||
<region>
|
||||
<x1 type="number">0</x1>
|
||||
@@ -16,10 +15,9 @@ The parameters of the rectangle expositor can be found in the **config/expositor
|
||||
<y2 type="number">720</y2>
|
||||
</region>
|
||||
</Rectangle>
|
||||
|
||||
</expositors>
|
||||
|
||||
|
||||
### Region
|
||||
|
||||
The region parameter contains 4 values; x1, y1, x2 and y2 respectively. The values x1 and y1 indicate the x- and y-coordinate of the left upper starting point. The values x2 and y2 are the bottom right coordinates. A virtual rectangle will be drawn from (x1,y1) to (x2,y2). Pixels of interest that lie within this rectangle are valid pixels; if not they are invalid.
|
||||
The region parameter contains 4 values; x1, y1, x2 and y2 respectively. The values x1 and y1 indicate the x- and y-coordinate of the left upper starting point. The values x2 and y2 are the bottom right coordinates. A virtual rectangle will be drawn from (x1,y1) to (x2,y2). Pixels of interest that lie within this rectangle are valid pixels; if not they are invalid.
|
||||
|
||||
@@ -9,14 +9,12 @@ This hull is a more complex expositor than the rectangle. A hull can be selected
|
||||
The parameters of the hull expositor can be found in the **config/expositor.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
|
||||
|
||||
<expositors>
|
||||
|
||||
<Hull>
|
||||
<region type="hullselection">347,361|627,266|975,328|1091,328|1148,413|1158,516|1121,534|962,567|699,648|531,700|243,613|423,550|665,453|850,470|666,361|467,385|325,460|165,372</region>
|
||||
</Hull>
|
||||
|
||||
</expositors>
|
||||
|
||||
|
||||
### Region
|
||||
|
||||
The region parameter contains n values. Each value represents a coordinate (x,y) and are seperated by the "|" delimiter. These coordinates are used to calculate the concave hull. Pixels of interest that lie within the concave hull are valid pixels; if not they are invalid.
|
||||
The region parameter contains n values. Each value represents a coordinate (x,y) and are seperated by the "|" delimiter. These coordinates are used to calculate the concave hull. Pixels of interest that lie within the concave hull are valid pixels; if not they are invalid.
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
# Sequence
|
||||
|
||||
This is a trivial heuristic. The sequence heuristic will store a single integer in memory, that will count the numbers of valid detections. When the heuristic will detect a false detection, it will decrease the count. The sequence heuristic will return true, if a threshold is reached; for example when something was detected three times in a row.
|
||||
This is a trivial heuristic. The sequence heuristic will store a single integer in memory, that will count the numbers of valid detections. When the heuristic will detect a false detection, it will decrease the count. The sequence heuristic will return true, if a threshold is reached; for example when something was detected three times in a row.
|
||||
|
||||
## Parameters
|
||||
|
||||
The parameters of the Sequence heuristic can be found in the **config/heuristic.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
|
||||
|
||||
|
||||
<heuristics>
|
||||
|
||||
<Sequence>
|
||||
<minimumChanges type="number">1</minimumChanges>
|
||||
<minimumDuration type="number">1</minimumDuration>
|
||||
<noMotionDelayTime type="number">2000</noMotionDelayTime>
|
||||
</Sequence>
|
||||
|
||||
</heuristics>
|
||||
|
||||
|
||||
@@ -27,4 +25,4 @@ The minimum number of detections in a row to be a valid detection.
|
||||
|
||||
### No motion delay time
|
||||
|
||||
When the heuristic failed, due to not enough pixels changed or not x detections in a row, the heuristic will idle for some time.
|
||||
When the heuristic failed, due to not enough pixels changed or not x detections in a row, the heuristic will idle for some time.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||

|
||||
|
||||
The quality of the Counter heuristic depends heavily on the accurancy of the chosen algorithm (Differential, Background subtraction, etc). Therefore **we recommend** to use the **Background Subtraction algorithm** as this is the most accurate one; the algorithm is used for segmentation and it will distinguish background and foreground.
|
||||
The quality of the Counter heuristic depends heavily on the accurancy of the chosen algorithm (Differential, Background subtraction, etc). Therefore **we recommend** to use the **Background Subtraction algorithm** as this is the most accurate one; the algorithm is used for segmentation and it will distinguish background and foreground.
|
||||
|
||||
After the algorithm did its magic, the segmented image is used by the Counter heuristic to calculate some features: the **center of mass** is calculated for each foreground segment, and is stored in memory together with the height and width of the segment. By using the coordinates of the center of mass a trajectory is calculated.
|
||||
|
||||
@@ -19,7 +19,7 @@ While the capture device is taking images, the counter heuristic will calculate
|
||||
|
||||
The idea of the feature list is that it contains the trajectory of an object which is moving from one point to another (a person walking by). A feature list exists for every moving object in the viewport of the camera and each feature list contains the sequence of center of masses (the x- and y-coordinates of the object).
|
||||
|
||||
After the center of masses are calculated, existing feature lists are expanded or new feature lists are created (the start of a new object). By using the feature lists, **the direction of the moving objects** can be calculated, as it contains the initial center of mass and the last found center of mass.
|
||||
After the center of masses are calculated, existing feature lists are expanded or new feature lists are created (the start of a new object). By using the feature lists, **the direction of the moving objects** can be calculated, as it contains the initial center of mass and the last found center of mass.
|
||||
|
||||

|
||||
|
||||
@@ -28,9 +28,8 @@ As we know the trajectory of an object (and thus its direction), the intersectio
|
||||
## Parameters
|
||||
|
||||
The parameters of the Counter heuristic can be found in the **config/heuristic.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
|
||||
|
||||
|
||||
<heuristics>
|
||||
|
||||
<Counter>
|
||||
<appearance type="number">5</appearance>
|
||||
<maxDistance type="number">90</maxDistance>
|
||||
@@ -40,7 +39,6 @@ The parameters of the Counter heuristic can be found in the **config/heuristic.x
|
||||
<noMotionDelayTime type="number">1000</noMotionDelayTime>
|
||||
<markers type="twolines">100,100|100,200|200,100|200,200</markers>
|
||||
</Counter>
|
||||
|
||||
</heuristics>
|
||||
|
||||
### Appearance
|
||||
@@ -85,4 +83,4 @@ The whole point of the counter heuristic is counting objects. Therefore when one
|
||||
'token' : 695,
|
||||
'pathToImage' : '1465894497_5-97451_frontdoor_618-317-703-493_5446_695.jpg',
|
||||
'instanceName' : 'frontdoor',
|
||||
]
|
||||
]
|
||||
|
||||
@@ -7,15 +7,13 @@ An image can be saved to disk.
|
||||
The parameters of the Disk output device can be found in the **config/io**.xml file, but you can also use the web to modify the parameters. Below you see a default configuration file.
|
||||
|
||||
<ios>
|
||||
|
||||
<Disk>
|
||||
<fileFormat type="text">timestamp_microseconds_instanceName_regionCoordinates_numberOfChanges_token.jpg</fileFormat>
|
||||
<directory type="text">/etc/opt/kerberosio/capture/</directory>
|
||||
<markWithTimestamp type="bool">false</markWithTimestamp>
|
||||
<timestampColor type="text">white</timestampColor>
|
||||
<privacy type="bool">false</privacy>
|
||||
</Disk>
|
||||
|
||||
</Disk>
|
||||
</ios>
|
||||
|
||||
### File format
|
||||
@@ -44,4 +42,4 @@ The privacy mode can be activated to remove some parts from the image. This espe
|
||||
|
||||
After updating the configuration, you'll see that the pixels outside your region of interest (ROI) are made black; the image below illustrates this.
|
||||
|
||||

|
||||

|
||||
|
||||
@@ -7,22 +7,20 @@ When a valid event is detected, a video will be recorded for x seconds. When mor
|
||||
The parameters of the Video output device can be found in the **config/io**.xml file, but you can also use the web to modify the parameters. Below you see a default configuration file.
|
||||
|
||||
<ios>
|
||||
|
||||
<Video>
|
||||
<fps type="number">3</fps>
|
||||
<recordAfter type="number">5</recordAfter>
|
||||
<maxDuration type="number">120</maxDuration>
|
||||
<extension type="number">mp4</extension>
|
||||
<codec type="number">h264</codec>
|
||||
<fileFormat type="text">timestamp_microseconds_instanceName_regionCoordinates_numberOfChanges_token</fileFormat>
|
||||
<directory type="text">/etc/opt/kerberosio/capture/</directory>
|
||||
<hardwareDirectory type="text">/etc/opt/kerberosio/h264/</hardwareDirectory>
|
||||
<enableHardwareEncoding type="bool">true</enableHardwareEncoding>
|
||||
<markWithTimestamp type="bool">false</markWithTimestamp>
|
||||
<timestampColor type="text">white</timestampColor>
|
||||
<privacy type="bool">false</privacy>
|
||||
</Video>
|
||||
|
||||
<Video>
|
||||
<fps type="number">3</fps>
|
||||
<recordAfter type="number">5</recordAfter>
|
||||
<maxDuration type="number">120</maxDuration>
|
||||
<extension type="number">mp4</extension>
|
||||
<codec type="number">h264</codec>
|
||||
<fileFormat type="text">timestamp_microseconds_instanceName_regionCoordinates_numberOfChanges_token</fileFormat>
|
||||
<directory type="text">/etc/opt/kerberosio/capture/</directory>
|
||||
<hardwareDirectory type="text">/etc/opt/kerberosio/h264/</hardwareDirectory>
|
||||
<enableHardwareEncoding type="bool">true</enableHardwareEncoding>
|
||||
<markWithTimestamp type="bool">false</markWithTimestamp>
|
||||
<timestampColor type="text">white</timestampColor>
|
||||
<privacy type="bool">false</privacy>
|
||||
</Video>
|
||||
</ios>
|
||||
|
||||
### FPS
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
# TCP/IP client
|
||||
|
||||
The TCP/IP client will send a TCP packet to a server.
|
||||
The TCP/IP client will send a TCP packet to a server.
|
||||
|
||||
## Parameters
|
||||
|
||||
The parameters of the TCP/IP client can be found in the **config/io.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
|
||||
|
||||
<ios>
|
||||
|
||||
<TCPSocket>
|
||||
<server type="number">127.0.0.1</server>
|
||||
<port type="number">1337</port>
|
||||
<message type="text">it's so fluffy</message>
|
||||
</TCPSocket>
|
||||
|
||||
</ios>
|
||||
|
||||
### Server
|
||||
@@ -30,4 +28,4 @@ You can send some data to a TCP server.
|
||||
|
||||
## Examples
|
||||
|
||||
More information can be found [here](/addons/TCP_Listener).
|
||||
More information can be found [here](/addons/TCP_Listener).
|
||||
|
||||
@@ -7,13 +7,11 @@ A GPIO pin can be set as output device.
|
||||
The parameters of the GPIO pin can be found in the **config/io.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
|
||||
|
||||
<ios>
|
||||
|
||||
<GPIO>
|
||||
<pin type="number">17</pin>
|
||||
<periods type="number">5</periods>
|
||||
<periodTime type="number">100000</periodTime>
|
||||
</GPIO>
|
||||
|
||||
</ios>
|
||||
|
||||
### Pin
|
||||
@@ -26,4 +24,4 @@ The number of times the pin will be triggered.
|
||||
|
||||
### Period time
|
||||
|
||||
The time in microseconds that the pin will be set *high*.
|
||||
The time in microseconds that the pin will be set *high*.
|
||||
|
||||
@@ -8,11 +8,9 @@ Detailed information (a JSON object) is send as a POST request to a webhook. The
|
||||
The parameters of the webhook can be found in the **config/io.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
|
||||
|
||||
<ios>
|
||||
|
||||
<Webhook>
|
||||
<url type="text">http://kerberos.web/api/v1/webhook</url>
|
||||
</Webhook>
|
||||
|
||||
<url type="text">http://kerberos.web/api/v1/webhook</url>
|
||||
</Webhook>
|
||||
</ios>
|
||||
|
||||
### Url
|
||||
@@ -31,4 +29,4 @@ A JSON object is POSTed to the url you've defined.
|
||||
'token' : 695,
|
||||
'pathToImage' : '1465894497_5-97451_frontdoor_618-317-703-493_5446_695.jpg',
|
||||
'instanceName' : 'frontdoor',
|
||||
]
|
||||
]
|
||||
|
||||
@@ -7,11 +7,9 @@ A bash script can be executed after a valid event was detected. A JSON object is
|
||||
The parameters of the Script output device can be found in the **config/io**.xml file, but you can also use the web to modify the parameters. Below you see a default configuration file.
|
||||
|
||||
<ios>
|
||||
|
||||
<Script>
|
||||
<path type="text">/etc/opt/kerberosio/scripts/run.sh</path>
|
||||
</Script>
|
||||
|
||||
</ios>
|
||||
|
||||
### Path
|
||||
@@ -23,23 +21,18 @@ The location of the script that will be executed on detection.
|
||||
By default the script will point to **/etc/opt/kerberosio/scripts/run.sh**, which contains a template how you should start your script. Note that when using **KiOS**, this script will be read-only, copy it to the **/data** folder and change the path parameter.
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
# -------------------------------------------
|
||||
# This is an example script which illustrates
|
||||
# how to use the Script IO device.
|
||||
#
|
||||
|
||||
# --------------------------------------
|
||||
# The first parameter is the JSON object
|
||||
#
|
||||
# e.g. {"regionCoordinates":[308,250,346,329],"numberOfChanges":194,"timestamp":"1486049622","microseconds":"6-161868","token":344,"pathToImage":"1486049622_6-161868_frontdoor_308-250-346-329_194_344.jpg","instanceName":"frontdoor"}
|
||||
|
||||
JSON=$1
|
||||
|
||||
# -------------------------------------------
|
||||
# You can use python to parse the JSON object
|
||||
# and get the required fields
|
||||
|
||||
name=$(echo $JSON | python -c "import sys, json; print json.load(sys.stdin)['instanceName']")
|
||||
coordinates=$(echo $JSON | python -c "import sys, json; print json.load(sys.stdin)['regionCoordinates']")
|
||||
changes=$(echo $JSON | pythfon -c "import sys, json; print json.load(sys.stdin)['numberOfChanges']")
|
||||
|
||||
@@ -7,7 +7,6 @@ The machinery has the ability to stream your capture device as a MJPG stream.
|
||||
The parameters for the supported streaming protocols can be found in the *config/stream.xml* file, but you can also use the web to modify the parameters. Below you see a default configuration file; at the moment of writing only a MJPG stream is supported.
|
||||
|
||||
<streams>
|
||||
|
||||
<Mjpg>
|
||||
<enabled type="bool">true</enabled>
|
||||
<streamPort type="number">8889</streamPort>
|
||||
@@ -15,7 +14,6 @@ The parameters for the supported streaming protocols can be found in the *config
|
||||
<username type="number"></username>
|
||||
<password type="number">75</password>
|
||||
</Mjpg>
|
||||
|
||||
</streams>
|
||||
|
||||
|
||||
@@ -35,4 +33,4 @@ The quality is a value between [0-100]. The lower the quality, the more the imag
|
||||
|
||||
You can **secure** the MJPEG streaming **with a username and password**. These credentials will be used to authorize your requests using **Basic Authentication**. Please note that once enabled, the live stream on the dashboard page can fail; however it will work if you open it directly in your browser or ip camera client. The format of the streaming url, after authentication enabled, will look as following:
|
||||
|
||||
http://username:password@ip-camera:8899
|
||||
http://username:password@ip-camera:8899
|
||||
|
||||
@@ -8,7 +8,7 @@ One of the addons you can use in combination with Kerberos.io is a TCP Listener.
|
||||
|
||||
You can use **nodejs** to build a simple TCP server, this is a lot easier than if we would have to do it in C; but ofcourse that's also possible. A cool feature would be to use the **say.js** library. You can use **say.js** on OSX/Linux to execute speech to text. So you could send a message from the Kerberos.io instance to the node TCP server, and on receiving the message you could make your TCP server speak.
|
||||
|
||||
For example you can configure the Kerberos.io TCP client with a message "There's someone at the frontdoor". When Kerberos.io detects something it will execute the TCP client and send a TCP packet - which includes the message - to the predefined IP address of the TCP server, afterwards the TCP server will use the say.js library to actually say the message.
|
||||
For example you can configure the Kerberos.io TCP client with a message "There's someone at the frontdoor". When Kerberos.io detects something it will execute the TCP client and send a TCP packet - which includes the message - to the predefined IP address of the TCP server, afterwards the TCP server will use the say.js library to actually say the message.
|
||||
|
||||
<iframe src="//player.vimeo.com/video/122785370?autoplay=0&color=943633" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="width:100%; height: 400px;"></iframe>
|
||||
|
||||
@@ -18,60 +18,53 @@ Install npm
|
||||
|
||||
Create a new node file
|
||||
|
||||
nano listener.js
|
||||
nano listener.js
|
||||
|
||||
and copy-paste the code below
|
||||
|
||||
// Import libraries
|
||||
var net = require('net');
|
||||
var say = require('say');
|
||||
require('date-utils');
|
||||
|
||||
// Variables
|
||||
var listenerPort = 1337;
|
||||
var time1 = new Date();
|
||||
|
||||
net.createServer(function (socket)
|
||||
{
|
||||
// Handle incoming messages from the magnet controller.
|
||||
socket.once('data', function (data)
|
||||
{
|
||||
var time2 = new Date();
|
||||
var timeBetween = time1.getSecondsBetween(time2);
|
||||
if(timeBetween > 30)
|
||||
{
|
||||
say.speak('Victoria', data);
|
||||
}
|
||||
|
||||
time1 = time2;
|
||||
});
|
||||
|
||||
}).listen(listenerPort);
|
||||
|
||||
// Put a friendly message on the terminal of the server.
|
||||
console.log("Kerberos.io listener running at port 1337\n");
|
||||
// Import libraries
|
||||
var net = require('net');
|
||||
var say = require('say');
|
||||
require('date-utils');
|
||||
// Variables
|
||||
var listenerPort = 1337;
|
||||
var time1 = new Date();
|
||||
net.createServer(function (socket)
|
||||
{
|
||||
// Handle incoming messages from the magnet controller.
|
||||
socket.once('data', function (data)
|
||||
{
|
||||
var time2 = new Date();
|
||||
var timeBetween = time1.getSecondsBetween(time2);
|
||||
if(timeBetween > 30)
|
||||
{
|
||||
say.speak('Victoria', data);
|
||||
}
|
||||
time1 = time2;
|
||||
});
|
||||
}).listen(listenerPort);
|
||||
// Put a friendly message on the terminal of the server.
|
||||
console.log("Kerberos.io listener running at port 1337\n");
|
||||
|
||||
Run script
|
||||
|
||||
node listener.js
|
||||
|
||||
node listener.js
|
||||
|
||||
### Pushbullet notifications
|
||||
|
||||
You can expand the Text-To-Speech feature (described above), with pushbullet notifications. Pushbullet is a free notifcation service, which you can use to send messages to your devices; smartphone, tablet, and/or workingstation. You can download the pushbullet node library with **npm**, and use it in the TCP listener.
|
||||
|
||||
npm install pushbullet
|
||||
npm install pushbullet
|
||||
|
||||
When the library is installed correctly, you can use following code in the TCP listener.
|
||||
|
||||
var PushBullet = require('pushbullet');
|
||||
|
||||
var pusher = new PushBullet('your key');
|
||||
|
||||
pusher.devices(function(error, response)
|
||||
{
|
||||
var devices = response.devices;
|
||||
devices.forEach(function(device)
|
||||
{
|
||||
pusher.note(device.device_iden, "Kerberos.io: " + data.toString(), data.toString());
|
||||
});
|
||||
});
|
||||
var PushBullet = require('pushbullet');
|
||||
var pusher = new PushBullet('your key');
|
||||
pusher.devices(function(error, response)
|
||||
{
|
||||
var devices = response.devices;
|
||||
devices.forEach(function(device)
|
||||
{
|
||||
pusher.note(device.device_iden, "Kerberos.io: " + data.toString(), data.toString());
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user