From 8403128572b23da14e68cb75293d135544a27f28 Mon Sep 17 00:00:00 2001 From: Carsten Griwodz Date: Fri, 5 Feb 2021 10:57:11 +0100 Subject: [PATCH 1/4] [code] avoid boost timer deprecation warnings # Conflicts: # src/cctag/cuda/pinned_counters.h --- src/cctag/CCTag.cpp | 1 - src/cctag/Detection.cpp | 4 ++-- src/cctag/Multiresolution.cpp | 2 +- src/cctag/Vote.cpp | 1 - src/cctag/filter/cvRecode.cpp | 14 ++++++++------ 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/cctag/CCTag.cpp b/src/cctag/CCTag.cpp index e0cfe1af..ac002fea 100644 --- a/src/cctag/CCTag.cpp +++ b/src/cctag/CCTag.cpp @@ -18,7 +18,6 @@ #include #include -#include #include #include diff --git a/src/cctag/Detection.cpp b/src/cctag/Detection.cpp index 8e3ae7d7..21959bfa 100644 --- a/src/cctag/Detection.cpp +++ b/src/cctag/Detection.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include @@ -584,7 +584,7 @@ void cctagDetectionFromEdges( createImageForVoteResultDebug(src, pyramidLevel); // Set some timers - boost::timer t3; + boost::timer::cpu_timer t3; boost::posix_time::ptime tstart0(boost::posix_time::microsec_clock::local_time()); std::size_t nSegmentOut = 0; diff --git a/src/cctag/Multiresolution.cpp b/src/cctag/Multiresolution.cpp index 53f2f059..d6be28e3 100644 --- a/src/cctag/Multiresolution.cpp +++ b/src/cctag/Multiresolution.cpp @@ -16,7 +16,7 @@ #include #include // for DO_TALK macro -#include +#include #include #include diff --git a/src/cctag/Vote.cpp b/src/cctag/Vote.cpp index 135daf37..a037fe96 100644 --- a/src/cctag/Vote.cpp +++ b/src/cctag/Vote.cpp @@ -29,7 +29,6 @@ #include #include -#include #include #include diff --git a/src/cctag/filter/cvRecode.cpp b/src/cctag/filter/cvRecode.cpp index 2131f6f0..a65cd428 100644 --- a/src/cctag/filter/cvRecode.cpp +++ b/src/cctag/filter/cvRecode.cpp @@ -18,7 +18,7 @@ #include "cctag/Params.hpp" #include "cctag/utils/Talk.hpp" // do DO_TALK macro -#include +#include #include // for ::abs #include @@ -47,7 +47,7 @@ void cvRecodedCanny( int debug_info_level, const cctag::Parameters* params ) { - boost::timer t; + boost::timer::cpu_timer t; std::vector stack; uchar** stack_top = nullptr, ** stack_bottom = nullptr; @@ -166,8 +166,9 @@ void cvRecodedCanny( #define CANNY_PUSH( d ) *( d ) = (uchar)2, *stack_top++ = ( d ) #define CANNY_POP( d ) ( d ) = *--stack_top + t.stop(); DO_TALK( CCTAG_COUT_DEBUG( "Canny 1 took: " << t.elapsed() ); ); - t.restart(); + t.resume(); // calculate magnitude and angle of gradient, perform non-maxima supression. // fill the map with one of the following values: @@ -328,6 +329,7 @@ void cvRecodedCanny( mag_buf[2] = _mag; } + t.stop(); DO_TALK( CCTAG_COUT_DEBUG( "Canny 2 took : " << t.elapsed() ); ) #ifdef DEBUG_MAGMAP_BY_GRIFF @@ -354,7 +356,7 @@ void cvRecodedCanny( delete[] write_mag; } #endif // DEBUG_MAGMAP_BY_GRIFF - t.restart(); + t.resume(); // now track the edges (hysteresis thresholding) while( stack_top > stack_bottom ) @@ -389,9 +391,9 @@ void cvRecodedCanny( CANNY_PUSH( m + mapstep + 1 ); } + t.stop(); DO_TALK( CCTAG_COUT_DEBUG( "Canny 3 took : " << t.elapsed() ); ) - - t.restart(); + t.resume(); // the final pass, form the final image for( i = 0; i < size.height; i++ ) From 8f2d700c82da0812b74fb894af94e2220a78dcea Mon Sep 17 00:00:00 2001 From: Carsten Griwodz Date: Sat, 19 Jun 2021 10:50:24 +0200 Subject: [PATCH 2/4] [cuda] remove an unused variable --- src/cctag/cuda/tag.cu | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/cctag/cuda/tag.cu b/src/cctag/cuda/tag.cu index 6e790467..90ef4620 100644 --- a/src/cctag/cuda/tag.cu +++ b/src/cctag/cuda/tag.cu @@ -277,8 +277,6 @@ void TagPipe::imageCenterOptLoop( ellipse.angle() ); float2 f = make_float2( center.x(), center.y() ); - cctag::geometry::matrix3x3 bestHomography; - imageCenterOptLoop( tagIndex, debug_numTags, _tag_streams[tagIndex%NUM_ID_STREAMS], From 319e193afc7af2df3b76527febc197b75c6d56aa Mon Sep 17 00:00:00 2001 From: Carsten Griwodz Date: Tue, 15 Jun 2021 13:18:56 +0200 Subject: [PATCH 3/4] [code] avoid multiple LUT initialization on CPU side --- src/cctag/filter/thinning.cpp | 12 ++++++------ src/cctag/filter/thinning.hpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cctag/filter/thinning.cpp b/src/cctag/filter/thinning.cpp index 2cc0cb2b..b6f2bfc4 100644 --- a/src/cctag/filter/thinning.cpp +++ b/src/cctag/filter/thinning.cpp @@ -9,19 +9,19 @@ namespace cctag { +static const int lutthin1[512] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 0, 255, 255, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 0, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }; +static const int lutthin2[512] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 255, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 255, 255, 0, 255, 255, 255 }; + void thin( cv::Mat & inout, cv::Mat & temp ) { - int lutthin1[512] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 0, 255, 255, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 0, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }; - int lutthin2[512] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 255, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 0, 0, 255, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 255, 255, 0, 255, 255, 255 }; - imageIter( inout, temp, lutthin1 ); imageIter( temp, inout, lutthin2 ); } -void imageIter( cv::Mat & in, cv::Mat & out, int* lut ) +void imageIter( const cv::Mat & in, cv::Mat & out, const int* lut ) { - int width = in.cols - 1 ; - int height = in.rows - 1 ; + const int width = in.cols - 1 ; + const int height = in.rows - 1 ; for( int y = 1; y < height; ++y ) { diff --git a/src/cctag/filter/thinning.hpp b/src/cctag/filter/thinning.hpp index 34045a59..e30616b8 100644 --- a/src/cctag/filter/thinning.hpp +++ b/src/cctag/filter/thinning.hpp @@ -17,7 +17,7 @@ namespace cctag { void thin( cv::Mat & inout, cv::Mat & temp ); -void imageIter( cv::Mat & in, cv::Mat & out, int* lut ); +void imageIter( const cv::Mat & in, cv::Mat & out, const int* lut ); } From 18d0a19a6db21d7f8b24dd8c6df640e0ae754338 Mon Sep 17 00:00:00 2001 From: Simone Gasparini Date: Sat, 17 Apr 2021 16:01:24 +0200 Subject: [PATCH 4/4] [ci] fix missing LD_LIBRARY_PATH --- .github/workflows/continuous-integration.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index e020a8d6..e95ab18d 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -52,6 +52,7 @@ jobs: - name: Unit Tests working-directory: ./build run: | + export LD_LIBRARY_PATH=${DEPS_INSTALL_DIR}/lib:${LD_LIBRARY_PATH} make test - name: Build As Third Party