1
A
回答
0
因此,啓動並運行ps3eye取決於您運行的是哪個操作系統。如果你運行的是Debian的任何風格,那麼驅動程序已經存在了,下面的代碼應該可以正常工作。
如果你在Windows上,你必須找到它的驅動程序。 CodeLibrary已經有一個驅動程序,但你必須支付3美元。 Link的here。
我不知道爲Mac,但有點挖掘發現this,這可能工作。
一旦你安裝了驅動程序,你應該可以像任何其他相機一樣訪問它。
的該代碼簡單位低於:
#include "stdafx.h"
#include <opencv/cxcore.h>
#include <opencv2\core\mat.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <opencv/cxcore.h>
#include <opencv/highgui.h>
#include <opencv/cv.h>
#include <opencv2/opencv.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/videoio/videoio.hpp>
using namespace cv;
using namespace std;
int main() {
Mat image;
bool escnotpressed = true;
VideoCapture cap(0); // open the default camera
if(!cap.isOpened()) // check if we succeeded
return -1;
cap.set(CV_CAP_PROP_FPS, 30); //sets framerate
String capturePath = "C:/this/is/a/path.avi";
Size frameSize = Size(cap.get(CV_CAP_PROP_FRAME_WIDTH), cap.get(CV_CAP_PROP_FRAME_HEIGHT));
VideoWriter savedCapture;
savedCapture.open(capturePath, VideoWriter::fourcc('M','J','P','G'), 30.0, frameSize, true);
if (!savedCapture.isOpened()) {
return -2;
}
while(escnotpressed) { //loops
cap >> image;
if (image.empty()) {
cout << "camera feed got interrupted" << endl;
return 5; //dies if camera feed is interrupted for some reason
}
imshow("Image", image);
savedCapture << image;
int c = waitKey(10);
if((char)c == 27) { escnotpressed = false;}
}
savedCapture.release();
cout << "Done!" << endl;
}
編輯:如果您在您的計算機上有多個攝像頭,則可能需要到VideoCapture帽(0)更改爲VideoCapture帽(X) ,其中x給你正確的相機。
相關問題
- 1. Opencv:我如何獲得眼睛顏色
- 2. Android opencv眼睛檢測
- 3. opencv的Haarlike眼睛檢測
- 4. 查找眼睛配眼鏡的OpenCV
- 5. 在Opencv眼睛檢測問題
- 6. Android的OpenCV的 - 眼睛閉合檢測
- 7. 使用Matlab檢測眼睛
- 8. 使用opencv和python進行facedetection只能檢測眼睛區域
- 9. 在python中使用openCV檢測打開或關閉的眼睛
- 10. 如何在opencv中循環檢測眼睛瞳孔
- 11. Android中的睜眼和閉眼通過Android的眼睛探測和跟蹤OpenCV
- 12. 使用FaceDetectionListener在眼睛上畫畫布
- 13. 如何反轉密碼眼睛圖標?
- 14. 如何使用dlib獲取眼睛和嘴巴的長度
- 15. 如何使用CIFeatures在眼睛和嘴巴上放置圖像
- 16. PGP命令 - 眼睛只
- 17. java.lang.IllegalStateException:眼睛無法打開
- 18. 找不到模塊眼睛
- 19. OpenGL中的眼睛糖果
- 20. 眼睛檢測軟件
- 21. MATLAB中的眼睛檢測
- 22. Opencv - 檢測眼睛是閉合還是打開
- 23. 跟蹤攝像頭,OpenCV和Python的眼睛瞳孔位置
- 24. C++程序使用opencv提取被檢測人臉的眼睛,鼻子特徵
- 25. 我可以在微控制器上使用眼睛檢測opencv代碼嗎?
- 26. 如何在opencv中繪製旋轉的邊界框圍繞眼睛C++
- 27. 用於跟蹤眼睛的閃存庫
- 28. gOgle如何使OO像眼睛一樣閃爍?
- 29. 如何使用Google Glass內置傳感器檢測用戶的眼睛閃爍?
- 30. 眼OpenCV的