Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Clean-up for demo

* Add some error codes
* Add icon for desktop
* Eliminate terminal
  • Loading branch information...
commit f877aacbcbe3c04da651160b6f70acb1d2fa9756 1 parent c632c80
@jadonk authored
Showing with 8 additions and 6 deletions.
  1. +6 −5 stache.cpp
  2. +2 −1  stache.desktop
View
11 stache.cpp
@@ -96,7 +96,7 @@ int main(int argc, const char** argv) {
fprintf(stderr, "%s", copyright);
//-- 1. Load the cascade
- if( !face_cascade.load(face_cascade_name) ){ fprintf(stderr, "--(!)Error loading\n"); return -1; };
+ if( !face_cascade.load(face_cascade_name) ){ fprintf(stderr, "--(!)Error loading\n"); exit(-1); };
//-- 1a. Load the mustache mask
mask = cvLoadImage(stacheMaskFile);
@@ -117,18 +117,19 @@ int main(int argc, const char** argv) {
if(!frame.empty()) {
detectAndDisplay( frame );
} else {
- fprintf(stderr, " --(!) No captured frame -- Break!\n"); break;
+ fprintf(stderr, " --(!) No captured frame -- Break!\n"); exit(-2);
}
int c = waitKey(10);
- if( c == (int)'c' ) { break; }
- else if( c == 65361 ) { saveFrame(frame); } //-- save on press of left arrow
+ if( c == 65361 ) { saveFrame(frame); } //-- save on press of left arrow
} catch(cv::Exception e) {
}
}
inputSetup(0);
+ } else {
+ exit(-3);
}
- return 0;
+ exit(0);
}
/**
View
3  stache.desktop
@@ -3,5 +3,6 @@ Version=1.0
Name=BeagleStache
Comment=Superimposes mustache using OpenCV
Exec=/home/root/stache/runstache
-Terminal=true
+Icon=/home/root/stache/beaglestache.png
+Terminal=false
Type=Application
Please sign in to comment.
Something went wrong with that request. Please try again.