예제 #1
0
 void update() {
     video.update();
     if(video.isFrameNew()) {
         copyGray(video, gray);
         resize(video, graySmall, rescale, rescale);
         threshold(gray, thresholded, thresholdValue);
         dilate(thresholded, dilated, dilationAmount);
         updateMotion();
         updateContours();
     }
 }
예제 #2
0
//--------------------------------------------------------------
void testApp::draw(){
	ofBackgroundGradient(ofColor(0,0,0), ofColor(50, 50, 50), OF_GRADIENT_CIRCULAR);

	ofSetColor(255);
	if( mode == "edit" || mode == "move" ){
		if( mode == "move" ){
			ofSetColor(20, 90, 30);
			ofRect(0,0,3000,3000);
			ofSetColor(255);
		}
		
		for(int i = 0; i < thumbs.size(); i++){
			thumbs[i].draw();
		}
		
		if( mode == "move" && bDown ){
			ofSetColor(255, 190, 50);
			ofRect(thumbs[placedIndex].r.x - 5, thumbs[placedIndex].r.y, 4, 80);
		}
		
		ofSetColor(255);
		
	}else if( mode == "full" ){
		fullVid.draw(0,0);
		ofRect(thumbs[selected].pos * ofGetWidth(), ofGetHeight()-10, 4, 10);
	}else{
		
		vid.setAnchorPercent(0.5, 0.5);
		vid.draw(ofGetWidth()/2, ofGetHeight()/2, ofGetWidth(), ofGetWidth() * ( vid.getHeight() / vid.getWidth() ));
		
		if( vid.isFrameNew() ){
		
			if( mode == "play" ){
				img.grabScreen(0,0,ofGetWidth(),ofGetHeight());
				img.saveImage("frames/" + ofToString(totalFrames) + ".jpg");
			}
			totalFrames++;
			
			framecounter++;
			if( framecounter > NUM_FRAMES ){
				nextVideo();
			}		

		}
	}
}