diff options
author | mutantturkey <mutantturke@gmail.com> | 2012-09-24 16:46:40 -0400 |
---|---|---|
committer | mutantturkey <mutantturke@gmail.com> | 2012-09-24 16:46:40 -0400 |
commit | a3e4944185885c51b7bdd31e7de88957e053d7b5 (patch) | |
tree | 50efeddfa53a9fce4b92ac98ffb65b253d7e5f7a /fly-tools | |
parent | 269000b40b6fe1bf72b72bdaab02c20b09cafe93 (diff) |
switch to empty method instead of checking for size == 0. Does the same, might be faster on some systems, cleaner. Also remove extra cvReleaseImage call and added output for outputFileName
Diffstat (limited to 'fly-tools')
-rw-r--r-- | fly-tools/filter/main.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fly-tools/filter/main.cpp b/fly-tools/filter/main.cpp index 5b3bfbf..079995c 100644 --- a/fly-tools/filter/main.cpp +++ b/fly-tools/filter/main.cpp @@ -73,7 +73,7 @@ int main(int argc, char* argv[]) { (verbose) ? output = &cout : output = &nullLog; - *output << "Verbose logging enabled" << endl; + *output << "Filtering: " << inputFileName << endl; // read input file inputImg = cvLoadImage(inputFileName.c_str(), CV_LOAD_IMAGE_GRAYSCALE); @@ -89,7 +89,7 @@ int main(int argc, char* argv[]) { sort(blobList.begin(), blobList.end(), cmpArea); // if no blobs. - if(blobList.size() == 0) { + if(blobList.empty()) { cerr << "No blobs found" << endl; cvSaveImage(outputFileName.c_str(), outputImg); exit(EXIT_FAILURE); @@ -112,15 +112,15 @@ int main(int argc, char* argv[]) { *output << "Blob #" << blobList[i].first << " -> " << (*blobList[i].second) << endl; } - // draw the selected blobsto outputImg and write the image. + // draw the selected blobs to outputImg and write the image. cvFilterLabels(labelImg, outputImg, largeBlobs); + *output << "Outputting Filtered Mask to: " << outputFileName << endl; cvSaveImage(outputFileName.c_str(), outputImg); // Release all the memory cvReleaseImage(&outputImg); cvReleaseImage(&inputImg); cvReleaseImage(&labelImg); - cvReleaseImage(&inputImg); cvReleaseBlobs(blobs); return 0; |