1 #include "../base/ozApp.h"
2 #include "../base/ozListener.h"
3 #include "../providers/ozAVInput.h"
4 #include "../processors/ozMotionDetector.h"
5 #include "../processors/ozFaceDetector.h"
6 #include "../processors/ozShapeDetector.h"
7 #include "../processors/ozRateLimiter.h"
8 #include "../processors/ozImageScale.h"
9 #include "../processors/ozAVFilter.h"
10 #include "../processors/ozMatrixVideo.h"
11 #include "../protocols/ozHttpController.h"
13 #include "../libgen/libgenDebug.h"
19 int main(
int argc,
const char *argv[] )
21 debugInitialise(
"starter-example",
"", 0 );
23 std::cout <<
" ---------------------- Starter Example ------------------\n"
24 " do a export DBG_PRINT=0/1 to turn off/on logs\n"
25 " once running, load up starter-example.html in your browser\n"
26 " You should see a traffic cam window as well as motion detection frames in another\n"
36 AVInput traffic(
"traffic",
"rtsp://170.93.143.139:1935/rtplive/0b01b57900060075004d823633235daa" );
38 peopleOptions.add(
"realtime",
true );
39 peopleOptions.add(
"loop",
true );
40 AVInput people(
"people",
"face-input.mp4", peopleOptions );
46 motionOptions.load(
"OZ_OPT_MOTION_" );
62 faceOptions.set(
"method",
"hog" );
63 faceOptions.set(
"dataFile",
"shape_predictor_68_face_landmarks.dat" );
64 faceOptions.set(
"markup", FaceDetector::OZ_FACE_MARKUP_ALL );
65 FaceDetector peopleDetector( peopleLimiter, faceOptions );
79 MatrixVideo trafficMatrix(
"traffic-matrix", PIX_FMT_YUV420P, 640, 480,
FrameRate( 1, 10 ), 2, 2 );
80 trafficMatrix.registerProvider( *trafficDetector.compImageSlave() );
81 trafficMatrix.registerProvider( *trafficDetector.refImageSlave() );
82 trafficMatrix.registerProvider( *trafficDetector.varImageSlave() );
83 trafficMatrix.registerProvider( *trafficDetector.deltaImageSlave() );
90 httpController.
addStream(
"watch",traffic );
91 httpController.
addStream(
"watch", people );
93 httpController.
addStream(
"detect", trafficDetector );
94 httpController.
addStream(
"detect", peopleDetector );
97 httpController.
addStream(
"debug", trafficMatrix );
void addController(Controller *controller)
Add a controller to permit new connections using specific protocol.
void addStream(const std::string &streamName, const std::string &streamClass)