【发布时间】:2012-12-15 21:43:19
【问题描述】:
我使用的是 VS2010、OpenCV 2.1、Windows XP,但出现错误:内存位置异常
通常这是因为某些内容为 NULL,但事实并非如此:
VideoCapture cap = VideoCapture(); // open the default camera
cap.open("smartbeam1.avi");
if(!cap.isOpened()) // check if we succeeded
return -1;
Mat edges,color_dst;
Mat frame ;
namedWindow("original",1);
namedWindow("edges",1);
for(;;)
{
cap >> frame; // get a new frame from camera
cvtColor(frame, edges, CV_BGR2GRAY);
GaussianBlur(edges, edges, Size(7,7), 1.5, 1.5);
Canny(edges, edges, 0, 30, 3);
//Houg
vector<Vec2f> lines;
**HoughLines(edges, lines, 1, CV_PI/180, 100 );//I Get Location Memory**
...
}
【问题讨论】:
-
您的代码在 Ubuntu 12.10、Opencv 2.4.3 上运行良好。
-
我正在使用 windows xp :( .
-
请尝试更新的 OpenCV 版本。