从imshow开始运行OpenCV脚本 [英] Run OpenCV script on start with imshow

查看:174
本文介绍了从imshow开始运行OpenCV脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Raspberry Pi上运行一个OpenCV/python脚本,该脚本读取相机并在连接到Pi的RCA监视器上显示流.

I have an OpenCV/python script running at my Raspberry Pi which reads the camera and shows the stream on the RCA monitor connected to the Pi.

现在,我希望在引导时加载脚本.我已经尝试了cronjob @ reboot,/etc/rc.locale,/etc/profile和〜/.bash_profile.

Now I want the script to be loaded on boot. I already tried a cronjob @reboot, the /etc/rc.locale, /etc/profile and ~/.bash_profile.

我看到相机的红灯每次都打开,但不会显示图像.有运行脚本的解决方案吗? (我没有连接任何外部输入设备)

I see the red light of the camera turning on every time, but the image won't be shown. Is there any solution to run the script? (I have no external input devices connected)

谢谢!

推荐答案

我知道它的线程很旧,但是我认为您可能仍然对适用于我的解决方案感兴趣.希望这对您也有帮助:

I know its quite an old thread, but I thought you might be still interested in a solution that worked for me. Hopefully, that can help you as well:

Raspberry Pi-自动启动OpenCv脚本-错误与cv :: imshow()

简而言之:您最有可能在DISPLAY/XAUTHORITY环境变量上遇到问题.

In short: You most likely have problems with the DISPLAY / XAUTHORITY environment variable.

这篇关于从imshow开始运行OpenCV脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆