message(FATAL_ERROR "opencv missing. please install opencv")
endif(OpenCV_LIBS)
+find_package(Boost COMPONENTS thread REQUIRED)
+find_package(Threads REQUIRED)
+
#find opencv ocl headers:
find_path(ocl ocl.hpp PATH_SUFFIXES opencv/ocl opencv2/ocl DOC "opencv ocl headers")
message(STATUS "no opencv cuda headers found. no cuda support")
endif(cuda)
-include_directories(${CMAKE_SOURCE_DIR}/lib ${include_dirs} ${OpenCV_INCLUDE_DIRS})
+include_directories(${CMAKE_SOURCE_DIR}/lib ${include_dirs} ${OpenCV_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
set(opencvluxplugin_headers opencvluxplugin.h)
set(opencvluxplugin_sources opencvluxplugin.cpp)
add_library(opencvluxplugin MODULE ${opencvluxplugin_sources} ${opencvluxplugin_headers_moc})
set_target_properties(opencvluxplugin PROPERTIES PREFIX "")
-target_link_libraries(opencvluxplugin amb -L${CMAKE_CURRENT_BINARY_DIR}/lib ${link_libraries} ${OpenCV_LIBS})
+target_link_libraries(opencvluxplugin amb -L${CMAKE_CURRENT_BINARY_DIR}/lib ${link_libraries} ${OpenCV_LIBS} ${Boost_LIBRARIES})
install(TARGETS opencvluxplugin LIBRARY DESTINATION lib${LIB_SUFFIX}/automotive-message-broker)
#include <iostream>
#include <boost/assert.hpp>
+#include <boost/thread/future.hpp>
#ifdef OPENCL
#include <opencv/ocl/ocl.hpp>
*(shared->m_capture) >> m_image;
}
- uint lux = evalImage(m_image,shared);
-
- shared->parent->updateProperty(lux);
+ /*if(shared->threaded)
+ {
+ auto luxFuture = boost::async([m_image, &shared](){ return evalImage(m_image,shared); });
+ luxFuture.then([&shared](boost::shared_future<uint> f) { shared->parent->updateProperty(f.get()); });
+ }
+ else*/
+ {
+ int lux = evalImage(m_image,shared);
+ shared->parent->updateProperty(lux);
+ }
if(shared->mRequests.size())
{