2
我試圖讓gphoto2電影的輸出捕捉到我的OpenCV的程序在管OpenCV的:正從gphoto2
gphoto2 --capture-movie --stdin | ./myexe
我第一次嘗試做這樣的管道圖像序列:
while(1)
{
std::stringstream ss;
ss << "/dev/stdin";
cv::Mat m = cv::imread(ss.str());
namedWindow("LiveView", WINDOW_AUTOSIZE);
imshow("LiveView", m);
waitKey(1);
}
但可悲的是,在編譯工程,執行不,我正在一個
OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /build/buildd/opencv-2.4.2+dfsg/modules/core/src/array.cpp, line 2482 terminate called after throwing an instance of 'cv::Exception'
what(): /build/buildd/opencv-2.4.2+dfsg/modules/core/src/array.cpp:2482: error: (-206) Unrecognized or unsupported array type in function cvGetMat
I S AW類似的東西問here,但它不爲我工作 - 編譯在
readbytes=read(fileno(stdin),ca,BUFSIZE);
error: no matching function for call to ‘read(int, char [10240], int)’
我很是新手,C++/OpenCV的失敗,所以我可能錯過了一些包括什麼的。 由於我是新用戶,因此我無法發表評論,希望在那裏尋求幫助/澄清,所以我決定改爲提出一個新問題。