#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,攝像頭就是黑屏,然后設定成641480,獲取設定仍舊是640*480,但是影像就出來了?
誰知道原因?
字數一定要很多嗎?我就奇怪了?我就是好的嘛?字數一定要很多嗎?我就奇怪了?我就是好的嘛?字數一定要很多嗎?我就奇怪了?我就是好的嘛?字數一定要很多嗎?我就奇怪了?我就是好的嘛?字數一定要很多嗎?我就奇怪了?我就是好的嘛?字數一定要很多嗎?我就奇怪了?我就是好的嘛?字數一定要很多嗎?我就奇怪了?我就是好的嘛?字數一定要很多嗎?我就奇怪了?我就是好的嘛?字數一定要很多嗎?我就奇怪了?我就是好的嘛?
空間太多了?!!!
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/254323.html
標籤:其他
上一篇:在Golang中如何正確地使用database/sql包訪問資料庫
下一篇:python練習(一):購物車
