From edc41d4cabee9b96d08dc12dbdd40e3f0d2e6318 Mon Sep 17 00:00:00 2001 From: Gary Bradski Date: Mon, 29 Nov 2010 07:54:10 +0000 Subject: [PATCH] updated comments --- samples/cpp/matching_to_many_images.cpp | 40 +++++++++++++------------ 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/samples/cpp/matching_to_many_images.cpp b/samples/cpp/matching_to_many_images.cpp index 345594e53a..32b200822b 100644 --- a/samples/cpp/matching_to_many_images.cpp +++ b/samples/cpp/matching_to_many_images.cpp @@ -7,16 +7,6 @@ using namespace cv; using namespace std; -/* - * This is a sample on matching descriptors detected on one image to descriptors detected in image set. - * So we have one query image and several train images. For each keypoint descriptor of query image - * the one nearest train descriptor is found the entire collection of train images. To visualize the result - * of matching we save images, each of which combines query and train image with matches between them (if they exist). - * Match is drawn as line between corresponding points. Count of all matches is equel to count of - * query keypoints, so we have the same count of lines in all set of result images (but not for each result - * (train) image). - */ - const string defaultDetectorType = "SURF"; const string defaultDescriptorType = "SURF"; const string defaultMatcherType = "FlannBased"; @@ -24,6 +14,27 @@ const string defaultQueryImageName = "../../opencv/samples/cpp/matching_to_many_ const string defaultFileWithTrainImages = "../../opencv/samples/cpp/matching_to_many_images/train/trainImages.txt"; const string defaultDirToSaveResImages = "../../opencv/samples/cpp/matching_to_many_images/results"; +void printPrompt( const string& applName ) +{ + cout << "/*\n" + << " * This is a sample on matching descriptors detected on one image to descriptors detected in image set.\n" + << " * So we have one query image and several train images. For each keypoint descriptor of query image\n" + << " * the one nearest train descriptor is found the entire collection of train images. To visualize the result\n" + << " * of matching we save images, each of which combines query and train image with matches between them (if they exist).\n" + << " * Match is drawn as line between corresponding points. Count of all matches is equel to count of\n" + << " * query keypoints, so we have the same count of lines in all set of result images (but not for each result\n" + << " * (train) image).\n" + << " */\n" << endl; + + cout << endl << "Format:" << endl; + cout << "./" << applName << " [detectorType] [descriptorType] [matcherType] [queryImage] [fileWithTrainImages] [dirToSaveResImages]" << endl; + cout << endl; + + cout << "\nExample:" << endl + << "./" << applName << " " << defaultDetectorType << " " << defaultDescriptorType << " " << defaultMatcherType << " " + << defaultQueryImageName << " " << defaultFileWithTrainImages << " " << defaultDirToSaveResImages << endl; +} + void maskMatchesByTrainImgIdx( const vector& matches, int trainImgIdx, vector& mask ) { mask.resize( matches.size() ); @@ -166,15 +177,6 @@ void saveResultImages( const Mat& queryImage, const vector& queryKeypo cout << ">" << endl; } -void printPrompt( const string& applName ) -{ - cout << endl << "Format:" << endl; - cout << applName << " [detectorType] [descriptorType] [matcherType] [queryImage] [fileWithTrainImages] [dirToSaveResImages]" << endl; - cout << endl << "Example:" << endl - << defaultDetectorType << " " << defaultDescriptorType << " " << defaultMatcherType << " " - << defaultQueryImageName << " " << defaultFileWithTrainImages << " " << defaultDirToSaveResImages << endl; -} - int main(int argc, char** argv) { string detectorType = defaultDetectorType;