Camera backends#
Basler#
Basler camera backend via the pylon GenTL producer.
Supports Basler USB3 Vision and GigE Vision cameras through
pylon,
Basler’s machine-vision SDK. The pylon installer registers
GenTL producer paths in GENICAM_GENTL64_PATH, which this
backend discovers automatically.
Classes#
- QBaslerCamera
Camera backed by a Basler device via the pylon GenTL producer.
- QBaslerSource
Threaded video source backed by
QBaslerCamera.- QBaslerTree
Parameter tree widget for
QBaslerCameracontrols.
- class QVideo.cameras.Basler.QBaslerCamera(*args, cameraID=0, **kwargs)[source]#
Bases:
QGenicamCameraCamera backed by a Basler device via the pylon GenTL producer.
pylon is Basler’s SDK for machine-vision cameras. It installs separate GenTL producers for USB3 Vision and GigE Vision cameras whose paths are discovered automatically from the
GENICAM_GENTL64_PATHenvironment variable set by the pylon installer.If pylon is not installed, instantiation raises
TypeError.- Parameters:
cameraID (int) – Index of the Basler camera to open. Default:
0.
- class QVideo.cameras.Basler.QBaslerSource(camera=None, cameraID=0)[source]#
Bases:
QGenicamSourceThreaded video source backed by
QBaslerCamera.- Parameters:
camera (QBaslerCamera or None) – Camera instance to wrap. If
None, a newQBaslerCamerais created fromcameraID.cameraID (int) – Index of the camera to open. Used only when camera is
None. Default:0.
- class QVideo.cameras.Basler.QBaslerTree(*args, camera=None, cameraID=0, controls=None, **kwargs)[source]#
Bases:
QGenicamTreeCamera property tree for
QBaslerCamera.Builds a
QCameraTreewith a curated set of controls and sensible default settings for Basler cameras.- Parameters:
camera (QBaslerCamera or None) – Camera instance to use. If
None, a newQBaslerCamerais created fromcameraID.cameraID (int) – Index of the Basler camera to open. Used only when camera is
None. Default:0.controls (list of str or None) – Names of GenICam nodes to show. Default:
_DEFAULT_CONTROLS.
IDS Imaging#
IDS Imaging camera backend via the IDS peak GenTL producer.
Supports IDS USB3 Vision and GigE Vision cameras through
IDS peak,
IDS Imaging’s machine-vision SDK. The IDS peak installer registers
GenTL producer paths in GENICAM_GENTL64_PATH.
Classes#
- QIDSCamera
Camera backed by an IDS Imaging device via the IDS peak GenTL producer.
- QIDSSource
Threaded video source backed by
QIDSCamera.- QIDSTree
Parameter tree widget for
QIDSCameracontrols.
- class QVideo.cameras.IDS.QIDSCamera(*args, cameraID=0, **kwargs)[source]#
Bases:
QGenicamCameraCamera backed by an IDS Imaging device via the IDS peak GenTL producer.
IDS peak is IDS Imaging’s SDK for USB3 Vision and GigE Vision cameras. It installs GenTL producers whose paths are discovered automatically from the
GENICAM_GENTL64_PATHenvironment variable set by the IDS peak installer.If IDS peak is not installed, instantiation raises
TypeError.- Parameters:
cameraID (int) – Index of the IDS camera to open. Default:
0.
- class QVideo.cameras.IDS.QIDSSource(camera=None, cameraID=0)[source]#
Bases:
QGenicamSourceThreaded video source backed by
QIDSCamera.- Parameters:
camera (QIDSCamera or None) – Camera instance to wrap. If
None, a newQIDSCamerais created fromcameraID.cameraID (int) – Index of the camera to open. Used only when camera is
None. Default:0.
- class QVideo.cameras.IDS.QIDSTree(*args, camera=None, cameraID=0, controls=None, **kwargs)[source]#
Bases:
QGenicamTreeCamera property tree for
QIDSCamera.Builds a
QCameraTreewith a curated set of controls and sensible default settings for IDS Imaging cameras.- Parameters:
camera (QIDSCamera or None) – Camera instance to use. If
None, a newQIDSCamerais created fromcameraID.cameraID (int) – Index of the IDS camera to open. Used only when camera is
None. Default:0.controls (list of str or None) – Names of GenICam nodes to show. Default:
_DEFAULT_CONTROLS.
MATRIX VISION mvGenTLProducer (universal)#
Universal GenICam backend via the MATRIX VISION mvGenTLProducer.
Supports any GenICam-compliant camera through the free
mvGenTLProducer
universal GenTL producer from MATRIX VISION. Installing the
mvIMPACT SDK registers the producer path in GENICAM_GENTL64_PATH.
Note
FLIR/Spinnaker cameras are not supported by this backend.
Use QVideo.cameras.Flir for FLIR cameras.
Classes#
- class QVideo.cameras.MV.QMVCamera(*args, cameraID=0, **kwargs)[source]#
Bases:
QGenicamCameraCamera backed by any GenICam-compliant device via the MATRIX VISION mvGenTLProducer universal GenTL producer.
mvGenTLProducer is a free universal GenTL producer from MATRIX VISION that supports a broad range of GenICam-compliant cameras from many manufacturers. Installing the mvIMPACT SDK registers the producer path in
GENICAM_GENTL64_PATHautomatically.Note
FLIR/Spinnaker cameras are not supported by this backend; use
QFlirCamerainstead.If mvIMPACT SDK is not installed, instantiation raises
TypeError.- Parameters:
cameraID (int) – Index of the camera to open. Default:
0.
- class QVideo.cameras.MV.QMVSource(camera=None, cameraID=0)[source]#
Bases:
QGenicamSourceThreaded video source backed by
QMVCamera.- Parameters:
camera (QMVCamera or None) – Camera instance to wrap. If
None, a newQMVCamerais created fromcameraID.cameraID (int) – Index of the camera to open. Used only when camera is
None. Default:0.
- class QVideo.cameras.MV.QMVTree(*args, camera=None, cameraID=0, controls=None, **kwargs)[source]#
Bases:
QGenicamTreeCamera property tree for
QMVCamera.Builds a
QCameraTreeusing standard GenICam SFNC node names, suitable for any camera supported by the MATRIX VISION mvGenTLProducer.- Parameters:
camera (QMVCamera or None) – Camera instance to use. If
None, a newQMVCamerais created fromcameraID.cameraID (int) – Index of the camera to open. Used only when camera is
None. Default:0.controls (list of str or None) – Names of GenICam nodes to show. Default:
_DEFAULT_CONTROLS.
Noise (reference)#
Synthetic noise camera for testing and development.
Provides a hardware-free camera backend that generates random-noise frames. Use this backend to develop and test QVideo applications without physical camera hardware. It is also the reference implementation for writing new camera backends.
Classes#
- QNoiseCamera
Camera that generates random noise frames.
- QNoiseSource
Threaded video source backed by
QNoiseCamera.- QNoiseTree
Parameter tree widget for
QNoiseCameracontrols.
- class QVideo.cameras.Noise.QNoiseCamera(*args, cameraID=0, blacklevel=48, whitelevel=128, **kwargs)[source]#
Bases:
QCameraCamera that generates random noise frames.
Useful for testing and development without physical camera hardware. All properties are registered on construction; the camera opens automatically.
- Parameters:
- class QVideo.cameras.Noise.QNoiseSource(*args, camera=None, **kwargs)[source]#
Bases:
QVideoSourceThreaded video source backed by
QNoiseCamera.- Parameters:
camera (QNoiseCamera or None) – Camera instance to wrap. If
None, a newQNoiseCamerais created from the remaining arguments.*args – Forwarded to
QNoiseCamerawhencameraisNone.**kwargs – Forwarded to
QNoiseCamerawhencameraisNone.
- class QVideo.cameras.Noise.QNoiseTree(*args, camera=None, cameraID=0, **kwargs)[source]#
Bases:
QCameraTreeCamera tree for a
QNoiseCamera.Convenience subclass of
QCameraTreethat creates and opens aQNoiseSourceautomatically.- Parameters:
camera (QNoiseCamera or None) – Camera instance to use. If
None, a newQNoiseCamerais created.cameraID (int) – Accepted for API consistency with other camera trees; ignored when camera is provided.
*args – Positional arguments forwarded to
QCameraTree.**kwargs – Keyword arguments forwarded to
QCameraTree.
OpenCV#
OpenCV camera backend for USB webcams and V4L2 devices.
Supports USB webcams and any device accessible via OpenCV’s
VideoCapture. On Linux the V4L2 backend is selected automatically;
all other platforms use CAP_ANY. No vendor SDK is required beyond
OpenCV itself.
Resolution and frame-rate selection modes (quality, performance, and
explicit) are described in QOpenCVCamera.
Classes#
- QOpenCVCamera
Camera backed by OpenCV’s
VideoCapture.- QOpenCVSource
Threaded video source backed by
QOpenCVCamera.- QOpenCVTree
Parameter tree widget for
QOpenCVCameracontrols.- QOpenCVDevices
Utility class for probing connected OpenCV-accessible devices.
- class QVideo.cameras.OpenCV.QOpenCVCamera(*args, cameraID=0, mirrored=False, flipped=False, gray=False, width=None, height=None, fps=30.0, **kwargs)[source]#
Bases:
QCameraCamera backed by OpenCV’s
VideoCapture.Supports USB webcams and any device accessible via OpenCV. On Linux the V4L2 backend is selected automatically; all other platforms use
CAP_ANY.Resolution and frame rate are configured once at device open time via
configure(). Three modes are supported:Quality (default): probes the device, selects the largest supported resolution, and sets fps (default 30 fps).
Performance (fps
= None): probes the device, selects the smallest supported resolution, and lets the driver maximize frame rate (slo-mo mode).Explicit (width and height both given): applies the requested dimensions and fps directly.
widthandheightare registered as writable properties. Changes are applied to the open device via OpenCV’s V4L2 backend, which handles the requiredVIDIOC_STREAMOFF/VIDIOC_S_FMT/VIDIOC_STREAMONcycle internally. The camera mutex serialises these writes against concurrent reads, so no source stop/restart is needed.QOpenCVTreeexposes them as read-only display fields; theresolutionenum in that tree changes width, height, and fps together. Transform properties (mirrored,flipped) are registered immediately on construction. Device properties (color, and any properties in_PROBED_PROPSthat the device supports) are registered inside_initialize()once the capture device is open.- Parameters:
cameraID (int) – Index of the camera device to open. Default:
0.mirrored (bool) – Flip the image horizontally. Default:
False.flipped (bool) – Flip the image vertically. Default:
False.gray (bool) – Initial grayscale state. Equivalent to opening with
color=False. Default:False(color output).width (int or None) – Desired frame width [pixels]. Must be paired with height for explicit mode.
Nonetriggers auto-selection. Default:None.height (int or None) – Desired frame height [pixels]. Must be paired with width for explicit mode.
Nonetriggers auto-selection. Default:None.fps (float or None) – Desired frame rate [fps].
Noneselects performance mode. Default:30..*args – Forwarded to
QCamera.**kwargs – Forwarded to
QCamera.
- WIDTH = 3#
- HEIGHT = 4#
- FPS = 5#
- BGR2RGB = 4#
- BGR2GRAY = 6#
- class QVideo.cameras.OpenCV.QOpenCVSource(*args, camera=None, **kwargs)[source]#
Bases:
QVideoSourceThreaded video source backed by
QOpenCVCamera.- Parameters:
camera (QOpenCVCamera or None) – Camera instance to wrap. If
None, a newQOpenCVCamerais created from the remaining arguments.*args – Forwarded to
QOpenCVCamerawhencameraisNone.**kwargs – Forwarded to
QOpenCVCamerawhencameraisNone.
- class QVideo.cameras.OpenCV.QOpenCVTree(*args, camera=None, cameraID=0, mirrored=False, flipped=False, gray=False, **kwargs)[source]#
Bases:
QCameraTreeCamera control tree for
QOpenCVCamera.Extends
QCameraTreewith aresolutiondropdown populated from the formats reported byQOpenCVDevices. Selecting an entry atomically updates width, height, and frame rate on the live device without stopping the video source.Width, height, and fps are displayed as read-only fields. All format changes go through the
resolutiondropdown.When no format information is available (e.g. when
QMediaDevicesis absent and probing fails), the dropdown is omitted and the tree falls back to the standard read-only width/height display.- Parameters:
camera (QOpenCVCamera or None) – Camera instance to use. If
None, a newQOpenCVCamerais created from the keyword arguments below.cameraID (int) – Index of the camera device to open. Used only when camera is
None. Default:0.mirrored (bool) – Flip the image horizontally. Used only when camera is
None. Default:False.flipped (bool) – Flip the image vertically. Used only when camera is
None. Default:False.gray (bool) – Open in grayscale mode. Used only when camera is
None. Default:False.*args – Positional arguments forwarded to
QCameraTree.**kwargs – Keyword arguments forwarded to
QCameraTree.
- class QVideo.cameras.OpenCV.QOpenCVDevices[source]#
Bases:
objectCamera discovery and format enumeration for OpenCV cameras.
Uses
QtMultimedia.QMediaDeviceswhen available to enumerate cameras and their supported formats without opening the device. Falls back to trial-and-error probing via OpenCV when QtMultimedia is not present.All methods are static — this class is a namespace, not instantiated.
- static cameras()[source]#
Return a list of available cameras as
(index, name)pairs.The index is the integer cameraID suitable for passing to
QOpenCVCamera.
- static formats(cameraID=0)[source]#
Return supported formats for camera cameraID.
Each entry is
(width, height, 1.0, max_fps)where max_fps is the highest frame rate the driver actually delivers at that resolution, determined by opening the device briefly and querying via OpenCV.QtMultimedia.QMediaDevicesis used to obtain the resolution list when available (it may know about non-standard resolutions thatCOMMON_RESOLUTIONSdoes not cover). Frame rates from QtMultimedia are not used because they reflect nominal/declared values that often differ from what the driver accepts.
OpenCV device utilities#
Camera and format enumeration for OpenCV-backed cameras.
- class QVideo.cameras.OpenCV._devices.QOpenCVDevices[source]#
Bases:
objectCamera discovery and format enumeration for OpenCV cameras.
Uses
QtMultimedia.QMediaDeviceswhen available to enumerate cameras and their supported formats without opening the device. Falls back to trial-and-error probing via OpenCV when QtMultimedia is not present.All methods are static — this class is a namespace, not instantiated.
- static cameras()[source]#
Return a list of available cameras as
(index, name)pairs.The index is the integer cameraID suitable for passing to
QOpenCVCamera.
- static formats(cameraID=0)[source]#
Return supported formats for camera cameraID.
Each entry is
(width, height, 1.0, max_fps)where max_fps is the highest frame rate the driver actually delivers at that resolution, determined by opening the device briefly and querying via OpenCV.QtMultimedia.QMediaDevicesis used to obtain the resolution list when available (it may know about non-standard resolutions thatCOMMON_RESOLUTIONSdoes not cover). Frame rates from QtMultimedia are not used because they reflect nominal/declared values that often differ from what the driver accepts.
- QVideo.cameras.OpenCV._devices.probe_resolutions(device)[source]#
Return resolutions accepted by an open OpenCV VideoCapture device.
Probes each entry in
COMMON_RESOLUTIONSby writing width and height to the device and reading back what it actually accepted. Restores the original resolution and frame rate when done.
- QVideo.cameras.OpenCV._devices.probe_formats(device, resolutions=None)[source]#
Return
(width, height, 1.0, max_fps)for each accepted resolution.For each candidate resolution, the device is asked to deliver 120 fps (above any real hardware limit) and the value the driver accepts is recorded as the maximum. Restores the original resolution and frame rate when done.
- Parameters:
device (cv2.VideoCapture) – An already-open capture device.
resolutions (list[tuple[int, int]] or None) – Resolution candidates to probe. Defaults to
COMMON_RESOLUTIONS.
- Return type:
- Returns:
list[tuple[int, int, float, float]] – Sorted list of
(width, height, 1.0, max_fps)tuples, one per distinct resolution the device accepts.
- QVideo.cameras.OpenCV._devices.configure(device, width=None, height=None, fps=30.0, resolutions=None)[source]#
Configure an open OpenCV VideoCapture device.
Three modes:
Explicit (both width and height given): apply those values directly, then set fps if provided.
Quality (default, fps is not
None): select the largest supported resolution, then set fps.Performance (fps is
None): select the smallest supported resolution, letting the driver maximize frame rate.
- Parameters:
device (cv2.VideoCapture) – An already-open capture device.
width (int or None) – Desired frame width [pixels]. Must be paired with height for explicit mode.
Nonetriggers auto-selection.height (int or None) – Desired frame height [pixels]. Must be paired with width for explicit mode.
Nonetriggers auto-selection.fps (float or None) – Desired frame rate [fps].
Noneselects performance mode (smallest resolution, driver-maximum frame rate). Default:30..resolutions (list[tuple[int, int]] or None) – Known supported resolutions as
(width, height)pairs. When provided, skips trial-and-error probing viaprobe_resolutions().None(default) triggers probing.
- Return type:
GenICam (base)#
Generic GenICam camera backend via Harvesters.
Provides an abstract base for any camera that implements the
GenICam
standard and is accessible via a GenTL producer .cti file.
Camera vendors supply manufacturer-specific producer files; concrete
subclasses set the producer class attribute
to the appropriate path.
Requires the genicam and harvesters packages:
pip install genicam harvesters
Classes#
- QGenicamCamera
Abstract base for GenICam cameras accessed via Harvesters.
- QGenicamSource
Threaded video source backed by
QGenicamCamera.- QGenicamTree
Parameter tree widget for
QGenicamCameracontrols.
- class QVideo.cameras.Genicam.QGenicamCamera(*args, cameraID=0, **kwargs)#
Bases:
QCameraAbstract base for GenICam-compliant cameras accessed via Harvesters.
GenICam is a standardized machine-vision interface maintained by the European Machine Vision Association. Communication with the physical device is handled by a GenTL producer — a
.ctibinary supplied by the camera manufacturer.Subclasses must set the
producerclass attribute to the path of the appropriate.ctifile before instantiating. Attempting to instantiateQGenicamCameradirectly raisesTypeError.Requires the
genicamandharvesterspackages (pip install genicam harvesters).- producer#
Path to the GenTL producer
.ctifile. Must be overridden by concrete subclasses.- Type:
str or None
- Parameters:
- has_node(name)[source]#
Return
Trueif the named node exists in the node map.Unlike
node(), this never logs a warning for missing names. Use it to guard calls tonode()oris_readwrite()in reactive code paths (e.g. UI update loops) where absent names are expected and not an error.- Parameters:
name (str) – GenICam node name to look up.
- Return type:
- Returns:
bool –
Trueif the node map is available and contains name.
- is_readwrite(feature)[source]#
Return
Trueif the named feature is currently writable.- Parameters:
feature (str) – GenICam node name.
- Return type:
- Returns:
bool –
Trueif the feature is writable, or protected (writable after stopping acquisition).
- node(name='Root')[source]#
Return the GenICam node with the given name.
- Parameters:
name (str) – Node name to look up. Default:
'Root'.- Returns:
IValue or None – The requested node, or
Noneif it does not exist.
- set(key, value)[source]#
Set a registered property to the given value.
- Parameters:
key (str) – Property name.
value (PropertyValue) – New value to assign.
- Return type:
- property settings: dict[str, bool | int | float | str]#
All registered property values, excluding standard-name aliases.
GenICam cameras register lowercase aliases (
width,height,fps) that map to canonical SFNC node names (Width,Height,AcquisitionFrameRate). Those aliases are excluded here so thatQGenicamTreedoes not try to sync them to tree parameters — the canonical names are already present and do the right thing. Attribute access (camera.fps) still works because__getattr__()reads_propertiesdirectly, notsettings.
- class QVideo.cameras.Genicam.QGenicamSource(camera)#
Bases:
QVideoSourceThreaded video source backed by
QGenicamCamera.- Parameters:
camera (QGenicamCamera) – Camera instance to wrap.
- class QVideo.cameras.Genicam.QGenicamTree(*args, camera, visibility=genicam.genapi.EVisibility.Guru, controls=None, **kwargs)#
Bases:
QCameraTreeCamera property tree for
QGenicamCamera.Builds a
QCameraTreefrom the camera’s GenICam node map and exposes visibility and per-feature enable/disable controls.A timer polls the camera periodically so that autonomous camera-side changes (e.g.
Gainbeing adjusted by auto-exposure,GainAutoreverting from"Once"to"Off") are reflected in the UI.PyNodeCallbackis not used because it only fires when the host writes a node, not when the camera changes a value autonomously.- Parameters:
camera (QGenicamCamera) – Camera instance to use.
visibility (EVisibility) – Maximum GenICam visibility level to display. Default:
EVisibility.Guru.controls (list of str or None) – If given, only nodes whose names appear in this list are shown; all others are hidden. Default:
None(show all).*args – Forwarded to
QCameraTree.**kwargs – Forwarded to
QCameraTree.
- property visibility: genicam.genapi.EVisibility#
FLIR#
FLIR camera backend via the Spinnaker GenTL producer.
Supports FLIR (formerly Point Grey) USB3 Vision and GigE Vision cameras
through Spinnaker,
FLIR’s machine-vision SDK. The Spinnaker installer registers the
GenTL producer path in GENICAM_GENTL64_PATH.
Warning
Spinnaker GenTL producer 4.3.0.189 contains a bug that causes the application to hang on exit when the camera is released. Downgrade to Spinnaker 4.1.0.172 or earlier if you encounter this issue.
Classes#
- QFlirCamera
Camera backed by a FLIR device via the Spinnaker GenTL producer.
- QFlirSource
Threaded video source backed by
QFlirCamera.- QFlirTree
Parameter tree widget for
QFlirCameracontrols.
- class QVideo.cameras.Flir.QFlirCamera(*args, cameraID=0, **kwargs)[source]#
Bases:
QGenicamCameraCamera backed by a FLIR device via the Spinnaker GenTL producer.
Spinnaker is FLIR’s SDK for machine-vision cameras. It installs a GenTL producer whose path is discovered automatically from the
GENICAM_GENTL64_PATHenvironment variable set by the Spinnaker installer.If Spinnaker is not installed, instantiation raises
TypeError.Warning
Spinnaker GenTL producer 4.3.0.189 contains a bug in which
DevClose()hangs indefinitely when the camera is released. This causes the application to hang on exit. FLIR customer support has confirmed the bug. If you experience this issue, downgrade to Spinnaker 4.1.0.172 or earlier.- Parameters:
cameraID (int) – Index of the FLIR camera to open. Default:
0.
- class QVideo.cameras.Flir.QFlirSource(camera=None, cameraID=0)[source]#
Bases:
QGenicamSourceThreaded video source backed by
QFlirCamera.- Parameters:
camera (QFlirCamera or None) – Camera instance to wrap. If
None, a newQFlirCamerais created fromcameraID.cameraID (int) – Index of the camera to open. Used only when camera is
None. Default:0.
- class QVideo.cameras.Flir.QFlirTree(*args, camera=None, cameraID=0, controls=None, **kwargs)[source]#
Bases:
QGenicamTreeCamera property tree for
QFlirCamera.Builds a
QCameraTreewith a curated set of controls and sensible default settings for FLIR cameras.- Parameters:
camera (QFlirCamera or None) – Camera instance to use. If
None, a newQFlirCamerais created fromcameraID.cameraID (int) – Index of the FLIR camera to open. Used only when camera is
None. Default:0.controls (list of str or None) – Names of GenICam nodes to show. Default:
_DEFAULT_CONTROLS.
Allied Vision VimbaX#
Allied Vision camera backend via the VimbaX GenTL producer.
Supports Allied Vision GigE Vision and USB3 Vision cameras through
VimbaX,
Allied Vision’s machine-vision SDK. The VimbaX installer registers
GenTL producer paths in GENICAM_GENTL64_PATH.
Classes#
- QVimbaXCamera
Camera backed by an Allied Vision device via the VimbaX GenTL producer.
- QVimbaXSource
Threaded video source backed by
QVimbaXCamera.- QVimbaXTree
Parameter tree widget for
QVimbaXCameracontrols.
- class QVideo.cameras.Vimbax.QVimbaXCamera(*args, cameraID=0, **kwargs)[source]#
Bases:
QGenicamCameraCamera backed by an Allied Vision device via the VimbaX GenTL producer.
VimbaX is Allied Vision’s SDK for GigE Vision and USB3 Vision cameras. It installs a GenTL producer whose path is discovered automatically from the
GENICAM_GENTL64_PATHenvironment variable set by the VimbaX installer.If VimbaX is not installed, instantiation raises
TypeError.- Parameters:
cameraID (int) – Index of the Allied Vision camera to open. Default:
0.
- class QVideo.cameras.Vimbax.QVimbaXSource(camera=None, cameraID=0)[source]#
Bases:
QGenicamSourceThreaded video source backed by
QVimbaXCamera.- Parameters:
camera (QVimbaXCamera or None) – Camera instance to wrap. If
None, a newQVimbaXCamerais created fromcameraID.cameraID (int) – Index of the camera to open. Used only when camera is
None. Default:0.
- class QVideo.cameras.Vimbax.QVimbaXTree(*args, camera=None, cameraID=0, **kwargs)[source]#
Bases:
QGenicamTreeCamera property tree for Allied Vision VimbaX cameras.
- Parameters:
camera (QVimbaXCamera or None) – Camera instance to use. If
None, a newQVimbaXCamerais created fromcameraID.cameraID (int) – Index of the camera device to open. Used only when camera is
None. Default:0.*args, **kwargs – Forwarded to
QGenicamTree.
Raspberry Pi Camera#
Raspberry Pi camera backend via picamera2.
Supports all CSI-connected camera modules on a Raspberry Pi SBC, including the HQ Camera, Camera Module 3, and compatible sensors. Frames are delivered as RGB arrays.
Requires the picamera2 package, which is pre-installed on
Raspberry Pi OS. Install manually with:
pip install picamera2
Classes#
- class QVideo.cameras.Picamera.QPicamera(*args, cameraID=0, width=1280, height=960, gray=False, **kwargs)[source]#
Bases:
QCameraCamera backed by the Raspberry Pi camera module via picamera2.
Supports all CSI-connected camera modules on a Raspberry Pi SBC, including the HQ Camera, Camera Module 3, and similar sensors. Frames are delivered as RGB arrays.
Requires the
picamera2package, which is pre-installed on Raspberry Pi OS. Install manually with:pip install picamera2
- Parameters:
cameraID (int) – Index of the camera to open when multiple modules are attached. Default:
0.width (int) – Initial frame width in pixels. Default:
1280.height (int) – Initial frame height in pixels. Default:
960.gray (bool) –
Trueconvert frames to grayscale. Default:False.*args – Forwarded to
QCamera.**kwargs – Forwarded to
QCamera.
- class QVideo.cameras.Picamera.QPicameraSource(*args, camera=None, **kwargs)[source]#
Bases:
QVideoSourceThreaded video source backed by
QPicamera.
- class QVideo.cameras.Picamera.QPicameraTree(*args, camera=None, cameraID=0, width=1280, height=960, **kwargs)[source]#
Bases:
QCameraTreeCamera control tree for
QPicamera.Convenience subclass of
QCameraTreethat automatically creates and opens aQPicameraif one is not provided.- Parameters:
camera (QPicamera or None) – Camera instance to use. If
None, a newQPicamerais created from the keyword arguments below.cameraID (int) – Camera index. Used only when camera is
None. Default:0.width (int) – Initial frame width. Used only when camera is
None. Default:1280.height (int) – Initial frame height. Used only when camera is
None. Default:960.*args – Forwarded to
QCameraTree.**kwargs – Forwarded to
QCameraTree.