Question

So I am trying to work with the Kinect by using the libfreenect driver and OpenCV. I want to be able to create the project using CMake. I was able to get the proper CMakeList for me to be able to load the OpenCV librery. Now I want to input video using the kinect but cant find any help for this.

Also I'm using Ubuntu 12.04 64bit on a laptop.

How can I do this using Cmake?

p.s. I was able to install libfreenect properly, the demo programs run just fine.

Was it helpful?

Solution

You might want to have a look at this:

cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project("My Project")

find_package(OpenCV REQUIRED)
find_package(Threads REQUIRED)
find_package(libfreenect REQUIRED)

include_directories("/usr/include/libusb-1.0/")

add_executable(regtest src/regtest.cpp
                       src/features.cpp)
target_link_libraries(regtest  ${OpenCV_LIBS}
                               ${CMAKE_THREAD_LIBS_INIT}
                               ${FREENECT_LIBRARIES})

add_executable(main src/main.cpp
                    src/features.cpp)
target_link_libraries(main  ${OpenCV_LIBS}
                            ${CMAKE_THREAD_LIBS_INIT}
                            ${FREENECT_LIBRARIES})

This is the CMakeLists.txt I used for a project using both OpenCV and freenect.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top