如何設置相機FPS?可以是 cvSetCaptureProperty(cameraCapture,CV_CAP_PROP_FPS,30); ?如何在OpenCV中設置攝像頭FPS? CV_CAP_PROP_FPS是假的
但它返回 HIGHGUI ERROR:V4L2:無法獲取屬性(5) - 無效參數
因爲在highgui/cap_v4l.cpp沒有實現
static int icvSetPropertyCAM_V4L(CvCaptureCAM_V4L* capture,
int property_id, double value){
static int width = 0, height = 0;
int retval;
/* initialization */
retval = 0;
/* two subsequent calls setting WIDTH and HEIGHT will change
the video size */
/* the first one will return an error, though. */
switch (property_id) {
case CV_CAP_PROP_FRAME_WIDTH:
width = cvRound(value);
if(width !=0 && height != 0) {
retval = icvSetVideoSize(capture, width, height);
width = height = 0;
}
break;
case CV_CAP_PROP_FRAME_HEIGHT:
height = cvRound(value);
if(width !=0 && height != 0) {
retval = icvSetVideoSize(capture, width, height);
width = height = 0;
}
break;
case CV_CAP_PROP_BRIGHTNESS:
case CV_CAP_PROP_CONTRAST:
case CV_CAP_PROP_SATURATION:
case CV_CAP_PROP_HUE:
case CV_CAP_PROP_GAIN:
case CV_CAP_PROP_EXPOSURE:
retval = icvSetControl(capture, property_id, value);
break;
default:
fprintf(stderr,
"HIGHGUI ERROR: V4L: setting property #%d is not supported\n",
property_id);
}
/* return the the status */
return retval;
}
如何解決呢?
我確定地說,並非所有相機都支持所有的操作。 –
我從來沒有說過,我只是告訴我的經驗和我是如何解決類似的問題。 –
這是真的,但我有一個羅技c920和該相機不支持所有操作。我只是想支持你的說法「其他只是爲某些類型的相機」:),相關http://stackoverflow.com/questions/16432676/cant-access-properties-of-cvvideocapture-with-logitech-c920 –