This repository has been archived by the owner on Jun 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
970 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0"?> | ||
<streams> | ||
|
||
<Mjpg> | ||
<enabled type="bool">true</enabled> | ||
<streamPort type="number">8889</streamPort> | ||
<quality type="number">75</quality> | ||
</Mjpg> | ||
|
||
</streams> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM phusion/baseimage:latest | ||
FROM phusion/baseimage:0.9.16 | ||
|
||
MAINTAINER "Cédric Verstraeten" <[email protected]> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// | ||
// Class: VideoCapture | ||
// Description: Class that plays a video file. | ||
// Created: 17/05/2016 | ||
// Author: Cédric Verstraeten | ||
// Mail: [email protected] | ||
// Website: www.cedric.ws | ||
// | ||
// The copyright to the computer program(s) herein | ||
// is the property of Cédric Verstraeten, Belgium. | ||
// The program(s) may be used and/or copied . | ||
// | ||
///////////////////////////////////////////////////// | ||
|
||
#ifndef __VideoCapture_H_INCLUDED__ // if VideoCapture.h hasn't been included yet... | ||
#define __VideoCapture_H_INCLUDED__ // #define this so the compiler knows it has been included | ||
|
||
#include "capture/Capture.h" | ||
#include "Executor.h" | ||
|
||
namespace kerberos | ||
{ | ||
char VideoCaptureName[] = "VideoCapture"; | ||
class VideoCapture : public CaptureCreator<VideoCaptureName, VideoCapture> | ||
{ | ||
private: | ||
cv::VideoCapture * m_video; | ||
std::string m_path; | ||
|
||
public: | ||
VideoCapture() | ||
{ | ||
try | ||
{ | ||
m_video = new cv::VideoCapture(); | ||
} | ||
catch(cv::Exception & ex) | ||
{ | ||
throw OpenCVException(ex.msg.c_str()); | ||
} | ||
} | ||
|
||
VideoCapture(int width, int height); | ||
virtual ~VideoCapture(){}; | ||
void setup(StringMap & settings); | ||
void setImageSize(int width, int height); | ||
void setRotation(int angle){Capture::setRotation(angle);} | ||
void setDelay(int msec){Capture::setDelay(msec);} | ||
void setPath(std::string path){m_path=path;} | ||
std::string getPath(){return m_path;} | ||
|
||
void grab(); | ||
Image retrieve(); | ||
Image * takeImage(); | ||
|
||
void open(); | ||
void close(); | ||
void update(); | ||
bool isOpened(); | ||
}; | ||
} | ||
|
||
#endif |
45 changes: 45 additions & 0 deletions
45
include/kerberos/machinery/algorithm/BackgroundSubtraction.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// Class: BackgroundSubtraction | ||
// Description: An algorithm to detect motion using background subtraction. | ||
// Created: 17/05/2016 | ||
// Author: Cédric Verstraeten | ||
// Mail: [email protected] | ||
// Website: www.kerberos.io | ||
// | ||
// The copyright to the computer program(s) herein | ||
// is the property of kerberos.io, Belgium. | ||
// The program(s) may be used and/or copied . | ||
// | ||
///////////////////////////////////////////////////// | ||
|
||
#ifndef __BackgroundSubtraction_H_INCLUDED__ // if BackgroundSubtraction.h hasn't been included yet... | ||
#define __BackgroundSubtraction_H_INCLUDED__ // #define this so the compiler knows it has been included | ||
|
||
#include "machinery/algorithm/Algorithm.h" | ||
#include "opencv2/imgcodecs.hpp" | ||
#include "opencv2/video/video.hpp" | ||
|
||
namespace kerberos | ||
{ | ||
char BackgroundSubtractionName[] = "BackgroundSubtraction"; | ||
class BackgroundSubtraction : public AlgorithmCreator<BackgroundSubtractionName, BackgroundSubtraction> | ||
{ | ||
private: | ||
int m_threshold; | ||
Image m_erodeKernel; | ||
Image m_dilateKernel; | ||
Image m_backgroud; | ||
cv::Ptr<cv::BackgroundSubtractorMOG2> m_subtractor; | ||
|
||
public: | ||
BackgroundSubtraction(){} | ||
void setup(const StringMap & settings); | ||
|
||
void setErodeKernel(int width, int height); | ||
void setDilateKernel(int width, int height); | ||
void setThreshold(int threshold); | ||
void initialize(ImageVector & images); | ||
Image evaluate(ImageVector & images, JSON & data); | ||
}; | ||
} | ||
#endif |
Oops, something went wrong.