OpenCV-Python always crashed when I used highgui related functions. With Spyder, we can see only kernel crash, so I had no idea what happened. When I ran a problem from terminal, I got an error message that This application failed to start because it could not find or load the Qt platform plugin “xcb”. Googling so many things, I finally found out the solution. The problem was caused by Qt. OpenCV compilation used Qt5 while Anaconda installed Qt4. So, the solution is
conda remove qt conda remove pyqt conda install -c https://conda.anaconda.org/mmcauliffe pyqt5 conda install pyside conda remove qt
The reason why I remove qt twice is installing pyside that is required for Spyder installes Qt4 again. Spyder actually requires PyQt4.X or PySide. I noticed that PySide can work even with Qt5.