video
Classes for displaying streamed video
Classes:
|
Display Video data as it is collected. |
|
Reclass of |
- class Video(videos, fps=None)[source]
Bases:
QWidgetDisplay Video data as it is collected.
Uses the
ImageItem_TimedUpdateclass 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 (
PySide6.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 = PySide6.QtCore.QMetaObject("Video" inherits "QWidget": )
- class ImageItem_TimedUpdate(*args, **kwargs)[source]
Bases:
ImageItemReclass of
pyqtgraph.ImageItemto 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.Parameters
- image: np.ndarray, optional
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
axisOrderkeyword or by changing the imageAxisOrder global configuration optionAll keywords supported by
setOpts()are also allowed here.Parameters
- image: np.ndarray, optional
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 or QRect or array_like, optional
If given, sets translation and scaling to display the image within the specified rectangle. If
array_likeshould be the form of floats[x, y, w, h]SeesetRect()- 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
levelskeyword 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 = PySide6.QtCore.QMetaObject("ImageItem_TimedUpdate" inherits "ImageItem": )