added to and moved comments to top
authorGary Bradski <no@email>
Wed, 1 Dec 2010 02:20:36 +0000 (02:20 +0000)
committerGary Bradski <no@email>
Wed, 1 Dec 2010 02:20:36 +0000 (02:20 +0000)
samples/c/adaptiveskindetector.cpp

index d35c607..fd8926d 100644 (file)
 #include <opencv2/contrib/contrib.hpp>\r
 #include <opencv2/highgui/highgui.hpp>\r
 \r
+void help(char **argv)\r
+{\r
+       std::cout << "\nThis program demonstrates the contributed flesh detector CvAdaptiveSkinDetector which can be found in contrib.cpp\n"\r
+                       << "Usage: " << std::endl <<\r
+               argv[0] << " fileMask firstFrame lastFrame" << std::endl << std::endl <<\r
+               "Example: " << std::endl <<\r
+               argv[0] << " C:\\VideoSequences\\sample1\\right_view\\temp_%05d.jpg  0  1000" << std::endl <<\r
+               "       iterates through temp_00000.jpg  to  temp_01000.jpg" << std::endl << std::endl <<\r
+               "If no parameter specified, this application will try to capture from the default Webcam." << std::endl <<\r
+               "Please note: Background should not contain large surfaces with skin tone." <<\r
+               "\n\n ESC will stop\n" <<\r
+               std::endl;\r
+}\r
+\r
 class ASDFrameHolder\r
 {\r
 private:\r
@@ -332,15 +346,7 @@ int main(int argc, char** argv )
 \r
        if (argc < 4)\r
        {\r
-               std::cout << "Usage: " << std::endl <<\r
-                       argv[0] << " fileMask firstFrame lastFrame" << std::endl << std::endl <<\r
-                       "Example: " << std::endl <<\r
-                       argv[0] << " C:\\VideoSequences\\sample1\\right_view\\temp_%05d.jpg  0  1000" << std::endl <<\r
-                       "       iterates through temp_00000.jpg  to  temp_01000.jpg" << std::endl << std::endl <<\r
-                       "If no parameter specified, this application will try to capture from the default Webcam." << std::endl <<\r
-                       "Please note: Background should not contain large surfaces with skin tone." <<\r
-                       std::endl;\r
-\r
+               help(argv);\r
                sequencer = new ASDFrameSequencerWebCam();\r
                (dynamic_cast<ASDFrameSequencerWebCam*>(sequencer))->open(-1);\r
 \r
@@ -373,7 +379,7 @@ int main(int argc, char** argv )
                        filterMask = cvCreateImage( cvSize(img->width, img->height), IPL_DEPTH_8U, 1);\r
                }\r
                clock = std::clock();\r
-               filter.process(img, filterMask);        // process the frame\r
+               filter.process(img, filterMask);        // DETECT SKIN\r
                clockTotal += (std::clock() - clock);\r
 \r
                displayBuffer(img, filterMask, 0, 255, 0);\r