Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Ubuntu11.10上使用cuda和opencv_Opencv_Ubuntu_Cuda_Ros_Orb - Fatal编程技术网

如何在Ubuntu11.10上使用cuda和opencv

如何在Ubuntu11.10上使用cuda和opencv,opencv,ubuntu,cuda,ros,orb,Opencv,Ubuntu,Cuda,Ros,Orb,我想在ubuntu上运行surfgpu。但不知道如何编写CmakeList。我已经安装了CUDA 4.2 SDK和工具包,程序中的C可以运行。我的开发环境是Qt.ubuntu 11.10。opencv2.4.2非常感谢任何好的建议。这个怎么样 # CMakeLists.txt to build OpenCV project cmake_minimum_required(VERSION 2.8) project( testOpenCV ) 查找OpenCV和CUDA包 find_package(

我想在ubuntu上运行surfgpu。但不知道如何编写CmakeList。我已经安装了CUDA 4.2 SDK和工具包,程序中的C可以运行。我的开发环境是Qt.ubuntu 11.10。opencv2.4.2非常感谢任何好的建议。

这个怎么样

# CMakeLists.txt to build OpenCV project
cmake_minimum_required(VERSION 2.8)
project( testOpenCV )
查找OpenCV和CUDA包

find_package(OpenCV REQUIRED )
find_package(CUDA 4.2 REQUIRED)
从一些目录中包括

# Since surf is a non free package, you also have to add non free include dir
include_directories( ${OpenCV_INCLUDE_DIR} "${OpenCV_SOURCE_DIR}/modules/nonfree/include" ${CUDA_INCLUDE_DIRS})
编译源代码

cuda_add_executable( exefile source.cpp source2.cpp )
target_link_libraries( exefile ${OpenCV_LIBS} ${otherlibsyouneed} )
只有使用
-DHAVE\u CUDA