From 81193da5a447522cdf5c9b9e8ee428c1ca89c466 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Fri, 19 Jun 2020 16:41:52 +0300 Subject: [PATCH] add a simple test executable --- CMakeLists.txt | 5 +++++ src/test.cpp | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 src/test.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 199ad4e..f6b1d0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,3 +49,8 @@ if(CUDA_FOUND AND WITH_CUDA) elseif(${WITH_CUDA}) message(WARNING "Could not find CUDA") endif() + +if (BUILD_TEST) + add_executable(test src/test.cpp) + target_link_libraries(test PRIVATE ${PROJECT_NAME}_gpu ${PROJECT_NAME}_cpu) +endif() diff --git a/src/test.cpp b/src/test.cpp new file mode 100644 index 0000000..8eb9f14 --- /dev/null +++ b/src/test.cpp @@ -0,0 +1,12 @@ +#include "surface_normal/opencv2.hpp" + +using namespace surface_normal; + +int main() { + CameraIntrinsics intrinsics; + intrinsics.f = 721.5377; + intrinsics.cx = 609.5593; + intrinsics.cy = 172.8540; + normals_from_depth_imgfile("depth.png", "normals.png", intrinsics, 15, 0.1, true); + return 0; +}