我在我的BBB上测试一个opencv视频捕获代码(运行Debian Wheezy:Linux beaglebone 3.8.13-bone79#1 SMP Tue Oct 13 20:44:55 UTC 2015 armv7l GNU / Linux)但是得到一个选择超时错误每次我运行程序。现在我落后于我最后一年的虹膜识别系统项目。 (如果你想知道我为什么要浏览这个视频捕获代码,它是用于跟踪眼睛然后捕获将被处理以获得IrisCode的图像。)
我按照http://www.pyimagesearch.com/2015/06/22/install-opencv-3-0-and-python-2-7-on-ubuntu/#comment-393561上的说明安装了opencv 3.0.0,但是在获得编译错误之后不得不关闭ffmpeg(在其中一个论坛上建议:OpenCV 3.0.0 make error with FFMPEG)但是我首先编译了ffmpeg源。
以下是我测试的Video_Capturing代码;
import numpy as np
import cv2
cap = cv2.VideoCapture(0)
while(True):
# Capture frame-by-frame
ret, frame = cap.read()
# Our operations on the frame come here
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
# Display the resulting frame
cv2.imshow('frame',gray)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()
运行代码后,我获取以下信息(注意:框架只在我通过tightvnc访问的LXTerminal中运行python脚本时打开。它无法通过ssh运行);
root@beaglebone:~/Project/Testing# python Video_Streaming.py
(process:1488): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
Xlib: extension "RANDR" missing on display ":1".
select timeout
select timeout
select timeout
select timeout
^Cselect timeout
Traceback (most recent call last):
File "Video_Streaming.py", line 8, in <module>
ret, frame = cap.read()
KeyboardInterrupt
root@beaglebone:~/Project/Testing#
我被困住了,我需要你的帮助。