无法在 OpenCV 中访问与 EasyCap USB 2.0(音频-视频适配器)接口的彩色 CCD 相机
我有带有 RCA 连接器的 CCD 相机。现在我必须将这个 CCD 摄像头与我的笔记本电脑连接起来,以便我可以将其用作网络摄像头。因此,我选择了 Easycap USB 2.0 音频视频适配器 (http://easycap.co.uk/) 将视频信号从相机 RCA 连接器获取到 USB,以便我可以插入我的笔记本电脑。安装 Easycap 驱动程序后,我就可以将相机与我的笔记本电脑连接起来。
当我尝试使用 openCV 访问相同的接口相机时,它没有发生:(。但是使用同一段代码,我能够访问笔记本电脑中的内置 USB 相机。请告诉我,为什么我无法读取 CCD 相机作为设备。我哪里出了问题
使用 EasyCap 连接时将
#include "stdafx.h"
#include <iostream>
#include <cv.h>
# include <cxcore.h>
#include <highgui.h>
int _tmain(int argc, _TCHAR* argv[])
{
CvCapture* capture = cvCaptureFromCAM(0);
cvNamedWindow("video", CV_WINDOW_AUTOSIZE );
IplImage *img1=NULL;
while( 1 )
{
img1 = cvQueryFrame(capture);
cvShowImage("video", img1);
if( (cvWaitKey(10) & 255) == 27 ) break;
}
cvReleaseCapture( &capture );
cvDestroyWindow( "video" );
return 0;
}
!
I have CCD camera with RCA connectors. Now I have to interface this CCD camera with my laptop so that i can use it as webcam. Hence i opted for Easycap USB 2.0 audio-video adapter (http://easycap.co.uk/) to get the video signal from camera RCA connector to USB so that i can plugin to my laptop. Once after installing Easycap driver, I was able to interface the camera with my laptop.
When I tried to access the same interfaced camera using openCV, it was not happening :(. But with the same piece of code , i was able to access inbuilt USB camera in my laptop. Please tell me, why im not able to read the CCD camera as device when interfaced using EasyCap. Where am'i going wrong !!!!!
The code which i used to access the CCD camera was ::
#include "stdafx.h"
#include <iostream>
#include <cv.h>
# include <cxcore.h>
#include <highgui.h>
int _tmain(int argc, _TCHAR* argv[])
{
CvCapture* capture = cvCaptureFromCAM(0);
cvNamedWindow("video", CV_WINDOW_AUTOSIZE );
IplImage *img1=NULL;
while( 1 )
{
img1 = cvQueryFrame(capture);
cvShowImage("video", img1);
if( (cvWaitKey(10) & 255) == 27 ) break;
}
cvReleaseCapture( &capture );
cvDestroyWindow( "video" );
return 0;
}
Hope Im clear...Thanks in advance ..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论