I have runtime generated ndarray of unit8 which i want to display as using pyqt5.
Perfomance is crucial and the biggest problem is conversion from ndarray to QPixmap.
While using main thread, it works but its laggy, and when using Pool from multiprocessing i'm revicing lot of errors.
Function that is passed to pool.map is, where noise is ndarray:
def __array_to_pixmap(noise):
img = Image.fromarray(noise, mode='L')
qtImage = ImageQt.ImageQt(img)
return QtGui.QPixmap.fromImage(qtImage)
Errors that i am reciving are:
- ImportError: DLL load failed while importing cv2: The paging file is
too small for this operation to complete.
or
- [...] File "..venvlibsite-packagescv2_init_.py", line 5, in
from .cv2 import *
ImportError: numpy.core.multiarray failed to import
Is there better (faster) way to make conversion from ndarray to pixmap, or what can i do to make it work with multiprocessing?
question from:
https://stackoverflow.com/questions/65944132/convert-ndarray-to-pixmap-using-pool 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…