OpenCV/Patch to enable capturing frame rate setting on OpenCV 2.2 †
#multilang(ja){{
概要 †
OpenCV 2.2のDirectShow?によるキャプチャでフレームレート変更を有効にするパッチです.
※こちらで配布されているOpenCV-2.2.0-win.zipを対象としたパッチです.
ダウンロード †
Version | Filename | Size | Date | Type | Download |
1.0 | highgui_dshow_fps_patch_v1.zip | 14.96 KB | 20110702 | zip |  |
変更履歴 †
Version | Date | 変更内容 |
1.0 | 20110702 | 新規作成 |
内容物 †
使い方 †
- 上記リンクからhighgui_dshow_fps_patch_v1.zipをダウンロードして展開します.
- 展開したファイル(cap_dshow.cpp、precomp.hpp)を下記ディレクトリにコピーして下さい.
OpenCV-2.2.0\modules\highgui\src
- CMakeでWITH_VIDEOINPUTを有効にしてビルドしてください.
サンプルプログラム †
| #include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#pragma comment( lib, "opencv_core220.lib" )
#pragma comment( lib, "opencv_highgui220.lib" )
int main (int argc, char **argv)
{
CvCapture *capture = NULL;
IplImage *frame = NULL;
double w = 320;
double h = 240;
double fps = 30;
int c = 0;
capture = cvCreateCameraCapture(CV_CAP_DSHOW);
if(capture == NULL)
{
fprintf(stderr, "[Error]Could not initialize capturing\n");
return -1;
}
cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, w);
cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT, h);
cvSetCaptureProperty(capture, CV_CAP_PROP_FPS, fps);
cvNamedWindow("Capture", CV_WINDOW_AUTOSIZE);
while(1)
{
frame = cvQueryFrame(capture);
cvShowImage("Capture", frame);
c = cvWaitKey(1);
if(c == '\x1b') break;
}
cvReleaseCapture(&capture);
cvDestroyWindow("Capture");
return 0;
}
|
Contact †
間違い・御指摘等ありましたら,
までメールにてご連絡ください.
}}
#multilang(en){{
Abstract
This page describes the way to enable capturing frame rate setting on OpenCV 2.2.
This patch is intended for OpenCV-2.2.0-win.zip in Official Release.
Download
Version | Filename | Size | Date | Type | Download |
1.0 | highgui_dshow_fps_patch_v1.zip | 14.96 KB | 20110702 | zip |  |
ChangeLog?
Version | Date | Changes |
1.0 | 20110702 | First Release |
Files
Usage
- Please download highgui_dshow_fps_patch_v1.zip. And,extract this file.
- Please overwrite the patch's files to the following directory.
OpenCV-2.2.0\modules\highgui\src
- Please enable WITH_VIDEOINPUT on CMake, and build OpenCV.
Sample
| #include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#pragma comment( lib, "opencv_core220.lib" )
#pragma comment( lib, "opencv_highgui220.lib" )
int main (int argc, char **argv)
{
CvCapture *capture = NULL;
IplImage *frame = NULL;
double w = 320;
double h = 240;
double fps = 30;
int c = 0;
capture = cvCreateCameraCapture(CV_CAP_DSHOW);
if(capture == NULL)
{
fprintf(stderr, "[Error]Could not initialize capturing\n");
return -1;
}
cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, w);
cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT, h);
cvSetCaptureProperty(capture, CV_CAP_PROP_FPS, fps);
cvNamedWindow("Capture", CV_WINDOW_AUTOSIZE);
while(1)
{
frame = cvQueryFrame(capture);
cvShowImage("Capture", frame);
c = cvWaitKey(1);
if(c == '\x1b') break;
}
cvReleaseCapture(&capture);
cvDestroyWindow("Capture");
return 0;
}
|
Contact
If you have question,please send e-mail to the following address.

}}