0

I need to make a thumbnails grid from videoframes (using cv2), save it as JPEG and watch it. But my script works in a strange way (I remove other parts, it stopped working even with this short) if my example script is:

#!/usr/bin/env python3
import os
os.system('lximage-qt thumbs.jpg')

it works fine, pop up viewer with image! But further, I need cv2, and when I only add cv2 in import:

#!/usr/bin/env python3
import os, cv2
os.system('lximage-qt thumbs.jpg')

I see this output:

QObject::moveToThread: Current thread (0x55c97b9fd3d0) is not the object's thread (0x55c97bb79740).
Cannot move to target thread (0x55c97b9fd3d0)

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/admin/.local/lib/python3.10/site-packages/cv2/qt/plugins" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx.

I don't understand, how import cv2 affects on os.system, just before I use any cv2 objects. Import other modules, as PIL, datetime, etc don't affect on this script.

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
DeepDarky
  • 1
  • 1

0 Answers0