#include <opencv2/core.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp> // cv::Canny()
#include <iostream>
#include <opencv2\videoio\videoio_c.h>
using namespace std;
using namespace cv;
int main()
{
VideoCapture capture;
capture.open(1);
if (!capture.isOpened())
{
cout << "--(!)Error opening video capture\n";
return -1;
}
//capture.set(CV_CAP_PROP_FRAME_WIDTH, 641);//寬度
//capture.set(CV_CAP_PROP_FRAME_HEIGHT, 480);//高度
printf("width = %.2f\n", capture.get(CV_CAP_PROP_FRAME_WIDTH));
printf("height = %.2f\n", capture.get(CV_CAP_PROP_FRAME_HEIGHT));
Mat frame;
while (true)
{
capture >> frame;
if (frame.empty())
{
cout << "--(!) No captured frame -- Break!\n";
break;
}
imshow("V", frame);
if (waitKey(5) > 0)
break;
}
}
opencv缺省視頻的寬高為640480,攝像頭就是黑屏,然后設(shè)置成641480,獲取設(shè)置仍舊是640*480,但是圖像就出來了?
誰知道原因?
字數(shù)一定要很多嗎?我就奇怪了?我就是好的嘛?字數(shù)一定要很多嗎?我就奇怪了?我就是好的嘛?字數(shù)一定要很多嗎?我就奇怪了?我就是好的嘛?字數(shù)一定要很多嗎?我就奇怪了?我就是好的嘛?字數(shù)一定要很多嗎?我就奇怪了?我就是好的嘛?字數(shù)一定要很多嗎?我就奇怪了?我就是好的嘛?字數(shù)一定要很多嗎?我就奇怪了?我就是好的嘛?字數(shù)一定要很多嗎?我就奇怪了?我就是好的嘛?字數(shù)一定要很多嗎?我就奇怪了?我就是好的嘛?
空間太多了??。。?/p>
|