QImage to Numpy Array using PySide
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 : def convertQImageToMat(incomingImage): ''' Converts a QImage into an opencv MAT format ''' incomingImage = incomingImage.convertToFormat(4) width = incomingImage.width() height = incomingImage.height() ptr = incomingImage.bits() ptr.setsize(incomingImage.byteCount()) arr = np.array(ptr).reshape(height, width, 4) # Copies the data return arr However ptr.setsize(incomingImage.byteCount()) does not work with PySide as this is part of the void* support of PyQt. My