problem in ubuntu
- 需要opencv2 + qt5 + pyqt+python科学环境
- 先安装了qt5 和 anaconda2(python 科学环境,似乎自带pyqt)
- 但在编译安装opencv2的时候,不小心使用了系统默认的python2.7
This application failed to start because it could not find or load the Qt platform plugin "xcb"
- 通过安装miniconda是可以避免这个问题的
- 然而重装anaconda2,问题无法得到解决
- finally
export QT_QPA_PLATFORM_PLUGIN_PATH=${QT5_ROOT}/plugins
another problem
Gtk-CRITICAL **: IA__gtk_widget_style_get: assertion 'GTK_IS_WIDGET (widget)' failed
- in fact, I cannot avoid it, but after change the qt style, the output of above message will be less.
- If you are lazy enough, you can avoid use cv2.imshow() in python, instead we can use matplotlib or scikit-image.
sudo qtconfig
sudo qtconfig-qt4
- For I use Qt5, so change the style of qt4 is meaningless. I add this in
~/.bashrc
, for more information view qt5 set default style
QT_STYLE_OVERRIDE=adwaita
- finally, cv.imshow() works right, that’s fun.
In [4]: img=cv2.imread(
In [5]: cv2.imshow(
init done
opengl support available
In [6]: key=cv2.waitkey(0)
reference