I am currently switching from PyQt to PySide.
With PyQt I converted QImage to a Numpy.Array using this code that I found on SO:
<
The trick is to use QImage.constBits() as suggested by @Henry Gomersall. The code I use now is:
def QImageToCvMat(self,incomingImage):
''' Converts a QImage into an opencv MAT format '''
incomingImage = incomingImage.convertToFormat(QtGui.QImage.Format.Format_RGB32)
width = incomingImage.width()
height = incomingImage.height()
ptr = incomingImage.constBits()
arr = np.array(ptr).reshape(height, width, 4) # Copies the data
return arr