W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
通過VideoCapture類支持與英特爾感知計(jì)算SDK兼容的深度傳感器。通過使用VideoCapture的熟悉界面,可以檢索深度圖,RGB圖像和其他一些輸出格式。
為了在OpenCV中使用深度傳感器,您應(yīng)該執(zhí)行以下初步步驟:
VideoCapture可以檢索以下數(shù)據(jù):
為了從深度傳感器獲取深度圖使用VideoCapture :: operator >>,例如:
VideoCapture capture( CAP_INTELPERC );
for(;;)
{
Mat depthMap;
capture >> depthMap;
if( waitKey( 30 ) >= 0 )
break;
}
要獲取幾個(gè)數(shù)據(jù)地圖,請(qǐng)使用VideoCapture :: grab和VideoCapture :: retrieve,例如:
VideoCapture capture(CAP_INTELPERC);
for(;;)
{
Mat depthMap;
Mat image;
Mat irImage;
capture.grab();
capture.retrieve( depthMap, CAP_INTELPERC_DEPTH_MAP );
capture.retrieve( image, CAP_INTELPERC_IMAGE );
capture.retrieve( irImage, CAP_INTELPERC_IR_MAP);
if( waitKey( 30 ) >= 0 )
break;
}
為了設(shè)置和獲取傳感器數(shù)據(jù)生成器的某些屬性,請(qǐng)分別使用VideoCapture :: set和VideoCapture :: get方法,例如:
VideoCapture capture( CAP_INTELPERC );
capture.set( CAP_INTELPERC_DEPTH_GENERATOR | CAP_PROP_INTELPERC_PROFILE_IDX, 0 );
cout << "FPS " << capture.get( CAP_INTELPERC_DEPTH_GENERATOR+CAP_PROP_FPS ) << endl;
由于支持兩種類型的傳感器數(shù)據(jù)生成器(圖像生成器和深度生成器),因此需要使用兩個(gè)標(biāo)志來設(shè)置/獲取所需生成器的屬性:
有關(guān)更多信息,請(qǐng)參閱opencv / samples / cpp文件夾中使用intelperc_capture.cpp的示例。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: