[PySide] QImage: out of memory, returning null image

William Dias william.dias at gmail.com
Tue Jun 4 20:51:48 CEST 2013


Hi,

I've written a program that continuously pools a webcam to grab image
frames through opencv library. Sporadically, when converting the frame to a
QImage object, I get the message: QImage: out of memory, returning null
image.

def takePicture(self):

frame = self.camcapture.read()
image = QImage(frame[1].data, 1920, 1080,
QImage.Format_RGB888).rgbSwapped()#.mirrored(True, False)
self.pixmap = QPixmap.fromImage(image)


As you can see, the image is 1920x1080 pixels big and it uses around 6MB of
memory space (3 bytes per pixel * 1920 * 1080), I suppose.

How to solve this problem? Is it possible python is leaking memory? Any
suggestion is welcome.

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20130604/614f1d4f/attachment.html>


More information about the PySide mailing list