// test.cpp #include <cv.h>
#include <cxcore.h>
#include <highgui.h>
int main()
{
CvCapture* capture = NULL;
IplImage* frame = NULL;
if( !(capture = cvCaptureFromCAM(-1)))
{
fprintf(stderr, "Can not open camera.\n");
return -1;
} cvNamedWindow("video", 1); while(frame = cvQueryFrame( capture ) )
{
cvShowImage("video", frame);
} cvDestroyWindow("video");
cvReleaseCapture(&capture);
return 0;
}
编译链接测试程序arm-linux-g++ -I/usr/local/arm/lib/opencv/include/opencv/-L/usr/local/arm/lib/opencv/lib/ -lcv -lcxcore -lhighgui -lpthread -lrt -o testtest.cpp
在板子上运行,会出现Can not open camera是不是,opencv程序不能在板子上运行啊?求解释
|