From f4ffba10706fc63688ca131316f30545142df5b4 Mon Sep 17 00:00:00 2001 From: Michael Troger Date: Thu, 29 Feb 2024 18:47:07 +0100 Subject: [PATCH] Increase CMAKE version and create constant for thickness --- app/src/main/cpp/CMakeLists.txt | 9 +++++---- app/src/main/cpp/native_opencv.cpp | 13 +++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/src/main/cpp/CMakeLists.txt b/app/src/main/cpp/CMakeLists.txt index 4e88a8a..4e607af 100644 --- a/app/src/main/cpp/CMakeLists.txt +++ b/app/src/main/cpp/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.22.1) # register the project for the C++ language project(app CXX) @@ -12,11 +12,12 @@ add_library( SHARED native_opencv.cpp ) + # compile with c++20 -set_target_properties( +target_compile_features( app - PROPERTIES - CXX_STANDARD 20 + PUBLIC + cxx_std_20 ) # link the required libs together diff --git a/app/src/main/cpp/native_opencv.cpp b/app/src/main/cpp/native_opencv.cpp index 89be046..aed3247 100644 --- a/app/src/main/cpp/native_opencv.cpp +++ b/app/src/main/cpp/native_opencv.cpp @@ -15,9 +15,10 @@ using namespace cv; #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) #define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) -Mat* mCanny = NULL; - const Scalar RGBA_DRAWING_COLOR = Scalar(0, 255, 0, 255); +const int LINE_THICKNESS = 4; + +Mat* mCanny = NULL; Ptr fd_de; BFMatcher dm(NORM_HAMMING); @@ -119,22 +120,22 @@ extern "C" { scene_corners[0], scene_corners[1], RGBA_DRAWING_COLOR, - 4 ); + LINE_THICKNESS); line( rgbaImg, scene_corners[1], scene_corners[2], RGBA_DRAWING_COLOR, - 4 ); + LINE_THICKNESS); line( rgbaImg, scene_corners[2], scene_corners[3], RGBA_DRAWING_COLOR, - 4 ); + LINE_THICKNESS); line( rgbaImg, scene_corners[3], scene_corners[0], RGBA_DRAWING_COLOR, - 4 ); + LINE_THICKNESS); } catch (Exception e) {