Skip to content

Instantly share code, notes, and snippets.

View cedricve's full-sized avatar
🎨
Creating the video management platform for the future

Cédric Verstraeten cedricve

🎨
Creating the video management platform for the future
View GitHub Profile
@cedricve
cedricve / ilovecodeigniter.php
Created July 2, 2013 11:29
This Gist was created by scotch.io CodeIgniter Library for Github
Nicholas Cerminara was here. But how!?
cd
mkdir opencv
cd opencv
mkdir src
nano motion.cpp
cd
cd opencv
nano CMakeLists.txt
cmake .
./bin/motion & (it could be possible this throws warning: VIDIOC_QUERYMENU: Invalid argument, but that's nothing serious)
nano upload.sh (paste the rsync commando, save and close)
chmod +x upload.sh (makes it executable)
crontab -e
*/5 * * * * /home/pi/opencv/upload.sh (add this line below)
@cedricve
cedricve / gist:7242190
Last active December 27, 2015 01:08
motion detection
#include <opencv2/opencv.hpp>
#include <iostream>
#include <time.h>
#include <dirent.h>
#include <sstream>
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
using namespace std;
cmake_minimum_required(VERSION 2.4)
PROJECT(MOTION_DETECTION)
# paths
INCLUDE_DIRECTORIES(src)
INCLUDE_DIRECTORIES(/usr/local/include)
LINK_DIRECTORIES(/usr/local/lib)
LINK_DIRECTORIES(/usr/lib)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
#!/bin/bash
#remove all files older than 1 days
date +%H:%M:%S >> /home/pi/opencv/log_upload
echo "removed all files, older than 1days" >> /home/pi/opencv/log_upload
find /home/pi/opencv/pics/* -exec sudo rm -rf {} \; >> /home/pi/opencv/log_upload
printf "\n\n" >> /home/pi/opencv/log_upload