1
执行此代码时:错误的OpenCV
#include <iostream>
#include "opencv2/opencv.hpp"
#include "opencv2/gpu/gpu.hpp"
int main (int argc, char* argv[]){
try
{
cv::Mat src_host = cv::imread(argv[1], CV_LOAD_IMAGE_GRAYSCALE);
cv::gpu::GpuMat dst, src;
src.upload(src_host);
cv::gpu::threshold(src, dst, 128.0, 255.0, CV_THRESH_BINARY);
cv::Mat result_host;
dst.download(result_host);
cv::imshow("Result", result_host);
cv::waitKey();
}
catch(const cv::Exception& ex)
{
std::cout << "Error: " << ex.what() << std::endl;
}
return 0;
}
编译罚款...但我跑,我得到以下错误:
OpenCV Error: Unknown error code -216 (The library is compiled without CUDA support) in copy, file /home/cbib/Descargas/OpenCV-2.4.3/modules/core/src/gpumat.cpp, line 736
我已经安装了opencv cuda,如图所示。
我的操作系统是Ubuntu Server 10.04。
这似乎: 其他第三方库: - 使用IPP:NO - 使用TBB:YES(见2.2接口,4001) - 使用的OpenCL:NO - 使用艾根:YES(见2.0.12) 并下载OpenCV 2.4.3:s –
@ChitoWebster您是否在系统上安装了cuda? –
是... Cuda汇编工具,版本4.2,V0.2.1221 –