Created
June 21, 2016 10:43
-
-
Save kasperkamperman/e43691f41f217b31207348d91d3aa3fb to your computer and use it in GitHub Desktop.
Happy OpenCV Glitch accident
This file contains hidden or 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
/* | |
Happy Glitch accident: | |
http://giphy.com/gifs/fTGmbedzRZfLq | |
Uses the OpenCV for Processing library: | |
https://github.com/atduskgreg/opencv-processing | |
*/ | |
import processing.video.*; | |
import gab.opencv.*; | |
import org.opencv.core.Mat; | |
OpenCV opencv; | |
Capture video; | |
void setup() { | |
size(640, 480,P2D); | |
video = new Capture(this, 320, 240); | |
video.start(); | |
opencv = new OpenCV( this, video.width, video.height); | |
} | |
void draw() { | |
if (video.available()) { | |
video.read(); | |
opencv.loadImage(video); | |
Mat workMat = OpenCV.imitate(opencv.getGray()); | |
image(opencv.getSnapshot(workMat),0,0, 640,480); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment