video
Classes for displaying streamed video
Classes:
|
Display Video data as it is collected. |
|
Reclass of |
- class Video(videos, fps=None)[source]
Bases:
PySide2.QtWidgets.QWidget
Display Video data as it is collected.
Uses the
ImageItem_TimedUpdate
class to do timed frame updates.- Parameters
videos (list, tuple) – Names of video streams that will be displayed
fps (int) – if None, draw according to
prefs.get('DRAWFPS')
. Otherwise frequency of widget update
- Variables
videos (list, tuple) – Names of video streams that will be displayed
fps (int) – if None, draw according to
prefs.get('DRAWFPS')
. Otherwise frequency of widget updateifps (int) – 1/fps, duration of frame in s
qs (dict) – Dictionary of :class:`~queue.Queue`s in which frames will be dumped
quitting (
threading.Event
) – Signal to quit drawingupdate_thread (
threading.Thread
) – Thread with target=:meth:~.Video._update_framelayout (
PySide2.QtWidgets.QGridLayout
) – Widget layoutvid_widgets (dict) – dict containing widgets for each of the individual video streams.
Methods:
init_gui
()update_frame
(video, data)Put a frame for a video stream into its queue.
release
()Attributes:
- update_frame(video, data)[source]
Put a frame for a video stream into its queue.
If there is a waiting frame, pull it from the queue first – it’s old now.
- Parameters
video (str) – name of video stream
data (
numpy.ndarray
) – video frame
- staticMetaObject = <PySide2.QtCore.QMetaObject object at 0x7fa121bb9e40>
- class ImageItem_TimedUpdate(*args, **kwargs)[source]
Bases:
pyqtgraph.graphicsItems.ImageItem.ImageItem
Reclass of
pyqtgraph.ImageItem
to update with a fixed fps.Rather than calling
update()
every time a frame is updated, call it according to the timer.fps is set according to
prefs.get('DRAWFPS')
, if not available, draw at 10fps- Variables
timer (
QTimer
) – Timer held inglobals()
that synchronizes frame updates across image items
See
setOpts()
for further keyword arguments and andsetImage()
for information on supported formats.- image: array
Image data
Methods:
setImage
([image, autoLevels])Updates the image displayed by this ImageItem.
Call
update()
Attributes:
- setImage(image=None, autoLevels=None, **kargs)[source]
Updates the image displayed by this ImageItem. For more information on how the image is processed before displaying, see
makeARGB()
.For backward compatibility, image data is assumed to be in column-major order (column, row) by default. However, most data is stored in row-major order (row, column). It can either be transposed before assignment:
imageitem.setImage(imagedata.T)
or the interpretation of the data can be changed locally through the
axisOrder
keyword or by changing the imageAxisOrder global configuration option.All keywords supported by
setOpts()
are also allowed here.- image: array
Image data given as NumPy array with an integer or floating point dtype of any bit depth. A 2-dimensional array describes single-valued (monochromatic) data. A 3-dimensional array is used to give individual color components. The third dimension must be of length 3 (RGB) or 4 (RGBA).
- rect: QRectF, QRect or list_like of floats
[x, y, w, h]
, optional If given, sets translation and scaling to display the image within the specified rectangle. See
setRect()
.- autoLevels: bool, optional
If True, ImageItem will automatically select levels based on the maximum and minimum values encountered in the data. For performance reasons, this search subsamples the images and may miss individual bright or or dark points in the data set.
If False, the search will be omitted.
The default is False if a
levels
keyword argument is given, and True otherwise.- levelSamples: int, default 65536
When determining minimum and maximum values, ImageItem only inspects a subset of pixels no larger than this number. Setting this larger than the total number of pixels considers all values.
- staticMetaObject = <PySide2.QtCore.QMetaObject object at 0x7fa121ba1800>