Hi,
I’m trying to use Cinder with Realsense and OpenCV4 on Raspberry Pi. I have managed to make both of them to work separately in a Cinder app. After that, I tried to use the librealsense2’s OpenCV imshow example inside cinder, but I got the error
TestApp.cpp:(.text+0x8e6): undefined reference to `cv::error(int, std::string const&, char const*, char const*, int)'
I believe the error is caused by the transformation of raw data into a cv::Mat, but it works outside Cinder:
Mat image(Size(w, h), CV_8UC3, (void*)depth.get_data(), Mat::AUTO_STEP);
I used cmake to complie and the CMakeLists.txt that I have:
cmake_minimum_required( VERSION 2.8 FATAL_ERROR )
set( CMAKE_VERBOSE_MAKEFILE ON )
project( TestApp )
find_package(OpenCV REQUIRED)
include_directories( ${OpenCV_INCLUDE_DIRS} )
find_package(realsense2 REQUIRED)
get_filename_component( CINDER_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../../Cinder" ABSOLUTE )
get_filename_component( APP_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../" ABSOLUTE )
include( "${CINDER_PATH}/proj/cmake/modules/cinderMakeApp.cmake" )
ci_make_app(
SOURCES ${APP_PATH}/src/TestApp.cpp
CINDER_PATH ${CINDER_PATH}
LIBRARIES ${OpenCV_LIBS}
)
target_link_libraries(TestApp ${OpenCV_LIBS})
target_link_libraries(TestApp ${realsense2_LIBRARY})
I have look up anywhere and could not find a solution. Is there any advise? I would be thankful for any help.
(edit: fixed the formatting of this post ~Paul)