You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get an frame from the cam and convert it to an QImage. This produce a memory leak. First i mean it is a problem with the QLabel (#144 closed issue) but its a problem with the QImage.
from PyV4L2Camera.camera import Camera
import time
import numpy
from PIL import Image
from PySide import QtGui
camera = Camera('/dev/video2')
while True:
frame = camera.get_frame()
# Decode the image
dim = Image.frombytes('RGB', (camera.width, camera.height), frame, 'raw', 'RGB')
# Convert the image to a numpy array and back to the pillow image
arr = numpy.asarray(dim)
im = Image.fromarray(numpy.uint8(arr))
data = im.convert("RGBA").tostring("raw", "BGRA")
size = im.size
image = QtGui.QImage(data, size[0], size[1], QtGui.QImage.Format_ARGB32)
time.sleep( 0.1 )
for simpler test you can use a picture as source...
The text was updated successfully, but these errors were encountered:
I get an frame from the cam and convert it to an QImage. This produce a memory leak. First i mean it is a problem with the QLabel (#144 closed issue) but its a problem with the QImage.
i found this:
https://bugreports.qt.io/browse/PYSIDE-140
is this the same?
Info:
Python3.4.3 virtualenv
host: ubuntu 14.04 64bit
for simpler test you can use a picture as source...
The text was updated successfully, but these errors were encountered: