OpenCV: libdc1394 error: Failed to initialize libdc1394

余生长醉 提交于 2019-11-29 01:17:06

问题


I installed OpenCV correctly on Ubuntu 14.04. However, when I run: import cv2 I get this error message:

>>> import cv2
libdc1394 error: Failed to initialize libdc1394

I read the answers to this question (and the different links posted there such as this interesting but finally useless one for my case) but no solution worked for me. I have no such file /dev/raw1394. So I installed the library:

sudo apt-get install libdc1394-22-dev libdc1394-22 libdc1394-utils

But still get the same error.

Note that this answer is the only one that works for me, however I can not pick it because I need to use camera in my application.

How can I resolve this ?


回答1:


Maybe disabling the driver isn't the best solution, but so far this hasn't given me any problems and was the easiest way I found to solve the issue:

sudo ln /dev/null /dev/raw1394

Attention: It is not a permanent solution.




回答2:


I vaguely remember a similar problem I once had. It has something to do with user-level permission to firewire devices. You need to add a new udev rule. Create a file /etc/udev/rules.d/raw1394.rules and add the following line:

KERNEL=="raw1394", GROUP="video"

Details can be found here and here.



来源:https://stackoverflow.com/questions/29274638/opencv-libdc1394-error-failed-to-initialize-libdc1394

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!