即時嘗試訪問深度圖的像素值,使用kinect,openni和opencv。 IM使用此代碼訪問像素值深度圖
Mat depth;
VideoCapture capture1(CV_CAP_OPENNI);
capture1.grab();
capture1.retrieve(depth,CV_CAP_OPENNI_DEPTH_MAP);
imshow("depth",depth);
waitKey(0);
cout << depth.at<unsigned>(20,20);
system("PAUSE");
程序告訴我深度圖,但是當我試圖acccess的值,產生錯誤。但如果放:
cout << depth;
然後顯示我的所有值。
哪個版本的OpenCV是這樣嗎? – Jacob