From c79e312520e2ca77cac7111f3522fa25fe979f55 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 12 Jul 2016 09:36:16 +0200 Subject: [PATCH 1/5] added into image and basic team-info in main.cpp --- src/main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index dd279f1..48fe9b1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -57,8 +57,17 @@ str_to_uint16(const char *str, uint16_t *res) int main(int argc, const char* argv[]) { + std::cout << "AMOS Project 2016 - Group 5 @ University of Erlangen-Nuremberg \n" + " \n" + " _____ \n" + " | ____| \n" + " __ _ _ __ ___ | |__ ___ ___ \n" + " / _` | '_ ` _ \\|___ \\ / _ \\/ __| \n" + "| (_| | | | | | |___) | (_) \\__ \\ \n" + " \\__,_|_| |_| |_|____/ \\___/|___/ \n" + " \n" << std::endl; + if (argc > 4 || argc == 1){ - cerr << "Usage1: " << " FULL_PATH_TO_VIDEO_FILE (IMAGE_INDEX)\n"; cerr << "Usage2: " << " PORT (SERVERIP FULL_PATH_TO_VIDEO_FILE)" << endl; return -1; From 0a79d1302125215bf8270112d1b91d625b9146d7 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 12 Jul 2016 12:26:38 +0200 Subject: [PATCH 2/5] removed handling of arg==3 as it is no loonger used - in main --- src/main.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 48fe9b1..eb13644 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -67,7 +67,7 @@ int main(int argc, const char* argv[]) { " \\__,_|_| |_| |_|____/ \\___/|___/ \n" " \n" << std::endl; - if (argc > 4 || argc == 1){ + if (argc > 4 || argc == 1 || argc == 3){ cerr << "Usage1: " << " FULL_PATH_TO_VIDEO_FILE (IMAGE_INDEX)\n"; cerr << "Usage2: " << " PORT (SERVERIP FULL_PATH_TO_VIDEO_FILE)" << endl; return -1; @@ -87,19 +87,6 @@ int main(int argc, const char* argv[]) { Controller controller; controller.AnalyseVideo(argv[1]); } - } - - if(argc == 3){ - /*FrameSelectorFactory frame_selector_factory(argv[1]); - FrameSelector* pipeline = frame_selector_factory.GetFrameSelector(); - // read one image - unsigned int index = 0; - stringstream string_index(argv[2]); - string_index >> index; - Image * result_image = pipeline->ReadImage(index); - - ImageView image_viewer; - image_viewer.ShowImage(result_image, 0);*/ } if(argc == 4){ From 0c469a7dae2645b610076b346dd9dcbc7dc0bd0a Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 12 Jul 2016 12:34:56 +0200 Subject: [PATCH 3/5] added program-overview text to main --- src/main.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index eb13644..db37d8c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -68,8 +68,13 @@ int main(int argc, const char* argv[]) { " \n" << std::endl; if (argc > 4 || argc == 1 || argc == 3){ - cerr << "Usage1: " << " FULL_PATH_TO_VIDEO_FILE (IMAGE_INDEX)\n"; - cerr << "Usage2: " << " PORT (SERVERIP FULL_PATH_TO_VIDEO_FILE)" << endl; + std::cout << "This program \n" + "- takes a .hdf5 or .mp4 video \n" + "- performs a car and bus detection on it \n" + "- performs a human detection \n" + "- performs analyzation of -human in front of bus scenario- \n" + "- if scenario detected: send warning to other process \n" + " \n" << std::endl; return -1; } From 329166b771a86f7c5c46f3e5ba21d6a711d7a2cf Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 12 Jul 2016 12:46:50 +0200 Subject: [PATCH 4/5] added usage-info to main --- src/main.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index db37d8c..8bddf21 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -75,6 +75,20 @@ int main(int argc, const char* argv[]) { "- performs analyzation of -human in front of bus scenario- \n" "- if scenario detected: send warning to other process \n" " \n" << std::endl; + + + std::cout <<"Usage: \n" + " \n" + "Usage 1 (Detection) \n" + "FULL/PATH/TO/VIDEO.mp4 \n" + " \n" + "Usage 2: (Detection and communication) \n" + "a) Start the server: \n" + "PORT \n" + "b) Start the detection (use another terminal window/tab): \n" + "PORT SERVER_IP FULL/PATH/TO/VIDEO \n" << std::endl; + + return -1; } From 2c334f2824fe3c57cc7876c0e11f3ae6e4b04413 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 12 Jul 2016 12:49:04 +0200 Subject: [PATCH 5/5] minor style fixes in main --- src/main.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 8bddf21..c2244cb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -80,7 +80,7 @@ int main(int argc, const char* argv[]) { std::cout <<"Usage: \n" " \n" "Usage 1 (Detection) \n" - "FULL/PATH/TO/VIDEO.mp4 \n" + "FULL/PATH/TO/VIDEO \n" " \n" "Usage 2: (Detection and communication) \n" "a) Start the server: \n" @@ -110,21 +110,16 @@ int main(int argc, const char* argv[]) { if(argc == 4){ uint16_t port; - if(str_to_uint16(argv[1],&port)) - { + if(str_to_uint16(argv[1],&port)){ //MultithreadedController controller(argv[3],port,argv[2]); Controller controller; controller.InitilalizeCarConnection(port,argv[2]); controller.AnalyseVideo(argv[3]); } - else - { + else{ cerr << "Could not read port" << endl; } - -} - - + } return 0; }