Skip to content

Commit

Permalink
Increase CMAKE version and create constant for thickness
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltroger committed Feb 29, 2024
1 parent 979ced8 commit f4ffba1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
9 changes: 5 additions & 4 deletions app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand Down
13 changes: 7 additions & 6 deletions app/src/main/cpp/native_opencv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ORB> fd_de;
BFMatcher dm(NORM_HAMMING);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit f4ffba1

Please sign in to comment.