CvCapture* pCapture = cvCreateCameraCapture(-1)运行时提示mmap:无效的参数 munmap:无效的参数
我今天写了个测试程序,想用在820linux下的坐标测试,发现这句话执行时会报这样的提示,但依旧能正常预览视频,我很奇怪!虽说能运行,但下到板子里就不行了。请高人提示下,我的测试代码:
#include <stdio.h>
#include <cv.h>
#include <highgui.h>
int main()
{
//声明IplImage指针
IplImage* pFrame = NULL;
printf("IplImage oK\n");
//获取摄像头
CvCapture* pCapture = cvCreateCameraCapture(-1);
printf("cvCreateCameraCapture OK!\n");
//创建窗口
cvNamedWindow("video", 1);
printf("cvNamedwindow OK!\n");
//显示视屏
while(1)
{
pFrame=cvQueryFrame( pCapture );
printf("first frame\n");
if(!pFrame)
{
printf("fail to cvQueryFrame!\n");
break;
}
cvShowImage("video",pFrame);
char c=cvWaitKey(33);
if(c==27)break;
}
cvReleaseCapture(&pCapture);
cvReleaseImage(&pFrame);
cvDestroyWindow("video");
}
用gcc编译器之后,运行结果如下:
IplImage oK
mmap: Invalid argument
munmap: Invalid argument
munmap: Invalid argument
munmap: Invalid argument
munmap: Invalid argument
Unable to stop the stream.: Bad file descriptor
munmap: Invalid argument
munmap: Invalid argument
munmap: Invalid argument
munmap: Invalid argument
cvCreateCameraCapture OK!
cvNamedwindow OK!
后面的都好好的。。。。 渴望您的指点