From c4c21743dfb8f4dfb684881606d7ab646ecf037d Mon Sep 17 00:00:00 2001 From: "simon.fanetti" <simon.fanetti@etu.hesge.ch> Date: Wed, 9 Sep 2020 15:30:35 +0200 Subject: [PATCH] add comments --- README.md | 12 +- display_levels/display_levels.cpp | 1 + test_perf/README.md | 9 + test_perf/output/durations_last.txt | 201 ----------------------- test_perf/output/durations_lq_chunks.txt | 201 ----------------------- test_perf/output/durations_old.txt | 201 ----------------------- test_perf/test.cpp | 6 +- 7 files changed, 21 insertions(+), 610 deletions(-) create mode 100644 test_perf/README.md delete mode 100644 test_perf/output/durations_last.txt delete mode 100644 test_perf/output/durations_lq_chunks.txt delete mode 100644 test_perf/output/durations_old.txt diff --git a/README.md b/README.md index 8c16ab6..5746ec9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ -# Utilisation - - Modifiez les chemins relatifs à la libsandbox dans le Makefile - - Inclure les flags du linker avec DEP_SANDBOX du fichier dep.mk - - Indiquer la position du fichier libsandobx.so dans la variable "LD_LIBRARY_PATH" du terminal - - Executez le Makefile +# display_levels +Application de démo affichant les niveaux en couleurs sur le bac. +# test_perf +Application testant les performances de la librairie, elle permet d'avoir une idée des temps d'exécution des fonctions de la librairie et le frame rate moyen. + +# ar_cubes +Application de démo (incomplète) projetant un carré blanc sur un carré bleu détecté sur le bac. diff --git a/display_levels/display_levels.cpp b/display_levels/display_levels.cpp index a4343d2..d7082a1 100644 --- a/display_levels/display_levels.cpp +++ b/display_levels/display_levels.cpp @@ -49,6 +49,7 @@ void displayLevels(Sandbox &sandbox, float top, float height){ // don't update little differences due to the camera depth captors new_depth.copyTo( depth_cache, (cv::abs(depth_cache-new_depth) > DEPTH_MARGIN_ERROR/2) ); + // TODO : try to colorize with HSV colorized = colorizeDepth(depth_cache, top, height); res = sandbox.adjustProjection(colorized, depth_cache); diff --git a/test_perf/README.md b/test_perf/README.md new file mode 100644 index 0000000..46d7fef --- /dev/null +++ b/test_perf/README.md @@ -0,0 +1,9 @@ +# Tests librairie performances application + +## test.cpp +Allows you to tests some functions of the sandbox library and output the duration of the execution of the functions in a file in /output. + +You can custom the number of cycle and if it has to take pictures with the camera. + +## read_output.py +Allows you to read an output file and display the average times and frames in the console diff --git a/test_perf/output/durations_last.txt b/test_perf/output/durations_last.txt deleted file mode 100644 index 23f792f..0000000 --- a/test_perf/output/durations_last.txt +++ /dev/null @@ -1,201 +0,0 @@ -[capture_frame_ms, get_depth_frame_ms, get_color_frame_ms, adjust_projection_ms] git branch 1904bb0d -19,0,1,355 -15,0,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,210 -15,0,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,210 -14,1,0,210 -14,1,0,209 -15,0,1,209 -15,0,0,211 -14,1,0,209 -15,0,0,210 -14,1,0,209 -15,0,1,209 -15,0,0,210 -15,0,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,209 -15,0,0,210 -14,1,0,209 -15,0,1,209 -14,1,0,209 -15,0,0,210 -15,0,0,210 -15,0,0,210 -15,0,0,210 -15,0,0,210 -15,0,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,209 -15,0,1,209 -15,0,0,210 -14,1,0,209 -15,0,1,209 -15,0,0,210 -14,1,0,209 -15,0,0,210 -15,1,0,209 -15,0,0,210 -14,1,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,210 -14,1,0,209 -15,0,0,210 -14,1,0,209 -15,0,1,209 -15,0,0,209 -15,0,1,209 -15,0,0,210 -15,0,0,210 -14,1,0,209 -15,0,1,209 -15,0,0,209 -15,0,1,209 -15,0,0,209 -15,0,1,209 -15,0,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,209 -15,0,0,210 -15,0,0,209 -14,1,0,209 -15,0,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,210 -15,0,0,210 -14,1,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,209 -15,0,1,209 -15,0,0,210 -15,0,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,210 -14,1,0,209 -15,0,0,210 -14,1,0,209 -15,0,0,210 -14,1,0,209 -15,0,0,210 -14,1,0,209 -15,1,0,209 -15,0,0,210 -14,1,0,209 -15,0,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,210 -14,1,0,209 -15,0,0,210 -14,1,0,209 -15,0,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,210 -15,1,0,211 -14,1,0,209 -15,0,0,210 -14,1,0,209 -15,0,1,209 -15,0,0,209 -15,0,1,209 -15,0,0,210 -15,0,0,209 -15,1,0,209 -15,0,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,209 -15,0,1,209 -15,0,0,209 -15,1,0,209 -15,0,0,210 -15,0,0,209 -15,1,0,209 -15,0,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,209 -15,1,0,209 -15,0,0,210 -15,0,0,209 -15,0,0,210 -15,0,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,210 -14,1,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,210 -15,0,0,209 -15,0,1,209 -15,0,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,210 -14,1,0,209 -15,0,0,210 -14,1,0,210 -14,1,0,209 -15,0,0,210 -14,1,0,210 -15,0,0,210 -14,1,0,209 -15,0,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,210 -15,0,0,209 -15,0,0,210 -15,0,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,210 -15,0,0,209 -15,1,0,210 -15,0,0,209 -15,0,0,210 -15,0,0,210 -15,0,0,210 -15,0,0,210 -15,0,0,210 -15,0,0,210 -14,1,0,209 -15,0,0,210 -15,0,0,209 -15,0,0,210 -14,1,0,209 -15,0,1,209 -15,0,0,209 -15,0,1,210 -15,0,0,209 -15,0,0,210 -15,0,0,209 -15,0,1,209 -15,0,0,209 -15,0,1,209 -15,0,0,210 -14,1,0,209 -15,1,0,209 -15,0,1,209 -15,0,0,210 -14,1,0,209 diff --git a/test_perf/output/durations_lq_chunks.txt b/test_perf/output/durations_lq_chunks.txt deleted file mode 100644 index 1102a01..0000000 --- a/test_perf/output/durations_lq_chunks.txt +++ /dev/null @@ -1,201 +0,0 @@ -[capture_frame_ms, get_depth_frame_ms, get_color_frame_ms, adjust_projection_ms] git branch 0c4ff5dc -15,0,0,183 -15,1,0,57 -14,1,0,56 -15,1,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,57 -15,0,0,56 -15,0,0,57 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,57 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,1,55 -15,0,0,56 -15,0,0,57 -14,1,0,56 -15,0,0,57 -15,0,0,56 -15,0,0,57 -15,0,0,56 -15,0,0,56 -15,0,0,57 -14,1,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,57 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,57 -15,0,0,56 -15,0,0,57 -15,0,0,56 -15,0,0,57 -15,0,0,56 -15,0,0,56 -14,0,0,57 -14,1,0,56 -15,0,0,56 -15,0,0,56 -14,1,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,57 -15,0,0,56 -15,0,0,57 -15,0,0,56 -15,0,0,56 -14,0,0,57 -14,1,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,57 -15,0,0,56 -15,0,0,56 -15,0,0,57 -15,0,0,56 -15,0,0,58 -15,0,0,57 -15,1,0,58 -15,0,0,57 -15,1,0,57 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,57 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,57 -15,0,0,57 -15,0,0,56 -15,0,0,56 -15,0,0,57 -15,0,0,57 -15,0,0,58 -15,0,0,57 -15,0,0,57 -15,0,0,56 -15,1,0,57 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,57 -15,0,0,57 -15,0,0,57 -15,0,0,57 -15,0,0,58 -15,0,0,61 -16,0,0,58 -15,0,0,57 -15,0,0,58 -15,0,0,58 -15,0,0,57 -15,0,0,59 -15,0,0,60 -16,0,0,58 -16,0,0,58 -15,0,0,57 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,58 -15,0,0,56 -15,0,0,56 -16,0,0,57 -15,0,0,57 -15,0,0,58 -15,0,0,56 -16,0,0,61 -15,0,0,60 -16,0,0,60 -16,0,0,59 -16,0,0,59 -16,0,0,58 -16,0,0,60 -16,0,0,58 -16,0,0,60 -15,1,0,59 -16,0,0,59 -15,1,0,57 -15,0,0,59 -15,0,0,57 -16,0,0,56 -15,0,0,57 -15,0,0,57 -15,0,0,57 -15,0,0,56 -15,0,0,57 -14,1,0,57 -16,0,0,57 -15,0,0,58 -15,0,0,57 -15,1,0,57 -16,0,0,57 -15,0,0,56 -15,0,0,57 -15,0,0,58 -15,0,0,57 -15,0,0,57 -15,0,0,58 -15,0,0,57 -15,0,0,61 -15,1,0,57 -16,0,0,59 -16,0,0,57 -15,1,0,57 -16,0,0,58 -15,0,0,61 -16,0,0,60 -16,0,0,59 -16,0,0,60 -16,0,0,59 -16,0,0,59 -15,1,0,59 -15,0,0,59 -16,0,0,58 -15,0,0,60 -16,0,0,59 -15,0,0,58 -15,0,0,57 -15,0,0,57 -14,0,0,57 -15,0,0,57 -15,0,0,56 -15,0,0,57 -15,0,0,57 -14,1,0,56 -15,1,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,56 -15,1,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,57 -14,0,0,58 -14,1,0,56 -15,0,0,56 -15,0,0,56 -15,0,0,56 -14,1,0,56 diff --git a/test_perf/output/durations_old.txt b/test_perf/output/durations_old.txt deleted file mode 100644 index 2a3c2c5..0000000 --- a/test_perf/output/durations_old.txt +++ /dev/null @@ -1,201 +0,0 @@ -[capture_frame_ms, get_depth_frame_ms, get_color_frame_ms, adjust_projection_ms] git branch e0079671 -34,0,0,202 -20,0,0,85 -18,0,0,84 -18,0,1,83 -19,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,84 -18,1,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,84 -18,1,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,1,0,83 -19,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,1,0,84 -18,0,0,84 -18,0,0,84 -18,1,0,83 -19,0,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,85 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,85 -18,0,0,85 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,84 -18,1,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,1,0,84 -18,0,0,84 -18,0,0,85 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -19,0,0,84 -18,0,0,85 -18,0,0,85 -18,0,0,84 -18,0,0,85 -18,0,0,85 -18,0,0,84 -18,0,0,85 -18,0,0,84 -18,0,1,83 -19,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,84 -18,0,1,83 -18,0,0,84 -18,0,0,84 -18,0,1,83 -19,0,0,84 -18,0,0,85 -18,0,0,84 -18,0,1,83 -19,0,0,84 -18,0,0,84 -18,0,1,83 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,85 -18,0,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -19,0,0,84 -19,0,0,84 -19,0,0,85 -18,0,0,85 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,84 -18,1,0,84 -18,0,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,85 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,1,0,83 -19,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,1,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,84 -18,0,1,83 -19,0,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,1,84 -18,0,0,84 -18,0,0,84 -18,1,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,84 -18,0,1,83 -19,0,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,84 -18,0,0,84 -18,1,0,83 -19,0,0,84 -18,0,0,84 -18,0,0,84 -19,0,0,85 -18,0,0,84 diff --git a/test_perf/test.cpp b/test_perf/test.cpp index 853e208..cd82f61 100644 --- a/test_perf/test.cpp +++ b/test_perf/test.cpp @@ -23,6 +23,8 @@ int main(){ return 1; } + // you can custom the number of cycle and if + // it has to take a picture at the beginning of the process testPerformances( sandbox, 200, false ); } @@ -53,9 +55,9 @@ void testPerformances(Sandbox &sandbox, int cycle, bool take_pic){ std::ofstream output; output.open ("./output/durations.txt"); - output << "[capture_frame_ms, get_depth_frame_ms, get_color_frame_ms, adjust_projection_ms]\n"; + output << "capture_frame_ms,get_depth_frame_ms,get_color_frame_ms,adjust_projection_ms\n"; - // line : [capture_frame_ms, get_depth_frame_ms, get_color_frame_ms, adjust_projection_ms] + // line : capture_frame_ms, get_depth_frame_ms, get_color_frame_ms, adjust_projection_ms for(int i = 0; i < cycle; i++){ std::chrono::milliseconds start_capt_ms = std::chrono::duration_cast< std::chrono::milliseconds >( std::chrono::system_clock::now().time_since_epoch() ); -- GitLab