opencv houghlines出错

问题描述

opencv houghlines出错

我用opencv进行HoughLines变换的时候,前面canny边缘检测都是没事的,后面进行houghlines变换的时候程序崩溃了
int main(){
//载入原始图像
Mat src = imread("pic1.png");
Mat img1,img2;//临时变量和目标图的定义

Canny(src, img1, 50, 200, 3);
cvtColor(img1,img2, CV_GRAY2BGR);

vector<Vec2f> lines;
HoughLines(img1, lines, 1, CV_PI/180, 150, 0, 0 );
//cout<<lines.size();
for( size_t i = 0; i < lines.size(); i++ )
{
    float rho = lines[i][0], theta = lines[i][1];
    Point pt1, pt2;
    double a = cos(theta), b = sin(theta);
    double x0 = a*rho, y0 = b*rho;
    pt1.x = cvRound(x0 + 1000*(-b));
    pt1.y = cvRound(y0 + 1000*(a));
    pt2.x = cvRound(x0 - 1000*(-b));
    pt2.y = cvRound(y0 - 1000*(a));
line( img2, pt1, pt2, Scalar(0,0,255), 3, CV_AA);
}
imshow("原图", src);
imshow("canny边缘检测", img1);
imshow("houghline变换", img2);
waitKey(0);
return 0;

}

ERROR: Required OpenCL device not found, check configuration:
Platform: any
Device types: GPU
Device name: any
OpenCV Error: Unknown error code -33 (Requested OpenCL device is not found) in c
v::ocl::selectOpenCLDevice, file C:buildsmaster_PackSlave-win32-vc11-sharedop
encvmodulescoresrcocl.cpp, line 2344

请问这是怎么回事??

时间: 2024-10-31 20:04:59

opencv houghlines出错的相关文章

linux-qt上编译opencv程序出错

问题描述 qt上编译opencv程序出错 编译提取棋盘格角点的的程序,但是一直显示cvFindChessboardCorners这个函数有问题,请大神指教! 错误如下: ../qt_subpix1/main.cpp: In function 'int main(int, char**)': ../qt_subpix1/main.cpp:14:19: warning: deprecated conversion from string constant to 'char*' [-Wwrite-st

opencv配置出错-opencv3.0+VS2013配置出错

问题描述 opencv3.0+VS2013配置出错 1C 亲们,配置opencv总是出错啊,所有的链接库我都配置好几遍了,还是有问题啊 1>------ 已启动生成: 项目: opencv_test 配置: Debug Win32 ------1>LINK : fatal error LNK1104: 无法打开文件"opencv_ts300d.obj"========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ========== 解决方案 ple

c-还是OPENCV编译出错,arm版本,出现错误

问题描述 还是OPENCV编译出错,arm版本,出现错误 错误如下: Linking CXX static library ../../lib/libopencv_haartraining_engine.a [ 82%] Built target opencv_haartraining_engine Scanning dependencies of target opencv_createsamples [ 82%] Building CXX object modules/haartrainin

frame-关于opencv程序一运行就出错,帮帮我啊

问题描述 关于opencv程序一运行就出错,帮帮我啊 #include"highgui.h" int main(int argc,char** argv) { cvNamedWindow("Example2",CV_WINDOW_AUTOSIZE); CvCapture* capture=cvCreateFileCapture(argv[1]); IplImage* frame; while(1){ frame=cvQueryFrame(capture); if(!

gpu-cuda opencv GPU模块的使用出错

问题描述 cuda opencv GPU模块的使用出错 #include #include #include #include #include #include #include int main() { int num_devices = cv::gpu::getCudaEnabledDeviceCount(); if (num_devices <= 0) { std::cerr << "There is no devoce" << std::endl

opencv刚配置好,编译出错(求大神们~)

问题描述 opencv刚配置好,编译出错(求大神们~) opencv3.0刚配置好,输入了一个简单程序 #include "stdafx.h" #include using namespace std; using namespace cv; int main(int argc, char* argv[]) { const char* imagename = "emosue.jpg"; //从文件中读入图像 Mat img = imread(imagename);

visual studio-vs2013加载opencv时总是出错,求大神给看看“CvSVM”: 未声明的标识符

问题描述 vs2013加载opencv时总是出错,求大神给看看"CvSVM": 未声明的标识符 "CvSVM": 未声明的标识符 解决方案 CvSVM的头文件是ml.h,你要确认你包含了这个文件,你也可以再OpenCV里找到这个文件 解决方案二: http://blog.csdn.net/fall221/article/details/7938812 解决方案三: 你的include目录配置正确了么?我估计是目录没有配置好,所以找不到 解决方案四: 那我看可能?那就

opencv下surf代码出错显示未经处理的异常: 0xC0000005

问题描述 opencv下surf代码出错显示未经处理的异常: 0xC0000005 #include "opencv2/core/core.hpp" #include "opencv2/features2d/features2d.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/nonfree/nonfree.hpp" #include using na

qte4 5 3-qte4.5.3编译opencv显示图像程序出错

问题描述 qte4.5.3编译opencv显示图像程序出错 用qte4.5.3 make一个简单的opencv显示图像程序时,出现错误:/usr/local/lib/libopencv_calib3d.so:could not read symbols:Invalid operation 具体的.pro工程文件如下: QT+= core QT-=gui TARGET=opencvqt // 工程文件名 CONFIG+=console CONFIG-=app_bundle CONFIG+=link