簡體   English   中英

調整視頻捕獲的分辨率

[英]adjusting the resolution of a video capture

我有一個1280x1024的視頻輸入設備,我寫了一個小的opencv項目來捕獲它的圖像,但是我只得到640x480的圖像? 任何人都知道我為什么得到它,這是我的代碼:

 #include <opencv2\highgui\highgui.hpp>
 #include <opencv2\core\core.hpp>
 #include <opencv2\opencv.hpp>

using namespace std;

 int main(){
cv::VideoCapture cap(2);
cv::Mat  frame;
int key = 0;
while(key != 27){
    cap.read(frame);


    cv::imshow("test",frame);
    key = cv::waitKey(10);
}
return 0 ;}

在此先感謝您的幫助

從OpenCV的最新版本開始:

cap.set(CV_CAP_PROP_FRAME_WIDTH, 1280);
cap.set(CV_CAP_PROP_FRAME_HEIGHT, 1024);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM