-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add example with C++ and OpenCV 2 #646
base: master
Are you sure you want to change the base?
Conversation
…ki/C%2B%2BOpenCvExample Signed-off-by: Remy Mellet <remy.mellet@gmail.com>
find_package(Threads) | ||
find_package( OpenCV REQUIRED ) | ||
|
||
include_directories(. ${THREADS_PTHREADS_INCLUDE_DIR}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include_directories(. ${THREADS_PTHREADS_INCLUDE_DIR})
doesn't seems to be needed, maybe other OS? (tested on Ubuntu 20.04 LTS)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not be necessary - I think THREADS_PTHREADS_INCLUDE_DIR
does not even exist in CMake anymore. But since you already require cxx_std_11, you could use std::thread
and std::mutex
instead of pthread in the code. Then there would be no need to find Threads package at all.
find_package(Threads) | ||
find_package( OpenCV REQUIRED ) | ||
|
||
include_directories(. ${THREADS_PTHREADS_INCLUDE_DIR}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not be necessary - I think THREADS_PTHREADS_INCLUDE_DIR
does not even exist in CMake anymore. But since you already require cxx_std_11, you could use std::thread
and std::mutex
instead of pthread in the code. Then there would be no need to find Threads package at all.
|
||
include_directories(. ${THREADS_PTHREADS_INCLUDE_DIR}) | ||
|
||
add_executable( freenect-cppopencv cppopencv.cpp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion - make this conditional on if (BUILD_EXAMPLES)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that CMakeLists.txt is included only if BUILD_CV
is enabled. Are you sure you want a 2nd condition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally yes because this is an example. But I see the existing cvdemo does not depend on BUILD_EXAMPLES
so it's just a suggestion.
Add example using C++ and OpenCV 2 to display and saving RGB + D frames
based on https://openkinect.org/wiki/C%2B%2BOpenCvExample
Need to enable BUILD_CV (
set (BUILD_CV ON)
)Signed-off-by: Remy Mellet remy.mellet@gmail.com