Permalink
Browse files

Output on left-arrow press

* Removed use of input stream and used OpenCV waitKey
* Remove requests from tweetstache.js
  • Loading branch information...
1 parent b65f109 commit 130e828a33c4db2df49c85d1956c0abcba518cc5 @jadonk committed Jan 7, 2013
Showing with 6 additions and 7 deletions.
  1. +5 −6 stache.cpp
  2. +1 −1 tweetstache.js
View
@@ -117,13 +117,12 @@ int main(int argc, const char** argv) {
if(!frame.empty()) {
detectAndDisplay( frame );
} else {
- fprintf(stderr, " --(!) No captured frame -- Break!"); break;
- }
-
- if(int c = inputAvailable()) {
- if( (char)c == 'c' ) { break; }
- else if( (char)c == 's' ) { saveFrame(frame); }
+ fprintf(stderr, " --(!) No captured frame -- Break!\n"); break;
}
+
+ int c = waitKey(10);
+ if( c == (int)'c' ) { break; }
+ else if( c == 65361 ) { saveFrame(frame); } //-- save on press of left arrow
} catch(cv::Exception e) {
}
}
View
@@ -127,5 +127,5 @@ function requestStache() {
stache.stdin.write('s');
};
-setInterval(requestStache, 5000);
+//setInterval(requestStache, 5000);

0 comments on commit 130e828

Please sign in to comment.