From ecded116dbeb23fb2b6f02e1781d54ca075c9a88 Mon Sep 17 00:00:00 2001 From: Gary Bradski Date: Sat, 4 Dec 2010 08:30:46 +0000 Subject: [PATCH] revamped --- samples/cpp/letter_recog.cpp | 45 +++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/samples/cpp/letter_recog.cpp b/samples/cpp/letter_recog.cpp index fd75712a49..88431a1613 100644 --- a/samples/cpp/letter_recog.cpp +++ b/samples/cpp/letter_recog.cpp @@ -3,23 +3,34 @@ #include /* -The sample demonstrates how to train Random Trees classifier -(or Boosting classifier, or MLP - see main()) using the provided dataset. -We use the sample database letter-recognition.data -from UCI Repository, here is the link: - -Newman, D.J. & Hettich, S. & Blake, C.L. & Merz, C.J. (1998). -UCI Repository of machine learning databases -[http://www.ics.uci.edu/~mlearn/MLRepository.html]. -Irvine, CA: University of California, Department of Information and Computer Science. - -The dataset consists of 20000 feature vectors along with the -responses - capital latin letters A..Z. -The first 16000 (10000 for boosting)) samples are used for training -and the remaining 4000 (10000 for boosting) - to test the classifier. */ +void help() +{ + printf("\nThe sample demonstrates how to train Random Trees classifier\n" + "(or Boosting classifier, or MLP - see main()) using the provided dataset.\n" + "\n" + "We use the sample database letter-recognition.data\n" + "from UCI Repository, here is the link:\n" + "\n" + "Newman, D.J. & Hettich, S. & Blake, C.L. & Merz, C.J. (1998).\n" + "UCI Repository of machine learning databases\n" + "[http://www.ics.uci.edu/~mlearn/MLRepository.html].\n" + "Irvine, CA: University of California, Department of Information and Computer Science.\n" + "\n" + "The dataset consists of 20000 feature vectors along with the\n" + "responses - capital latin letters A..Z.\n" + "The first 16000 (10000 for boosting)) samples are used for training\n" + "and the remaining 4000 (10000 for boosting) - to test the classifier.\n" + "======================================================\n"); + printf("\nThis is letter recognition sample.\n" + "The usage: letter_recog [-data ] \\\n" + " [-save ] \\\n" + " [-load ] \\\n" + " [-boost|-mlp] # to use boost/mlp classifier instead of default Random Trees\n" ); +} + // This function reads data and responses from the file static int read_num_class_data( const char* filename, int var_count, @@ -521,11 +532,7 @@ int main( int argc, char *argv[] ) build_mlp_classifier( data_filename, filename_to_save, filename_to_load ) : -1) < 0) { - printf("This is letter recognition sample.\n" - "The usage: letter_recog [-data ] \\\n" - " [-save ] \\\n" - " [-load ] \\\n" - " [-boost|-mlp] # to use boost/mlp classifier instead of default Random Trees\n" ); + help(); } return 0; }