Raspberry Pi - Autostart OpenCv-Script - Error with cv::imshow()

好久不见. 提交于 2019-12-02 11:51:54

Luckily, I solved the problem:

The problem was in the configuration of my serviced-script. I did know that I need a DISPLAY variable to the location of the X Display, but I was not aware of the fact that it needs authorization as well. This thread helped me figure it out:

https://unix.stackexchange.com/questions/85244/setting-display-in-systemd-service-file

In short:

Add these to lines to test.service in /etc/serviced/service:

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