Example #1
0
 void update() {
     cam->update();
     if(cam->isFrameNew()) {
         ofPixels& pix = cam->getPixels();
         int skip = 2;
         int range = mouseX / 25;
         for(int y = 0; y < pix.getHeight(); y += skip) {
             for(int x = 0; x < pix.getWidth(); x += skip) {
                 ofColor cur = pix.getColor(x, y);
                 ofColor result(0, 0, 0, 0);
                 if(cur.r < range || cur.r > 255-range) {
                     result.r = 255;
                     result.a = 255;
                 }
                 if(cur.g < range || cur.g > 255-range) {
                     result.g = 255;
                     result.a = 255;
                 }
                 if(cur.b < range || cur.b > 255-range) {
                     result.b = 255;
                     result.a = 255;
                 }
                 clipping.setColor(x, y, result);
             }
         }
         clipping.update();
         
         if(recording) {
             string fn = "images/" + ofToString(frameCount, 6, '0') + ".jpg";
             imageSaver.saveImage(pix, fn);
             frameCount++;
         }
     }
 }
Example #2
0
	void exit() {
		imageSaver.exit();
		tracker.stopThread();
#ifdef INSTALL
		cam.close();
#endif
	}
Example #3
0
 void exit() {
     imageSaver.exit();
     cam->close();
 }
Example #4
0
	void saveFace(FaceTrackerData& data, ofImage& img) {
		string basePath = ofGetTimestampString("%Y.%m.%d/%H.%M.%S.%i");
		data.save("metadata/" + basePath + ".face");
		imageSaver.saveImage(img.getPixelsRef(), data.getImageFilename());
	}