資源簡介
opencv下實現顯示并更改攝像頭分辨率,幀率,同時能顯示多個攝像頭,基于Opencv2.0以后的版本
代碼片段和文件信息
//--------------------------------------【程序說明】-------------------------------------------
// 程序說明:《OpenCV3編程入門》OpenCV2版書本附贈示例程序13
// 程序描述:攝像頭幀頻檢測
// 測試所用操作系統:?Windows?7?64bit
// 測試所用IDE版本:Visual?Studio?2010
// 測試所用OpenCV版本: 2.4.9
// 2014年11月?Revised?by?@淺墨_毛星云
//------------------------------------------------------------------------------------------------
//Code?to?check?the?OpenCV?installation?on?Raspberry?Pi?and?mesaure?frame?rate
//Author:?Samarth?Manoj?Brahmbhatt?University?of?Pennsyalvania
//---------------------------------【頭文件、命名空間包含部分】----------------------------
// 描述:包含程序所使用的頭文件和命名空間
//------------------------------------------------------------------------------------------------
#include?
#include?
#include?
using?namespace?std;
using?namespace?cv;
//-----------------------------------【main(?)函數】--------------------------------------------
// 描述:控制臺應用程序的入口函數,我們的程序從這里開始
//-------------------------------------------------------------------------------------------------
int?main()
{
VideoCapture?cap;
cap?=?VideoCapture(CV_CAP_DSHOW);
#if?0
cap.set(CV_CAP_PROP_frame_WIDTH?320);
cap.set(CV_CAP_PROP_frame_HEIGHT?240);
// cap.set(CV_CAP_PROP_FPS?20);
#endif
//獲取視頻幀的寬度
double?dWidth?=?cap.get(CV_CAP_PROP_frame_WIDTH);
//獲取視頻幀的高度
double?dHeight?=?cap.get(CV_CAP_PROP_frame_HEIGHT);
cout?<“視頻幀尺寸?:?“?< //獲取視頻的幀速率
double?fps?=?cap.get(CV_CAP_PROP_FPS);
cout?<“幀/秒:“?<
Mat?im?im_g;
double?time?=?0;
unsigned?int?frames?=?0;
while(char(waitKey(1))?!=?‘q‘)?
{
double?t0?=?getTickCount();
cap?>>?im;
frames++;
imshow(“cap1“?im);
time?+=?(getTickCount()?-?t0)?/?getTickFrequency();
// cout?<ames?/?time?<“?fps“?< }
return?0;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????49664??2015-05-27?14:25??更改攝像頭分辨率\Debug\ShowVideofr
?????文件????????406??2015-05-27?09:29??更改攝像頭分辨率\Debug\ShowVideofr
?????文件????1099728??2015-05-27?14:25??更改攝像頭分辨率\Debug\ShowVideofr
?????文件????1600512??2015-05-27?14:25??更改攝像頭分辨率\Debug\ShowVideofr
?????文件???57278464??2015-05-27?14:24??更改攝像頭分辨率\ipch\showvideofr
?????文件??????12800??2015-05-27?09:29??更改攝像頭分辨率\Release\ShowVideofr
?????文件????????406??2015-05-27?09:29??更改攝像頭分辨率\Release\ShowVideofr
?????文件?????969728??2015-05-27?09:29??更改攝像頭分辨率\Release\ShowVideofr
?????文件???????2009??2015-05-27?14:25??更改攝像頭分辨率\ShowVideofr
?????文件?????155161??2015-05-27?14:25??更改攝像頭分辨率\ShowVideofr
?????文件???????1602??2015-05-27?14:25??更改攝像頭分辨率\ShowVideofr
?????文件??????31256??2015-05-27?14:25??更改攝像頭分辨率\ShowVideofr
?????文件????????912??2015-05-27?14:25??更改攝像頭分辨率\ShowVideofr
?????文件???????4702??2015-05-27?14:25??更改攝像頭分辨率\ShowVideofr
?????文件???????9588??2015-05-27?14:25??更改攝像頭分辨率\ShowVideofr
?????文件???????1496??2015-05-27?14:25??更改攝像頭分辨率\ShowVideofr
?????文件???????1022??2015-05-27?14:25??更改攝像頭分辨率\ShowVideofr
?????文件????????698??2015-05-27?14:25??更改攝像頭分辨率\ShowVideofr
?????文件????????392??2015-05-27?14:25??更改攝像頭分辨率\ShowVideofr
?????文件????????381??2015-05-27?14:25??更改攝像頭分辨率\ShowVideofr
?????文件?????????64??2015-05-27?14:25??更改攝像頭分辨率\ShowVideofr
?????文件???????2767??2015-05-27?14:25??更改攝像頭分辨率\ShowVideofr
?????文件??????????0??2015-05-27?09:29??更改攝像頭分辨率\ShowVideofr
?????文件?????617472??2015-05-27?14:25??更改攝像頭分辨率\ShowVideofr
?????文件?????987136??2015-05-27?14:25??更改攝像頭分辨率\ShowVideofr
?????文件????1086550??2015-05-27?09:29??更改攝像頭分辨率\ShowVideofr
?????文件????????864??2015-05-27?09:29??更改攝像頭分辨率\ShowVideofr
?????文件??????15578??2015-05-27?09:29??更改攝像頭分辨率\ShowVideofr
?????文件????????528??2015-05-27?09:29??更改攝像頭分辨率\ShowVideofr
?????文件???????2514??2015-05-27?09:29??更改攝像頭分辨率\ShowVideofr
............此處省略27個文件信息
- 上一篇:奧本海姆《信號與系統》(第二版教材中文版)
- 下一篇:冒險小游戲
評論
共有 條評論