aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormutantturkey <mutantturke@gmail.com>2012-08-02 22:45:03 -0400
committermutantturkey <mutantturke@gmail.com>2012-08-02 22:45:03 -0400
commit1e62c15add0f39843b04c6713606b911af3d77b6 (patch)
tree774758b4a1fc6fada1ea3c97e9ab37a5eae6d91f
parent0e23ba36c238bc82fa41c9aa43897c47ff0d6a3f (diff)
use proper exit codes
-rw-r--r--fly-tools/filter/main.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/fly-tools/filter/main.cpp b/fly-tools/filter/main.cpp
index fd667fb..20073a8 100644
--- a/fly-tools/filter/main.cpp
+++ b/fly-tools/filter/main.cpp
@@ -19,8 +19,11 @@ bool cmpArea(const pair<CvLabel, CvBlob*> &p1, const pair<CvLabel, CvBlob*> &p2
int main(int argc, char* argv[]) {
int c;
+
+ // drawNumber refers to the number of blobs to draw, it will be either 1 or 2.
int drawNumber = 2;
+ // ratio of the largest blob to the smallest blob.
double ratio = 0;
bool verbose = false;
@@ -57,7 +60,7 @@ int main(int argc, char* argv[]) {
break;
case 'h':
cout << usage << endl;
- exit(0);
+ exit(EXIT_SUCCESS);
break;
default:
break;
@@ -65,7 +68,7 @@ int main(int argc, char* argv[]) {
if ( inputFileName.empty() || outputFileName.empty() || !ratioSet ) {
cerr << usage << endl;
- exit(1);
+ exit(EXIT_FAILURE);
}
if(verbose) {
@@ -93,7 +96,7 @@ int main(int argc, char* argv[]) {
if(blobList.size() == 0) {
cerr << "No blobs found" << endl;
cvSaveImage(outputFileName.c_str(), outputImg);
- exit(1);
+ exit(EXIT_FAILURE);
}
// if only one blob is detected.