萌新求指导 打不摄像头
opencv吧
全部回复
仅看楼主
level 3
#include "stdafx.h"
#include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main(int argc, char**argv)
{
VideoCapture capture(0);
if (!capture.isOpened())
{
printf("not opened ....\n");
return -1;
}
Size S = Size((int)capture.get(CV_CAP_PROP_FRAME_WIDTH),(int)capture.get(CV_CAP_PROP_FRAME_HEIGHT));
int fps = capture.get(CV_CAP_PROP_FPS);
Mat frame;
namedWindow("camfa", CV_WINDOW_AUTOSIZE);
while (capture.read(frame))
{
flip(frame, frame, 1);
imshow("camfa", 1);
char c = waitKey(100);
if (c == 27)
{
break;
}
}
capture.release();
waitKey(0);
return 0;
}
打不开摄像头
2018年01月10日 05点01分 1
level 3
打开是这样的
2018年01月10日 05点01分 2
level 3
有没有大神帮忙解决一下[泪]
2018年01月10日 05点01分 3
level 8
3252314061
2018年01月11日 01点01分 4
level 2
VideoCapture capture(0);换下参数试试
2018年01月11日 07点01分 5
level 1
VideoCapture capture(-1);
cvWaitkey(33);写在imshow的后面
2018年01月16日 19点01分 6
level 1
imshow("camfa", 1);第二个参数错了,你太粗心
2018年01月21日 06点01分 7
1