A
A
Alexander Karpov2020-04-09 22:26:01
linux
Alexander Karpov, 2020-04-09 22:26:01

Why does the kernel crash when working with opencv?

When executing the command:
cv2.imshow("camera", img)
Jupiter thinks for a long time and throws out an error:
The kernel appears to have died. It will restart automatically.

I work under Linux Mint, Python version 3.7.4

Actually, the whole program:

import cv2

cap = cv2.VideoCapture(0)

while True:
    ret, img = cap.read()
    cv2.imshow("camera", img)
    if cv2.waitKey(10) == 27: # Клавиша Esc
        break
cap.release()
cv2.destroyAllWindows()


ps
If you run in the console, then the error is:
[email protected]:~/ftp/python/face_detector$ python3 z2.py
QObject::moveToThread: Current thread (0x2509890) is not the object's thread (0x25f4450).
Cannot move to target thread (0x2509890) Segmentation

error
[email protected]:~/ftp/python/face_detector$


pps
Found this text: "Author of openCv says this problem comes from different versions of Qt in openCv and linux distribution. That is: openCv comes with Qt4, but Qt5 is already installed."

ppps

I solved the problem by creating a library from sorts

with the virtualenv setting

Hemorrhoid is still the same, one make worked for more than an hour and generated 11Gb of some tops.
Plus, something went wrong and I had to deal with the paths.

In general, it worked.

Thank you for your attention!

Alexander.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question