OpenCV无法识别BeagleBone中的相机
OpenCV does not recognize a camera in BeagleBone
我编写了以下代码,通过BeagleBone使用相机PlayStation Eye:
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <termios.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <netinet/in.h>
#include "opencv/cv.h"
#include "opencv/highgui.h"
using namespace cv;
using namespace std;
void inputSetup(int setup);
int main(int argc, char *argv[])
{
CvCapture *capture;
Mat img;
capture = cvCaptureFromCAM(-1);
if (capture){
printf("mmm...n");
inputSetup(1);
img = cvQueryFrame(capture);
}
while (1);
return 0;
}
void inputSetup(int setup)
{
static struct termios oldt, newt;
if (setup) {
tcgetattr(STDIN_FILENO, &oldt);
newt = oldt;
newt.c_lflag &= ~(ICANON);
tcsetattr( STDIN_FILENO, TCSANOW, &newt);
}
else {
tcsetattr( STDIN_FILENO, TCSANOW, &oldt);
}
}
问题是它无法识别相机,因为代码不会进入第一个"if"(打印"mmm..."的那个)。我已经尝试过使用"capture = cvCaptureFromCAM(0);",但它也不起作用。
我正在使用以下命令编译代码:
g++ -Wall -g -o CamaraTest CamaraTest.cpp `pkg-config --cflags --libs opencv`
如何解决此问题?
使用最新的 OpenCV Git 存储库。相机驱动程序中存在问题,但其中大多数已经修复。
相关文章:
- 了解 GLM- openGL 中的相机转换
- OpenGL相机和相机空间转型的困惑
- 如何使用按钮更新GTK3图像以使用C++从相机捕获图片
- 通过 API 控制 DJI 相机
- 将相机数据从服务器实时流式传输到客户端
- 来自逆 vp 矩阵和相机位置的光线方向不正确
- OpenCV - Python 断言错误:SAD 算法 - 立体相机视差图计算
- Qt 和 Android - 如何使用 Qandroidjniobject 启动相机
- 在Windows(C++)中使用USB相机拍摄高分辨率照片
- 如何在相机类中添加胶卷
- 强制Qt相机视频格式
- 操纵安卓相机的深度图导致应用程序崩溃
- 深度值没有意义 R200 相机
- Qt QML相机在部署后显示白屏
- Opencv 如何从相机读取单帧
- OpenCV - 来自相机的实时馈送不流畅
- 佳能SDK无法从相机下载图片
- OpenNI2,BeagleBone Black,华硕XTION相机:在640x480获得彩色流时出现问题
- OpenCV无法识别BeagleBone中的相机
- 如何关闭相机(OpenCv Beaglebone)