Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: opencv failed when imshow after receving from socket #4

Closed
wangyihuan123 opened this issue Mar 15, 2020 · 1 comment
Closed

Bug: opencv failed when imshow after receving from socket #4

wangyihuan123 opened this issue Mar 15, 2020 · 1 comment

Comments

@wangyihuan123
Copy link
Owner

Server:
sudo python server.py
Waiting connections...
[+] New server socket thread started for 127.0.0.1:57814
((921600,), 0)
('frame', (480, 640, 3))
QObject::moveToThread: Current thread (0x7feffc001370) is not the object's thread (0x7feffc053c70).
Cannot move to target thread (0x7feffc001370)

Segmentation fault (core dumped)

Client:
python client.py
('Frame: ', 1)
[Error] [Errno 32] Broken pipe
[Error] [Errno 32] Broken pipe
[Error] [Errno 32] Broken pipe
[Error] [Errno 32] Broken pipe

@wangyihuan123
Copy link
Owner Author

This is because of Qt.

The openCv author says that this problem comes from different Qt versions in openCv and the linux distro. That is: openCv comes with Qt4, but Qt5 is already installed.

Solution:
I created a new conda environment and installed opencv and pyqt.
Then remove libqt5x11extras5 libqt5x11extras5-dev via apt-get.
Now it works!

Why:
I probably installed libqt5x11extras5 libqt5x11extras5-dev these libs when I install ROS denpendencies.

Check these for detail:
opencv/opencv-python#46 and https://stackoverflow.com/questions/46449850/how-to-fix-the-error-qobjectmovetothread-in-opencv-in-python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant