溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

關(guān)于opencv設(shè)置視頻的屬性無(wú)效問(wèn)題

發(fā)布時(shí)間:2020-08-11 21:37:17 來(lái)源:網(wǎng)絡(luò) 閱讀:1387 作者:qq58edf671cb8f8 欄目:開(kāi)發(fā)技術(shù)

自己最近做一個(gè)項(xiàng)目,采用Opencv2.4.10+MFC處理,結(jié)果發(fā)現(xiàn),在視頻處理過(guò)程中,采用bool VideoCapture::set(int propId, double value)函數(shù)設(shè)置圖像的分辨率,返回值為0,查看opencv2.4.10文檔,是這樣的

propId – Property identifier. It can be one of the following:
– CV_CAP_PROP_POS_MSEC Current position of the video file in milliseconds.
– CV_CAP_PROP_POS_FRAMES 0-based index of the frame to be decoded/captured
next.
– CV_CAP_PROP_POS_AVI_RATIO Relative position of the video file: 0 - start of the
film, 1 - end of the film.
– CV_CAP_PROP_FRAME_WIDTH Width of the frames in the video stream.
– CV_CAP_PROP_FRAME_HEIGHT Height of the frames in the video stream.
– CV_CAP_PROP_FPS Frame rate.
– CV_CAP_PROP_FOURCC 4-character code of codec.
– CV_CAP_PROP_FRAME_COUNT Number of frames in the video file.
– CV_CAP_PROP_FORMAT Format of the Mat objects returned by retrieve() .
– CV_CAP_PROP_MODE Backend-specific value indicating the current capture mode.
– CV_CAP_PROP_BRIGHTNESS Brightness of the p_w_picpath (only for cameras).
– CV_CAP_PROP_CONTRAST Contrast of the p_w_picpath (only for cameras).
– CV_CAP_PROP_SATURATION Saturation of the p_w_picpath (only for cameras).
– CV_CAP_PROP_HUE Hue of the p_w_picpath (only for cameras).
– CV_CAP_PROP_GAIN Gain of the p_w_picpath (only for cameras).
– CV_CAP_PROP_EXPOSURE Exposure (only for cameras).
– CV_CAP_PROP_CONVERT_RGB Boolean flags indicating whether p_w_picpaths should
be converted to RGB.
– CV_CAP_PROP_WHITE_BALANCE Currently unsupported
– CV_CAP_PROP_RECTIFICATION Rectification flag for stereo cameras (note: only
supported by DC1394 v 2.x backend currently)
value – Value of the property.

文檔中并沒(méi)有明確視頻幀的寬度,高度僅僅適合攝像頭或是視頻,于是我用

CV_CAP_PROP_FRAME_WIDTH,CV_CAP_PROP_FRAME_HEIGHT設(shè)置視頻幀的分辨率,結(jié)果

結(jié)果發(fā)現(xiàn),設(shè)置無(wú)效,于是總結(jié)出目前的opencv版本不支持視頻幀

分辨率設(shè)置。

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI