Skip to content

Instantly share code, notes, and snippets.

View alexanderkoumis's full-sized avatar

Alexander Koumis alexanderkoumis

View GitHub Profile
import cv2
import sys
def run(video_path):
cap = cv2.VideoCapture(video_path)
if not cap.isOpened():
print video_path, 'doesn\'t exist'
sys.exit()
@alexanderkoumis
alexanderkoumis / findface.cpp
Created October 28, 2015 08:19
Python OpenCV C++ Wrapper (CPython)
#include <iostream>
#include <vector>
#include <opencv2/core/core.hpp>
#include <opencv2/contrib/contrib.hpp>
#include <opencv2/objdetect/objdetect.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
int find_face(const char* cascade_file, const char* image_file)
{
@alexanderkoumis
alexanderkoumis / makefile
Created October 28, 2015 05:40
Python OpenCV C++ Wrapper (SWIG)
all:
swig -c++ -python opencv_facedetect.i
g++ -Wall -fPIC -c opencv_facedetect.cpp `pkg-config --cflags opencv`
g++ -Wall -fPIC -c opencv_facedetect_wrap.cxx `pkg-config --cflags python`
g++ -shared opencv_facedetect.o opencv_facedetect_wrap.o `pkg-config --libs opencv` `pkg-config --libs python` -o _opencv_facedetect.so
clean:
rm -f ./*.o $(PROG)
@alexanderkoumis
alexanderkoumis / ros_notes.md
Last active August 29, 2015 14:20
ROS Quick Start Notes

ROS Packages

What makes up a catkin package?

my_package/
  CMakeLists.txt
  package.xml