From a3e4944185885c51b7bdd31e7de88957e053d7b5 Mon Sep 17 00:00:00 2001 From: mutantturkey Date: Mon, 24 Sep 2012 16:46:40 -0400 Subject: 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 --- fly-tools/filter/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fly-tools/filter') 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; -- cgit v1.2.3