QVideo 4.7.0__tar.gz → 4.8.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {qvideo-4.7.0 → qvideo-4.8.0}/PKG-INFO +15 -4
- {qvideo-4.7.0 → qvideo-4.8.0}/QVideo.egg-info/PKG-INFO +15 -4
- {qvideo-4.7.0 → qvideo-4.8.0}/QVideo.egg-info/SOURCES.txt +6 -2
- {qvideo-4.7.0 → qvideo-4.8.0}/QVideo.egg-info/requires.txt +8 -1
- {qvideo-4.7.0 → qvideo-4.8.0}/README.md +8 -2
- {qvideo-4.7.0 → qvideo-4.8.0}/__init__.py +1 -1
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Flir/_camera.py +2 -1
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Genicam/_camera.py +81 -52
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Picamera/__init__.py +2 -1
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Picamera/_camera.py +38 -55
- {qvideo-4.7.0 → qvideo-4.8.0}/demos/ROIdemo.py +29 -19
- {qvideo-4.7.0 → qvideo-4.8.0}/demos/__init__.py +1 -1
- qvideo-4.8.0/dvr/QDVRWidget.py +702 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/dvr/QHDF5Reader.py +16 -2
- {qvideo-4.7.0 → qvideo-4.8.0}/dvr/QHDF5Writer.py +44 -2
- {qvideo-4.7.0 → qvideo-4.8.0}/dvr/QOpenCVWriter.py +20 -12
- qvideo-4.8.0/dvr/QPyAVReader.py +131 -0
- qvideo-4.8.0/dvr/QPyAVWriter.py +149 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/dvr/__init__.py +12 -1
- qvideo-4.8.0/dvr/icons/record.svg +337 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/artistic.py +3 -1
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/darkframe.py +1 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/dejitter.py +1 -1
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/dog.py +4 -4
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/edge.py +2 -3
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/exposure.py +7 -6
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/flatfield.py +1 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/foreground.py +1 -1
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/gamma.py +2 -3
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/invert.py +2 -3
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/laplacian.py +7 -6
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/median.py +3 -2
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/momean.py +2 -1
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/momedian.py +2 -1
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/rgb.py +4 -4
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/roi.py +2 -3
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/smoothing.py +3 -4
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/sobel.py +6 -5
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/threshold.py +14 -9
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/unsharp.py +2 -3
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/QFilterPipeline.py +4 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/QFilterRackWidget.py +35 -63
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/QFrameRelay.py +1 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/QSnapshot.py +3 -3
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/QVideoFilter.py +38 -2
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/QVideoScreen.py +8 -6
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/QVideoSource.py +25 -1
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/QVideoWriter.py +8 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/_camera.py +24 -10
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/_jupyter.py +2 -1
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/_launch.py +2 -1
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/chooser.py +2 -1
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/clickable.py +1 -1
- {qvideo-4.7.0 → qvideo-4.8.0}/overlays/trackpy.py +12 -3
- {qvideo-4.7.0 → qvideo-4.8.0}/overlays/yolo.py +15 -5
- {qvideo-4.7.0 → qvideo-4.8.0}/pyproject.toml +8 -5
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_camera.py +26 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_darkframe.py +7 -5
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_filter_export.py +41 -1
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_flatfield.py +7 -5
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qcamera.py +6 -5
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qdvrwidget.py +464 -117
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qfilterrackwidget.py +17 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qgenicamcamera.py +89 -4
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qhdf5reader.py +12 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qhdf5writer.py +86 -2
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qimxcamera.py +6 -5
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qnoisecamera.py +4 -3
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qopencvcamera.py +4 -3
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qopencvwriter.py +81 -9
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qpicamera.py +39 -3
- qvideo-4.8.0/tests/test_qpyavreader.py +150 -0
- qvideo-4.8.0/tests/test_qpyavwriter.py +167 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qvideoreader.py +4 -3
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qvideoscreen.py +15 -2
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qvideosource.py +53 -9
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qvideowriter.py +7 -6
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_roidemo.py +39 -13
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_samplehold.py +2 -1
- qvideo-4.8.0/tests/test_teardown.py +69 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_trackpy_overlay.py +29 -11
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_yolo_overlay.py +32 -14
- qvideo-4.7.0/dvr/QDVRWidget.py +0 -569
- qvideo-4.7.0/dvr/icons_rc.py +0 -1087
- qvideo-4.7.0/tests/test_icons_rc.py +0 -24
- {qvideo-4.7.0 → qvideo-4.8.0}/LICENSE.md +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/QCamcorder.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/QVideo.egg-info/dependency_links.txt +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/QVideo.egg-info/top_level.txt +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/__main__.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Basler/__init__.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Basler/_camera.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Basler/_tree.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Flir/QListFlirCameras.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Flir/__init__.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Flir/_tree.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Genicam/__init__.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Genicam/_tree.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/IDS/__init__.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/IDS/_camera.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/IDS/_tree.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/MV/__init__.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/MV/_camera.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/MV/_tree.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Noise/__init__.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Noise/_camera.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Noise/_tree.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/OpenCV/QListCVCameras.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/OpenCV/__init__.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/OpenCV/_camera.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/OpenCV/_devices.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/OpenCV/_tree.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Picamera/_imx500.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Picamera/_tree.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Vimbax/__init__.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Vimbax/_camera.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/Vimbax/_tree.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/cameras/__init__.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/demos/circulardemo.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/demos/combineddemo.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/demos/compositedemo.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/demos/demo.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/demos/filterdemo.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/demos/filterrackdemo.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/demos/histogramdemo.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/demos/trackpydemo.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/demos/uniformitydemo.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/demos/yolodemo.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/dvr/QCircularBuffer.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/dvr/QCircularDVRWidget.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/dvr/QOpenCVReader.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/_MedianBase.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/__init__.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/blob.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/circletransform.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/normalize.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/filters/samplehold.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/QCamera.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/QCameraTree.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/QFilterRack.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/QHistogramWidget.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/QListCameras.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/QUniformityWidget.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/QVideoReader.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/__init__.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/_qabc.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/errors.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/gentl.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/imageops.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/lib/videotypes.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/overlays/__init__.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/setup.cfg +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_artistic.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_blob.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_chooser.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_circletransform.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_circularbuffer.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_circulardemo.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_circulardvrwidget.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_clickable.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_combineddemo.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_compositedemo.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_dejitter.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_demo.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_demo_recipes.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_docs_quickstart.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_dog.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_edge.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_exposure.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_filterdemo.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_filterrackdemo.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_filters_gray.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_foreground.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_gamma.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_gentl.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_histogramdemo.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_histogramwidget.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_imageops.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_invert.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_jupyter.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_laplacian.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_launch.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_mainwindow.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_median.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_momean.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_momedian.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_normalize.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_overlays_package.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qabc.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qbaslercamera.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qcamcorder.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qcameratree.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qfilterpipeline.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qfilterrack.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qflircamera.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qframerelay.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qgenicamtree.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qidscamera.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qlistcameras.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qlistcvcameras.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qlistflircameras.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qmvcamera.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qnoisetree.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qopencvdevices.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qopencvreader.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qopencvtree.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qpicameratree.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qsnapshot.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qt_binding.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_qvimbaxcamera.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_resolutions.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_rgb.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_roi.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_smoothing.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_sobel.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_threshold.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_trackpydemo.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_uniformitydemo.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_uniformitywidget.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_unsharp.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_vendor_trees.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_videofilter.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_videotypes.py +0 -0
- {qvideo-4.7.0 → qvideo-4.8.0}/tests/test_yolodemo.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: QVideo
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.8.0
|
|
4
4
|
Summary: PyQt-based framework for integrating video cameras into research applications
|
|
5
5
|
Author-email: "David G. Grier" <david.grier@nyu.edu>
|
|
6
6
|
License: GPL-3.0-or-later
|
|
@@ -36,8 +36,13 @@ Provides-Extra: pyside6
|
|
|
36
36
|
Requires-Dist: PySide6>=6.7; extra == "pyside6"
|
|
37
37
|
Provides-Extra: jupyter
|
|
38
38
|
Requires-Dist: ipywidgets; extra == "jupyter"
|
|
39
|
+
Provides-Extra: opencv
|
|
40
|
+
Requires-Dist: cv2-enumerate-cameras; extra == "opencv"
|
|
39
41
|
Provides-Extra: dvr
|
|
40
42
|
Requires-Dist: h5py; extra == "dvr"
|
|
43
|
+
Requires-Dist: hdf5plugin; extra == "dvr"
|
|
44
|
+
Provides-Extra: av
|
|
45
|
+
Requires-Dist: av; extra == "av"
|
|
41
46
|
Provides-Extra: circletransform
|
|
42
47
|
Requires-Dist: scipy; extra == "circletransform"
|
|
43
48
|
Provides-Extra: trackpy
|
|
@@ -54,7 +59,7 @@ Requires-Dist: genicam; extra == "genicam"
|
|
|
54
59
|
Provides-Extra: picamera
|
|
55
60
|
Requires-Dist: picamera2; extra == "picamera"
|
|
56
61
|
Provides-Extra: test
|
|
57
|
-
Requires-Dist: QVideo[circletransform,dvr,jupyter,trackpy]; extra == "test"
|
|
62
|
+
Requires-Dist: QVideo[av,circletransform,dvr,jupyter,trackpy]; extra == "test"
|
|
58
63
|
Requires-Dist: pytest; extra == "test"
|
|
59
64
|
Requires-Dist: pytest-cov; extra == "test"
|
|
60
65
|
Provides-Extra: dev-pyqt5
|
|
@@ -135,8 +140,10 @@ pip install "QVideo[pyqt5]" # PyQt5
|
|
|
135
140
|
pip install QVideo # use a binding that is already installed
|
|
136
141
|
```
|
|
137
142
|
|
|
138
|
-
PySide6 is experimental (`pip install "QVideo[pyside6]"`):
|
|
139
|
-
|
|
143
|
+
PySide6 is experimental (`pip install "QVideo[pyside6]"`): the whole test
|
|
144
|
+
suite passes under it in continuous integration, but the interpreter
|
|
145
|
+
occasionally crashes while pyqtgraph builds a plot, so it is not yet
|
|
146
|
+
recommended.
|
|
140
147
|
|
|
141
148
|
### Raspberry Pi
|
|
142
149
|
|
|
@@ -159,6 +166,9 @@ Replace `python3-pyqt6` with `python3-pyqt5` if you prefer PyQt5.
|
|
|
159
166
|
|---------|-------|-------|
|
|
160
167
|
| GenICam cameras (Vimba, etc.) | `pip install QVideo[genicam]` | Requires a vendor-supplied `.cti` producer file |
|
|
161
168
|
| Raspberry Pi camera | `pip install QVideo[picamera]` | Requires `picamera2` |
|
|
169
|
+
| Camera names for USB cameras | `pip install QVideo[opencv]` | Uses `cv2-enumerate-cameras`; without it the cameras are listed as "Camera 0" and so on |
|
|
170
|
+
| HDF5 recording (compressed without loss) | `pip install QVideo[dvr]` | Requires `h5py` and `hdf5plugin` |
|
|
171
|
+
| Faster lossless AVI/MKV, 16-bit gray | `pip install QVideo[av]` | Uses PyAV instead of OpenCV when installed |
|
|
162
172
|
|
|
163
173
|
## Quick start
|
|
164
174
|
|
|
@@ -203,6 +213,7 @@ Verified on real hardware (the unit tests mock all hardware):
|
|
|
203
213
|
|---------|-------|--------|-----------------|---------|
|
|
204
214
|
| OpenCV | 14 – 26 | 24.04 | tested | not tested |
|
|
205
215
|
| FLIR (GenICam) | 14 – 26 | 24.04 | — | not tested |
|
|
216
|
+
| Raspberry Pi camera | — | — | tested (Pi 5) | — |
|
|
206
217
|
|
|
207
218
|
On macOS 26.7.1 (Tahoe), the OpenCV backend was tested with OpenCV
|
|
208
219
|
5.0.0_11 and the FLIR backend with Spinnaker SDK 4.4.0.246. Other combinations are expected to work but have not been
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: QVideo
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.8.0
|
|
4
4
|
Summary: PyQt-based framework for integrating video cameras into research applications
|
|
5
5
|
Author-email: "David G. Grier" <david.grier@nyu.edu>
|
|
6
6
|
License: GPL-3.0-or-later
|
|
@@ -36,8 +36,13 @@ Provides-Extra: pyside6
|
|
|
36
36
|
Requires-Dist: PySide6>=6.7; extra == "pyside6"
|
|
37
37
|
Provides-Extra: jupyter
|
|
38
38
|
Requires-Dist: ipywidgets; extra == "jupyter"
|
|
39
|
+
Provides-Extra: opencv
|
|
40
|
+
Requires-Dist: cv2-enumerate-cameras; extra == "opencv"
|
|
39
41
|
Provides-Extra: dvr
|
|
40
42
|
Requires-Dist: h5py; extra == "dvr"
|
|
43
|
+
Requires-Dist: hdf5plugin; extra == "dvr"
|
|
44
|
+
Provides-Extra: av
|
|
45
|
+
Requires-Dist: av; extra == "av"
|
|
41
46
|
Provides-Extra: circletransform
|
|
42
47
|
Requires-Dist: scipy; extra == "circletransform"
|
|
43
48
|
Provides-Extra: trackpy
|
|
@@ -54,7 +59,7 @@ Requires-Dist: genicam; extra == "genicam"
|
|
|
54
59
|
Provides-Extra: picamera
|
|
55
60
|
Requires-Dist: picamera2; extra == "picamera"
|
|
56
61
|
Provides-Extra: test
|
|
57
|
-
Requires-Dist: QVideo[circletransform,dvr,jupyter,trackpy]; extra == "test"
|
|
62
|
+
Requires-Dist: QVideo[av,circletransform,dvr,jupyter,trackpy]; extra == "test"
|
|
58
63
|
Requires-Dist: pytest; extra == "test"
|
|
59
64
|
Requires-Dist: pytest-cov; extra == "test"
|
|
60
65
|
Provides-Extra: dev-pyqt5
|
|
@@ -135,8 +140,10 @@ pip install "QVideo[pyqt5]" # PyQt5
|
|
|
135
140
|
pip install QVideo # use a binding that is already installed
|
|
136
141
|
```
|
|
137
142
|
|
|
138
|
-
PySide6 is experimental (`pip install "QVideo[pyside6]"`):
|
|
139
|
-
|
|
143
|
+
PySide6 is experimental (`pip install "QVideo[pyside6]"`): the whole test
|
|
144
|
+
suite passes under it in continuous integration, but the interpreter
|
|
145
|
+
occasionally crashes while pyqtgraph builds a plot, so it is not yet
|
|
146
|
+
recommended.
|
|
140
147
|
|
|
141
148
|
### Raspberry Pi
|
|
142
149
|
|
|
@@ -159,6 +166,9 @@ Replace `python3-pyqt6` with `python3-pyqt5` if you prefer PyQt5.
|
|
|
159
166
|
|---------|-------|-------|
|
|
160
167
|
| GenICam cameras (Vimba, etc.) | `pip install QVideo[genicam]` | Requires a vendor-supplied `.cti` producer file |
|
|
161
168
|
| Raspberry Pi camera | `pip install QVideo[picamera]` | Requires `picamera2` |
|
|
169
|
+
| Camera names for USB cameras | `pip install QVideo[opencv]` | Uses `cv2-enumerate-cameras`; without it the cameras are listed as "Camera 0" and so on |
|
|
170
|
+
| HDF5 recording (compressed without loss) | `pip install QVideo[dvr]` | Requires `h5py` and `hdf5plugin` |
|
|
171
|
+
| Faster lossless AVI/MKV, 16-bit gray | `pip install QVideo[av]` | Uses PyAV instead of OpenCV when installed |
|
|
162
172
|
|
|
163
173
|
## Quick start
|
|
164
174
|
|
|
@@ -203,6 +213,7 @@ Verified on real hardware (the unit tests mock all hardware):
|
|
|
203
213
|
|---------|-------|--------|-----------------|---------|
|
|
204
214
|
| OpenCV | 14 – 26 | 24.04 | tested | not tested |
|
|
205
215
|
| FLIR (GenICam) | 14 – 26 | 24.04 | — | not tested |
|
|
216
|
+
| Raspberry Pi camera | — | — | tested (Pi 5) | — |
|
|
206
217
|
|
|
207
218
|
On macOS 26.7.1 (Tahoe), the OpenCV backend was tested with OpenCV
|
|
208
219
|
5.0.0_11 and the FLIR backend with Spinnaker SDK 4.4.0.246. Other combinations are expected to work but have not been
|
|
@@ -63,8 +63,10 @@ dvr/QHDF5Reader.py
|
|
|
63
63
|
dvr/QHDF5Writer.py
|
|
64
64
|
dvr/QOpenCVReader.py
|
|
65
65
|
dvr/QOpenCVWriter.py
|
|
66
|
+
dvr/QPyAVReader.py
|
|
67
|
+
dvr/QPyAVWriter.py
|
|
66
68
|
dvr/__init__.py
|
|
67
|
-
dvr/
|
|
69
|
+
dvr/icons/record.svg
|
|
68
70
|
filters/_MedianBase.py
|
|
69
71
|
filters/__init__.py
|
|
70
72
|
filters/artistic.py
|
|
@@ -149,7 +151,6 @@ tests/test_gamma.py
|
|
|
149
151
|
tests/test_gentl.py
|
|
150
152
|
tests/test_histogramdemo.py
|
|
151
153
|
tests/test_histogramwidget.py
|
|
152
|
-
tests/test_icons_rc.py
|
|
153
154
|
tests/test_imageops.py
|
|
154
155
|
tests/test_invert.py
|
|
155
156
|
tests/test_jupyter.py
|
|
@@ -191,6 +192,8 @@ tests/test_qopencvtree.py
|
|
|
191
192
|
tests/test_qopencvwriter.py
|
|
192
193
|
tests/test_qpicamera.py
|
|
193
194
|
tests/test_qpicameratree.py
|
|
195
|
+
tests/test_qpyavreader.py
|
|
196
|
+
tests/test_qpyavwriter.py
|
|
194
197
|
tests/test_qsnapshot.py
|
|
195
198
|
tests/test_qt_binding.py
|
|
196
199
|
tests/test_qvideoreader.py
|
|
@@ -205,6 +208,7 @@ tests/test_roidemo.py
|
|
|
205
208
|
tests/test_samplehold.py
|
|
206
209
|
tests/test_smoothing.py
|
|
207
210
|
tests/test_sobel.py
|
|
211
|
+
tests/test_teardown.py
|
|
208
212
|
tests/test_threshold.py
|
|
209
213
|
tests/test_trackpy_overlay.py
|
|
210
214
|
tests/test_trackpydemo.py
|
|
@@ -4,6 +4,9 @@ qtpy
|
|
|
4
4
|
pyqtgraph
|
|
5
5
|
psutil
|
|
6
6
|
|
|
7
|
+
[av]
|
|
8
|
+
av
|
|
9
|
+
|
|
7
10
|
[circletransform]
|
|
8
11
|
scipy
|
|
9
12
|
|
|
@@ -33,6 +36,7 @@ PyQt5
|
|
|
33
36
|
|
|
34
37
|
[dvr]
|
|
35
38
|
h5py
|
|
39
|
+
hdf5plugin
|
|
36
40
|
|
|
37
41
|
[genicam]
|
|
38
42
|
harvesters
|
|
@@ -41,6 +45,9 @@ genicam
|
|
|
41
45
|
[jupyter]
|
|
42
46
|
ipywidgets
|
|
43
47
|
|
|
48
|
+
[opencv]
|
|
49
|
+
cv2-enumerate-cameras
|
|
50
|
+
|
|
44
51
|
[overlays]
|
|
45
52
|
QVideo[trackpy,yolo]
|
|
46
53
|
|
|
@@ -58,7 +65,7 @@ PyQt6
|
|
|
58
65
|
PySide6>=6.7
|
|
59
66
|
|
|
60
67
|
[test]
|
|
61
|
-
QVideo[circletransform,dvr,jupyter,trackpy]
|
|
68
|
+
QVideo[av,circletransform,dvr,jupyter,trackpy]
|
|
62
69
|
pytest
|
|
63
70
|
pytest-cov
|
|
64
71
|
|
|
@@ -55,8 +55,10 @@ pip install "QVideo[pyqt5]" # PyQt5
|
|
|
55
55
|
pip install QVideo # use a binding that is already installed
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
PySide6 is experimental (`pip install "QVideo[pyside6]"`):
|
|
59
|
-
|
|
58
|
+
PySide6 is experimental (`pip install "QVideo[pyside6]"`): the whole test
|
|
59
|
+
suite passes under it in continuous integration, but the interpreter
|
|
60
|
+
occasionally crashes while pyqtgraph builds a plot, so it is not yet
|
|
61
|
+
recommended.
|
|
60
62
|
|
|
61
63
|
### Raspberry Pi
|
|
62
64
|
|
|
@@ -79,6 +81,9 @@ Replace `python3-pyqt6` with `python3-pyqt5` if you prefer PyQt5.
|
|
|
79
81
|
|---------|-------|-------|
|
|
80
82
|
| GenICam cameras (Vimba, etc.) | `pip install QVideo[genicam]` | Requires a vendor-supplied `.cti` producer file |
|
|
81
83
|
| Raspberry Pi camera | `pip install QVideo[picamera]` | Requires `picamera2` |
|
|
84
|
+
| Camera names for USB cameras | `pip install QVideo[opencv]` | Uses `cv2-enumerate-cameras`; without it the cameras are listed as "Camera 0" and so on |
|
|
85
|
+
| HDF5 recording (compressed without loss) | `pip install QVideo[dvr]` | Requires `h5py` and `hdf5plugin` |
|
|
86
|
+
| Faster lossless AVI/MKV, 16-bit gray | `pip install QVideo[av]` | Uses PyAV instead of OpenCV when installed |
|
|
82
87
|
|
|
83
88
|
## Quick start
|
|
84
89
|
|
|
@@ -123,6 +128,7 @@ Verified on real hardware (the unit tests mock all hardware):
|
|
|
123
128
|
|---------|-------|--------|-----------------|---------|
|
|
124
129
|
| OpenCV | 14 – 26 | 24.04 | tested | not tested |
|
|
125
130
|
| FLIR (GenICam) | 14 – 26 | 24.04 | — | not tested |
|
|
131
|
+
| Raspberry Pi camera | — | — | tested (Pi 5) | — |
|
|
126
132
|
|
|
127
133
|
On macOS 26.7.1 (Tahoe), the OpenCV backend was tested with OpenCV
|
|
128
134
|
5.0.0_11 and the FLIR backend with Spinnaker SDK 4.4.0.246. Other combinations are expected to work but have not been
|
|
@@ -10,7 +10,7 @@ from QVideo.lib._camera import Camera
|
|
|
10
10
|
|
|
11
11
|
try:
|
|
12
12
|
__version__ = version('QVideo')
|
|
13
|
-
except PackageNotFoundError: #
|
|
13
|
+
except PackageNotFoundError: # not installed (e.g. bare source checkout)
|
|
14
14
|
__version__ = 'unknown'
|
|
15
15
|
|
|
16
16
|
__all__ = ['Camera', '__version__']
|
|
@@ -34,7 +34,8 @@ class QFlirCamera(QGenicamCamera):
|
|
|
34
34
|
_producer_filenames = ('Spinnaker_GenTL.cti',)
|
|
35
35
|
_producerHint = ('Install the Spinnaker SDK and set GENICAM_GENTL64_PATH '
|
|
36
36
|
'to the directory containing Spinnaker_GenTL.cti '
|
|
37
|
-
'(on Linux, typically
|
|
37
|
+
'(on Linux, typically '
|
|
38
|
+
'/opt/spinnaker/lib/spinnaker-gentl).')
|
|
38
39
|
|
|
39
40
|
|
|
40
41
|
class QFlirSource(QGenicamSource):
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
'''GenICam cameras and sources, driven through Harvesters.'''
|
|
1
2
|
from collections.abc import Callable
|
|
3
|
+
from contextlib import suppress
|
|
2
4
|
from typing import TYPE_CHECKING
|
|
3
5
|
from QVideo.lib import QCamera, QVideoSource
|
|
4
6
|
from QVideo.lib import gentl
|
|
@@ -70,7 +72,13 @@ class QGenicamCamera(QCamera):
|
|
|
70
72
|
producer: str | Path | None = None
|
|
71
73
|
_producer_filenames: tuple[str, ...] = ()
|
|
72
74
|
_producerHint: str = ''
|
|
73
|
-
|
|
75
|
+
#: SFNC nodes behind the lowercase names that every camera shares, in
|
|
76
|
+
#: order of preference.
|
|
77
|
+
_ALIAS_NODES = {'width': ('Width',),
|
|
78
|
+
'height': ('Height',),
|
|
79
|
+
'fps': ('AcquisitionFrameRate',
|
|
80
|
+
'AcquisitionFrameRateAbs')}
|
|
81
|
+
_ALIASES = frozenset(_ALIAS_NODES)
|
|
74
82
|
|
|
75
83
|
#: Nodes that report the frame rate that the camera delivers, in order
|
|
76
84
|
#: of preference: the standard name, then names of older firmware.
|
|
@@ -95,7 +103,18 @@ class QGenicamCamera(QCamera):
|
|
|
95
103
|
bool
|
|
96
104
|
``True`` if a valid camera device was opened successfully.
|
|
97
105
|
'''
|
|
98
|
-
|
|
106
|
+
self._openDevice(self._locateProducer())
|
|
107
|
+
self._connectNodeMap()
|
|
108
|
+
root = self.node()
|
|
109
|
+
self._protected = self._startAcquisition(root)
|
|
110
|
+
self._register_features(root)
|
|
111
|
+
with suppress(Exception):
|
|
112
|
+
self._modelName = str(self._nodeMap.DeviceModelName.value)
|
|
113
|
+
self._registerAliases()
|
|
114
|
+
return True
|
|
115
|
+
|
|
116
|
+
def _openDevice(self, producer: str) -> None:
|
|
117
|
+
'''Load the GenTL *producer* and open the camera that it finds.'''
|
|
99
118
|
self._harvester = Harvester()
|
|
100
119
|
self._device = None
|
|
101
120
|
try:
|
|
@@ -117,33 +136,40 @@ class QGenicamCamera(QCamera):
|
|
|
117
136
|
f'): {ex}\n'
|
|
118
137
|
'Check that the camera is connected and powered, and that '
|
|
119
138
|
'you have permission to access it.') from ex
|
|
139
|
+
|
|
140
|
+
def _connectNodeMap(self) -> None:
|
|
141
|
+
'''Take the node map from the device, loading it by hand if
|
|
142
|
+
harvesters did not connect it.'''
|
|
120
143
|
self._nodeMap = self._device.remote_device.node_map
|
|
121
|
-
if
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
144
|
+
if self._isConnected(self._nodeMap):
|
|
145
|
+
return
|
|
146
|
+
logger.debug('harvesters node map unconnected; '
|
|
147
|
+
'loading manually from device port')
|
|
148
|
+
self._nodeMap = self._load_node_map(self._device)
|
|
149
|
+
if self._nodeMap is None:
|
|
150
|
+
self._cleanup()
|
|
151
|
+
raise QDeviceError(
|
|
152
|
+
f'{type(self).__name__}: cannot read the GenICam '
|
|
153
|
+
'node map from the camera')
|
|
154
|
+
|
|
155
|
+
def _startAcquisition(self, root: IValue) -> set[str]:
|
|
156
|
+
'''Start acquisition and return the features that it makes read-only.
|
|
157
|
+
|
|
158
|
+
These are the features whose access mode differs before and after
|
|
159
|
+
the start, so that writing them requires stopping acquisition.
|
|
160
|
+
'''
|
|
161
|
+
before = self._scan_modes(root)
|
|
132
162
|
self._device.start()
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
('AcquisitionFrameRateAbs', 'fps')):
|
|
144
|
-
if src in self._properties and dst not in self._properties:
|
|
145
|
-
self._properties[dst] = self._properties[src]
|
|
146
|
-
return True
|
|
163
|
+
after = self._scan_modes(root)
|
|
164
|
+
return {name for name, mode in before.items()
|
|
165
|
+
if name in after and after[name] != mode}
|
|
166
|
+
|
|
167
|
+
def _registerAliases(self) -> None:
|
|
168
|
+
'''Register the lowercase names for the standard nodes that exist.'''
|
|
169
|
+
for alias, nodes in self._ALIAS_NODES.items():
|
|
170
|
+
for node in nodes:
|
|
171
|
+
if node in self._properties and alias not in self._properties:
|
|
172
|
+
self._properties[alias] = self._properties[node]
|
|
147
173
|
|
|
148
174
|
@classmethod
|
|
149
175
|
def _locateProducer(cls) -> str:
|
|
@@ -182,20 +208,14 @@ class QGenicamCamera(QCamera):
|
|
|
182
208
|
original exception.
|
|
183
209
|
'''
|
|
184
210
|
if self._device is not None:
|
|
185
|
-
|
|
211
|
+
with suppress(Exception):
|
|
186
212
|
self._device.stop()
|
|
187
|
-
|
|
188
|
-
pass
|
|
189
|
-
try:
|
|
213
|
+
with suppress(Exception):
|
|
190
214
|
self._device.destroy()
|
|
191
|
-
except Exception:
|
|
192
|
-
pass
|
|
193
215
|
self._device = None
|
|
194
216
|
if self._harvester is not None:
|
|
195
|
-
|
|
217
|
+
with suppress(Exception):
|
|
196
218
|
self._harvester.reset()
|
|
197
|
-
except Exception:
|
|
198
|
-
pass
|
|
199
219
|
self._nodeMap = None
|
|
200
220
|
|
|
201
221
|
def _deinitialize(self) -> None:
|
|
@@ -295,6 +315,20 @@ class QGenicamCamera(QCamera):
|
|
|
295
315
|
'''
|
|
296
316
|
return gentl.findProducer(*filenames)
|
|
297
317
|
|
|
318
|
+
@staticmethod
|
|
319
|
+
def _isConnected(nodeMap: 'NodeMap') -> bool:
|
|
320
|
+
'''Return whether harvesters connected *nodeMap* to the camera.
|
|
321
|
+
|
|
322
|
+
A node map that is not connected has no ``Root``. Older versions of
|
|
323
|
+
``genicam`` answer ``False`` for it, and version 1.6 raises
|
|
324
|
+
``AccessException`` ("reference not valid") instead; both mean that
|
|
325
|
+
the map must be loaded by hand.
|
|
326
|
+
'''
|
|
327
|
+
try:
|
|
328
|
+
return nodeMap.has_node('Root')
|
|
329
|
+
except Exception:
|
|
330
|
+
return False
|
|
331
|
+
|
|
298
332
|
@staticmethod
|
|
299
333
|
def _load_node_map(device: 'ImageAcquirer') -> 'NodeMap | None':
|
|
300
334
|
'''Reload the node map by re-running harvesters' own loading logic.
|
|
@@ -529,22 +563,17 @@ class QGenicamCamera(QCamera):
|
|
|
529
563
|
'''
|
|
530
564
|
node = self.node(name)
|
|
531
565
|
with self._mutex:
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
if
|
|
535
|
-
state.update(kind='
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
if access in (EAccessMode.RO, EAccessMode.RW):
|
|
544
|
-
if isinstance(node, IEnumeration):
|
|
545
|
-
state['value'] = node.to_string()
|
|
546
|
-
elif isinstance(node, IProperty):
|
|
547
|
-
state['value'] = node.value
|
|
566
|
+
state = {'access': node.node.get_access_mode(), 'kind': 'other'}
|
|
567
|
+
ptype, meta = self._feature_spec(node)
|
|
568
|
+
if 'limits' in meta:
|
|
569
|
+
state.update(kind='enum', entries=meta['limits'])
|
|
570
|
+
elif ptype in (int, float):
|
|
571
|
+
state.update(kind=ptype.__name__, min=meta['minimum'],
|
|
572
|
+
max=meta['maximum'], inc=meta.get('step'))
|
|
573
|
+
if isinstance(node, IProperty):
|
|
574
|
+
value = self._make_getter(node)()
|
|
575
|
+
if value is not None:
|
|
576
|
+
state['value'] = value
|
|
548
577
|
return state
|
|
549
578
|
|
|
550
579
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from contextlib import suppress
|
|
1
2
|
from typing import TYPE_CHECKING
|
|
2
3
|
from QVideo.lib import QCamera, QVideoSource
|
|
3
4
|
import logging
|
|
@@ -124,7 +125,7 @@ class QPicamera(QCamera):
|
|
|
124
125
|
return Picamera2(camera_num=self._cameraID)
|
|
125
126
|
|
|
126
127
|
def _onRequest(self, metadata: dict) -> None:
|
|
127
|
-
'''Hook called with
|
|
128
|
+
'''Hook called with a frame's metadata before its request ends.
|
|
128
129
|
|
|
129
130
|
Subclasses can override this to extract additional per-frame data
|
|
130
131
|
(e.g. IMX500 inference outputs) while the request buffer is still
|
|
@@ -165,23 +166,16 @@ class QPicamera(QCamera):
|
|
|
165
166
|
# _controlValues from fresh metadata, so we save them here and
|
|
166
167
|
# re-apply them afterwards.
|
|
167
168
|
prior_controls = dict(self._controlValues)
|
|
168
|
-
fmt = 'YUV420' if self._gray else 'BGR888'
|
|
169
|
-
cfg_kwargs = {
|
|
170
|
-
'main': {'size': (self._width, self._height), 'format': fmt}}
|
|
171
|
-
t = self._makeTransform()
|
|
172
|
-
if t is not None:
|
|
173
|
-
cfg_kwargs['transform'] = t
|
|
174
|
-
config = self._device.create_preview_configuration(**cfg_kwargs)
|
|
175
|
-
self._device.configure(config)
|
|
176
|
-
self._device.start()
|
|
177
|
-
self._deviceOpen = True
|
|
178
169
|
try:
|
|
170
|
+
self._configure((self._width, self._height))
|
|
171
|
+
self._device.start()
|
|
172
|
+
self._deviceOpen = True
|
|
179
173
|
self._device.capture_array()
|
|
180
174
|
except Exception as ex:
|
|
181
|
-
logger.warning(f'
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
175
|
+
logger.warning(f'Could not start Raspberry Pi camera '
|
|
176
|
+
f'{self._cameraID}: {ex}')
|
|
177
|
+
with suppress(Exception):
|
|
178
|
+
self._deinitialize()
|
|
185
179
|
return False
|
|
186
180
|
register = self.registerProperty
|
|
187
181
|
register('width', getter=self._getWidth,
|
|
@@ -208,6 +202,13 @@ class QPicamera(QCamera):
|
|
|
208
202
|
self._controlValues.update(pending)
|
|
209
203
|
return True
|
|
210
204
|
|
|
205
|
+
@staticmethod
|
|
206
|
+
def _limits(lo: float | None, hi: float | None) -> dict[str, float]:
|
|
207
|
+
'''The ``minimum`` and ``maximum`` that a camera reports, if any.'''
|
|
208
|
+
return {key: value
|
|
209
|
+
for key, value in (('minimum', lo), ('maximum', hi))
|
|
210
|
+
if value is not None}
|
|
211
|
+
|
|
211
212
|
def _probeControls(self, metadata: dict[str, object]) -> None:
|
|
212
213
|
'''Register picamera2 controls supported by this camera.
|
|
213
214
|
|
|
@@ -227,12 +228,7 @@ class QPicamera(QCamera):
|
|
|
227
228
|
lo, hi, default = self._device.camera_controls[name]
|
|
228
229
|
current = metadata.get(name, default)
|
|
229
230
|
self._controlValues[name] = ptype(current)
|
|
230
|
-
meta = {}
|
|
231
|
-
if ptype is not bool:
|
|
232
|
-
if lo is not None:
|
|
233
|
-
meta['minimum'] = lo
|
|
234
|
-
if hi is not None:
|
|
235
|
-
meta['maximum'] = hi
|
|
231
|
+
meta = {} if ptype is bool else self._limits(lo, hi)
|
|
236
232
|
self.registerProperty(
|
|
237
233
|
name,
|
|
238
234
|
getter=lambda n=name, t=ptype: t(self._controlValues[n]),
|
|
@@ -317,11 +313,7 @@ class QPicamera(QCamera):
|
|
|
317
313
|
current = (1.0, 1.0)
|
|
318
314
|
self._controlValues['ColourGains'] = (
|
|
319
315
|
float(current[0]), float(current[1]))
|
|
320
|
-
meta =
|
|
321
|
-
if lo is not None:
|
|
322
|
-
meta['minimum'] = lo
|
|
323
|
-
if hi is not None:
|
|
324
|
-
meta['maximum'] = hi
|
|
316
|
+
meta = self._limits(lo, hi)
|
|
325
317
|
self.registerProperty(
|
|
326
318
|
'ColourGainR',
|
|
327
319
|
getter=lambda: self._controlValues['ColourGains'][0],
|
|
@@ -421,38 +413,29 @@ class QPicamera(QCamera):
|
|
|
421
413
|
'''
|
|
422
414
|
self._height = int(value)
|
|
423
415
|
|
|
424
|
-
def
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
'''
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
416
|
+
def _configure(self, size: tuple[int, int]) -> None:
|
|
417
|
+
'''Configure the stream with *size*, the pixel format and the flips.'''
|
|
418
|
+
fmt = 'YUV420' if self._gray else 'BGR888'
|
|
419
|
+
kwargs = {'main': {'size': size, 'format': fmt}}
|
|
420
|
+
transform = self._makeTransform()
|
|
421
|
+
if transform is not None:
|
|
422
|
+
kwargs['transform'] = transform
|
|
423
|
+
self._device.configure(
|
|
424
|
+
self._device.create_preview_configuration(**kwargs))
|
|
425
|
+
|
|
426
|
+
def _reconfigure(self) -> None:
|
|
427
|
+
'''Restart the stream at its current size with the current format
|
|
428
|
+
and flips, and reapply the cached controls.
|
|
429
|
+
|
|
430
|
+
The size that :meth:`_setWidth` and :meth:`_setHeight` store takes
|
|
431
|
+
effect at the next :meth:`_initialize`, not here.
|
|
438
432
|
'''
|
|
439
|
-
w, h = self._device.camera_config['main']['size']
|
|
440
|
-
if width is not None:
|
|
441
|
-
w = int(width)
|
|
442
|
-
if height is not None:
|
|
443
|
-
h = int(height)
|
|
444
433
|
self._device.stop()
|
|
445
|
-
|
|
446
|
-
cfg_kwargs = {'main': {'size': (w, h), 'format': fmt}}
|
|
447
|
-
t = self._makeTransform()
|
|
448
|
-
if t is not None:
|
|
449
|
-
cfg_kwargs['transform'] = t
|
|
450
|
-
config = self._device.create_preview_configuration(**cfg_kwargs)
|
|
451
|
-
self._device.configure(config)
|
|
434
|
+
self._configure(self._device.camera_config['main']['size'])
|
|
452
435
|
self._device.start()
|
|
453
|
-
#
|
|
454
|
-
#
|
|
455
|
-
#
|
|
436
|
+
# _reconfigure does not rebuild _properties, so if the new
|
|
437
|
+
# configuration changes the available controls or their ranges the
|
|
438
|
+
# stale registrations persist silently.
|
|
456
439
|
if self._controlValues:
|
|
457
440
|
self._device.set_controls(self._controlValues)
|
|
458
441
|
|