diff --git a/README.md b/README.md index 8c16ab6bcbbfa0aa90d81fe406538d70c9e91a2b..5746ec9983bfe8184575bbdb5fe7cd545aaeb410 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 a4343d26afc0c995b6d3d9950e02e16f3480e57d..d7082a164d437a09901cf6fbc2f7030ca0002936 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 0000000000000000000000000000000000000000..46d7fefd6320aed647da489528bef5f97ef26abe --- /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 23f792f34b9399dc8fe6426255bcbeb077c9a5b2..0000000000000000000000000000000000000000 --- 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 1102a01d3cafa71042b0acce6b2e3f0992da5fbf..0000000000000000000000000000000000000000 --- 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 2a3c2c53e549e831fbcff27ef3cac6cd950043d9..0000000000000000000000000000000000000000 --- 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 853e2084086317a97281e5e06fade36de5d8461e..cd82f6107ff0e51344372d5313cf460378f82387 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() );