Run OpenCV script on start with imshow

纵饮孤独 提交于 2020-01-05 02:47:14

问题


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.

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)

Thank you!


回答1:


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 - Autostart OpenCv-Script - Error with cv::imshow()

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



来源:https://stackoverflow.com/questions/42890467/run-opencv-script-on-start-with-imshow

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