QVideo 4.4.0__tar.gz → 4.5.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.4.0 → qvideo-4.5.0}/PKG-INFO +2 -2
- {qvideo-4.4.0 → qvideo-4.5.0}/QVideo.egg-info/PKG-INFO +2 -2
- {qvideo-4.4.0 → qvideo-4.5.0}/QVideo.egg-info/SOURCES.txt +4 -4
- {qvideo-4.4.0 → qvideo-4.5.0}/README.md +1 -1
- {qvideo-4.4.0 → qvideo-4.5.0}/demos/__init__.py +1 -2
- {qvideo-4.4.0 → qvideo-4.5.0}/demos/combineddemo.py +5 -5
- {qvideo-4.4.0 → qvideo-4.5.0}/demos/filterdemo.py +10 -10
- {qvideo-4.4.0 → qvideo-4.5.0}/demos/filterrackdemo.py +16 -17
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/circletransform.py +1 -1
- qvideo-4.4.0/lib/QFilterStack.py → qvideo-4.5.0/lib/QFilterPipeline.py +16 -16
- qvideo-4.5.0/lib/QFilterRack.py +63 -0
- qvideo-4.4.0/lib/QFilterRack.py → qvideo-4.5.0/lib/QFilterRackWidget.py +12 -8
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/QVideoFilter.py +3 -3
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/QVideoScreen.py +1 -1
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/__init__.py +10 -9
- {qvideo-4.4.0 → qvideo-4.5.0}/pyproject.toml +1 -1
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_combineddemo.py +6 -6
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_filter_export.py +4 -4
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_filterdemo.py +12 -12
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_filterrackdemo.py +18 -18
- qvideo-4.4.0/tests/test_qfilterstack.py → qvideo-4.5.0/tests/test_qfilterpipeline.py +80 -78
- qvideo-4.5.0/tests/test_qfilterrack.py +130 -0
- qvideo-4.4.0/tests/test_qfilterrack.py → qvideo-4.5.0/tests/test_qfilterrackwidget.py +27 -26
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qvideoscreen.py +1 -1
- qvideo-4.4.0/lib/QFPSMeter.py +0 -92
- qvideo-4.4.0/tests/test_qfpsmeter.py +0 -217
- {qvideo-4.4.0 → qvideo-4.5.0}/LICENSE.md +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/QCamcorder.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/QVideo.egg-info/dependency_links.txt +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/QVideo.egg-info/requires.txt +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/QVideo.egg-info/top_level.txt +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/__init__.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/__main__.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Basler/__init__.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Basler/_camera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Basler/_tree.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Flir/QListFlirCameras.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Flir/__init__.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Flir/_camera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Flir/_tree.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Genicam/__init__.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Genicam/_camera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Genicam/_tree.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/IDS/__init__.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/IDS/_camera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/IDS/_tree.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/MV/__init__.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/MV/_camera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/MV/_tree.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Noise/__init__.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Noise/_camera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Noise/_tree.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/OpenCV/QListCVCameras.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/OpenCV/__init__.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/OpenCV/_camera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/OpenCV/_devices.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/OpenCV/_tree.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Picamera/__init__.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Picamera/_camera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Picamera/_imx500.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Picamera/_tree.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Vimbax/__init__.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Vimbax/_camera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/Vimbax/_tree.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/cameras/__init__.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/demos/ROIdemo.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/demos/circulardemo.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/demos/compositedemo.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/demos/demo.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/demos/histogramdemo.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/demos/trackpydemo.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/demos/uniformitydemo.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/demos/yolodemo.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/dvr/QCircularBuffer.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/dvr/QCircularDVRWidget.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/dvr/QDVRWidget.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/dvr/QHDF5Reader.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/dvr/QHDF5Writer.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/dvr/QOpenCVReader.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/dvr/QOpenCVWriter.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/dvr/__init__.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/dvr/icons_rc.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/_MedianBase.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/__init__.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/artistic.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/blob.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/darkframe.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/dejitter.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/dog.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/edge.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/exposure.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/flatfield.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/foreground.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/gamma.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/invert.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/laplacian.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/median.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/momean.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/momedian.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/normalize.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/rgb.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/roi.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/samplehold.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/smoothing.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/sobel.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/threshold.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/filters/unsharp.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/QCamera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/QCameraTree.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/QFrameRelay.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/QHistogramWidget.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/QListCameras.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/QSnapshot.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/QUniformityWidget.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/QVideoReader.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/QVideoSource.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/QVideoWriter.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/_camera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/_jupyter.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/_launch.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/_qabc.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/chooser.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/clickable.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/errors.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/gentl.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/imageops.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/lib/videotypes.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/overlays/__init__.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/overlays/trackpy.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/overlays/yolo.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/setup.cfg +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_artistic.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_blob.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_camera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_chooser.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_circletransform.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_circularbuffer.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_circulardemo.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_circulardvrwidget.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_clickable.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_compositedemo.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_darkframe.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_dejitter.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_demo.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_docs_quickstart.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_dog.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_edge.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_exposure.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_filters_gray.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_flatfield.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_foreground.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_gamma.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_gentl.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_histogramdemo.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_histogramwidget.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_icons_rc.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_imageops.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_invert.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_jupyter.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_laplacian.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_launch.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_median.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_momean.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_momedian.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_normalize.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_overlays_package.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qabc.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qbaslercamera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qcamcorder.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qcamera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qcameratree.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qdvrwidget.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qflircamera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qframerelay.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qgenicamcamera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qgenicamtree.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qhdf5reader.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qhdf5writer.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qidscamera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qimxcamera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qlistcameras.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qlistcvcameras.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qlistflircameras.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qmvcamera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qnoisecamera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qnoisetree.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qopencvcamera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qopencvdevices.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qopencvreader.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qopencvtree.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qopencvwriter.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qpicamera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qpicameratree.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qsnapshot.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qt_binding.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qvideoreader.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qvideosource.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qvideowriter.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_qvimbaxcamera.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_resolutions.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_rgb.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_roi.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_roidemo.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_samplehold.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_smoothing.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_sobel.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_threshold.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_trackpy_overlay.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_trackpydemo.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_uniformitydemo.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_uniformitywidget.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_unsharp.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_vendor_trees.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_videofilter.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_videotypes.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.0}/tests/test_yolo_overlay.py +0 -0
- {qvideo-4.4.0 → qvideo-4.5.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.5.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
|
|
@@ -106,7 +106,7 @@ abstraction and require no camera-specific code.
|
|
|
106
106
|
- **Threaded video source** — `QVideoSource` wraps any camera in a `QThread`
|
|
107
107
|
and emits `newFrame(ndarray, FrameInfo)` at acquisition rate.
|
|
108
108
|
- **Composable filter pipeline** — `VideoFilter` objects run in a
|
|
109
|
-
`
|
|
109
|
+
`QFilterPipeline` on a worker thread between source and consumers (display,
|
|
110
110
|
recorder); filters include blur, edge detection, RGB channel selection,
|
|
111
111
|
sample-and-hold, binary threshold, and blob coloring.
|
|
112
112
|
- **Graphical overlays** — `QTrackpyWidget` for live particle tracking and
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: QVideo
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.5.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
|
|
@@ -106,7 +106,7 @@ abstraction and require no camera-specific code.
|
|
|
106
106
|
- **Threaded video source** — `QVideoSource` wraps any camera in a `QThread`
|
|
107
107
|
and emits `newFrame(ndarray, FrameInfo)` at acquisition rate.
|
|
108
108
|
- **Composable filter pipeline** — `VideoFilter` objects run in a
|
|
109
|
-
`
|
|
109
|
+
`QFilterPipeline` on a worker thread between source and consumers (display,
|
|
110
110
|
recorder); filters include blur, edge detection, RGB channel selection,
|
|
111
111
|
sample-and-hold, binary threshold, and blob coloring.
|
|
112
112
|
- **Graphical overlays** — `QTrackpyWidget` for live particle tracking and
|
|
@@ -93,9 +93,9 @@ filters/threshold.py
|
|
|
93
93
|
filters/unsharp.py
|
|
94
94
|
lib/QCamera.py
|
|
95
95
|
lib/QCameraTree.py
|
|
96
|
-
lib/
|
|
96
|
+
lib/QFilterPipeline.py
|
|
97
97
|
lib/QFilterRack.py
|
|
98
|
-
lib/
|
|
98
|
+
lib/QFilterRackWidget.py
|
|
99
99
|
lib/QFrameRelay.py
|
|
100
100
|
lib/QHistogramWidget.py
|
|
101
101
|
lib/QListCameras.py
|
|
@@ -165,10 +165,10 @@ tests/test_qcamcorder.py
|
|
|
165
165
|
tests/test_qcamera.py
|
|
166
166
|
tests/test_qcameratree.py
|
|
167
167
|
tests/test_qdvrwidget.py
|
|
168
|
+
tests/test_qfilterpipeline.py
|
|
168
169
|
tests/test_qfilterrack.py
|
|
169
|
-
tests/
|
|
170
|
+
tests/test_qfilterrackwidget.py
|
|
170
171
|
tests/test_qflircamera.py
|
|
171
|
-
tests/test_qfpsmeter.py
|
|
172
172
|
tests/test_qframerelay.py
|
|
173
173
|
tests/test_qgenicamcamera.py
|
|
174
174
|
tests/test_qgenicamtree.py
|
|
@@ -26,7 +26,7 @@ abstraction and require no camera-specific code.
|
|
|
26
26
|
- **Threaded video source** — `QVideoSource` wraps any camera in a `QThread`
|
|
27
27
|
and emits `newFrame(ndarray, FrameInfo)` at acquisition rate.
|
|
28
28
|
- **Composable filter pipeline** — `VideoFilter` objects run in a
|
|
29
|
-
`
|
|
29
|
+
`QFilterPipeline` on a worker thread between source and consumers (display,
|
|
30
30
|
recorder); filters include blur, edge detection, RGB channel selection,
|
|
31
31
|
sample-and-hold, binary threshold, and blob coloring.
|
|
32
32
|
- **Graphical overlays** — `QTrackpyWidget` for live particle tracking and
|
|
@@ -13,8 +13,7 @@ demo
|
|
|
13
13
|
|
|
14
14
|
filterdemo
|
|
15
15
|
Extends :mod:`demo` with a fixed
|
|
16
|
-
:class:`~QVideo.lib.QFilterRack.QFilterRack` panel
|
|
17
|
-
:class:`~QVideo.lib.QFilterStack.QFilterStack`, so that
|
|
16
|
+
:class:`~QVideo.lib.QFilterRack.QFilterRack` panel, so that
|
|
18
17
|
image-processing filters can be toggled and adjusted alongside the
|
|
19
18
|
live feed without slowing the interface.
|
|
20
19
|
|
|
@@ -13,9 +13,9 @@ step is a short method of its own:
|
|
|
13
13
|
1. :class:`~QVideo.QCamcorder.QCamcorder` supplies the screen, the camera
|
|
14
14
|
controls and the recorder.
|
|
15
15
|
2. :class:`~QVideo.demos.filterrackdemo.FilterRackDemo` adds a filter
|
|
16
|
-
|
|
16
|
+
pipeline: ``camera -> pipeline -> screen``.
|
|
17
17
|
3. :meth:`CombinedDemo._setupOverlay` adds the trackpy overlay. It
|
|
18
|
-
detects particles in the frames of the
|
|
18
|
+
detects particles in the frames of the pipeline, so it sees what the
|
|
19
19
|
screen shows.
|
|
20
20
|
4. :meth:`CombinedDemo._setupCompositeMode` adds a recording mode that
|
|
21
21
|
saves the rendered scene: the filtered video with the particle
|
|
@@ -23,14 +23,14 @@ step is a short method of its own:
|
|
|
23
23
|
|
|
24
24
|
Data flow::
|
|
25
25
|
|
|
26
|
-
camera -> filter
|
|
26
|
+
camera -> filter pipeline -> screen (+ trackpy markers)
|
|
27
27
|
| |
|
|
28
28
|
| +--> recorder, in Display or Composite mode
|
|
29
29
|
+--> trackpy detection
|
|
30
30
|
+--> recorder, in Filtered mode
|
|
31
31
|
|
|
32
32
|
Extensions that depend on each other, as the overlay depends on the
|
|
33
|
-
|
|
33
|
+
pipeline here, are combined by application code like this and not by the
|
|
34
34
|
framework, because only the application knows which stream each one needs.
|
|
35
35
|
'''
|
|
36
36
|
|
|
@@ -71,7 +71,7 @@ class CombinedDemo(FilterRackDemo):
|
|
|
71
71
|
'''Detect particles in the filtered stream and mark them on the
|
|
72
72
|
screen.'''
|
|
73
73
|
self.trackpy = QTrackpyWidget(self)
|
|
74
|
-
self.trackpy.source = self.
|
|
74
|
+
self.trackpy.source = self.rack.pipeline
|
|
75
75
|
self.screen.addOverlay(self.trackpy.overlay)
|
|
76
76
|
self.controls.layout().addWidget(self.trackpy)
|
|
77
77
|
|
|
@@ -8,7 +8,7 @@ Run directly::
|
|
|
8
8
|
|
|
9
9
|
from qtpy import QtGui
|
|
10
10
|
from QVideo.demos.demo import Demo
|
|
11
|
-
from QVideo.lib import QCameraTree, QFilterRack,
|
|
11
|
+
from QVideo.lib import QCameraTree, QFilterRack, launch
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
__all__ = ['FilterDemo']
|
|
@@ -17,12 +17,12 @@ __all__ = ['FilterDemo']
|
|
|
17
17
|
class FilterDemo(Demo):
|
|
18
18
|
'''Extends :class:`~QVideo.demos.demo.Demo` with image filters.
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
worker thread between the camera and the screen, so even a slow filter
|
|
22
|
-
leaves the interface responsive. The filters appear in a fixed
|
|
20
|
+
The filters appear in a fixed
|
|
23
21
|
:class:`~QVideo.lib.QFilterRack.QFilterRack` below the camera control
|
|
24
22
|
tree, where each one can be switched on and off and adjusted alongside
|
|
25
|
-
the live feed.
|
|
23
|
+
the live feed. The rack runs them on a worker thread between the
|
|
24
|
+
camera and the screen, so even a slow filter leaves the interface
|
|
25
|
+
responsive. See :mod:`~QVideo.demos.filterrackdemo` for a rack
|
|
26
26
|
that can be edited while the program runs.
|
|
27
27
|
|
|
28
28
|
Parameters
|
|
@@ -43,15 +43,15 @@ class FilterDemo(Demo):
|
|
|
43
43
|
**kwargs) -> None:
|
|
44
44
|
super().__init__(cameraTree, **kwargs)
|
|
45
45
|
self.rack = QFilterRack(self, editable=False)
|
|
46
|
+
self.rack.source = self.cameraTree.source
|
|
47
|
+
self.screen.source = self.rack.pipeline
|
|
48
|
+
self._controls.addWidget(self.rack)
|
|
46
49
|
for name in filters:
|
|
47
50
|
self.rack.addByName(name)
|
|
48
|
-
self.stack = QFilterStack(self.cameraTree.source, rack=self.rack)
|
|
49
|
-
self.screen.source = self.stack
|
|
50
|
-
self._controls.addWidget(self.rack)
|
|
51
51
|
|
|
52
52
|
def closeEvent(self, event: QtGui.QCloseEvent) -> None:
|
|
53
|
-
'''Stop the filter
|
|
54
|
-
self.
|
|
53
|
+
'''Stop the filter pipeline before the widget closes.'''
|
|
54
|
+
self.rack.pipeline.stop()
|
|
55
55
|
super().closeEvent(event)
|
|
56
56
|
|
|
57
57
|
|
|
@@ -16,28 +16,28 @@ Three recording modes are offered:
|
|
|
16
16
|
The unfiltered camera stream at the full camera frame rate.
|
|
17
17
|
|
|
18
18
|
**Filtered**
|
|
19
|
-
The rack-processed stream from the filter
|
|
20
|
-
display throttle. The
|
|
19
|
+
The rack-processed stream from the filter pipeline, independent of the
|
|
20
|
+
display throttle. The pipeline works on its own thread and keeps a
|
|
21
21
|
short queue of frames, so a brief slowdown does not lose frames.
|
|
22
22
|
|
|
23
23
|
**Display**
|
|
24
24
|
The rack-processed stream at the throttled display rate. Only
|
|
25
25
|
frames that are actually rendered to screen are recorded.
|
|
26
26
|
|
|
27
|
-
One :class:`~QVideo.lib.
|
|
27
|
+
One :class:`~QVideo.lib.QFilterPipeline.QFilterPipeline` runs the rack's
|
|
28
28
|
filters and feeds both the display and the recorder, so stateful filters
|
|
29
29
|
see each frame exactly once.
|
|
30
30
|
'''
|
|
31
31
|
|
|
32
32
|
from qtpy import QtCore, QtGui, QtWidgets
|
|
33
33
|
from QVideo.QCamcorder import QCamcorder
|
|
34
|
-
from QVideo.lib import QCameraTree, QFilterRack,
|
|
34
|
+
from QVideo.lib import QCameraTree, QFilterRack, launch
|
|
35
35
|
from QVideo.filters import QSmoothingFilter, QThresholdFilter
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
__all__ = ['FilterRackDemo']
|
|
39
39
|
|
|
40
|
-
#: Frames the filter
|
|
40
|
+
#: Frames the filter pipeline may queue while its filters are busy.
|
|
41
41
|
_QUEUE_DEPTH = 8
|
|
42
42
|
|
|
43
43
|
|
|
@@ -51,7 +51,7 @@ class FilterRackDemo(QCamcorder):
|
|
|
51
51
|
a group of radio buttons to select the DVR recording source:
|
|
52
52
|
|
|
53
53
|
- **Raw**: unfiltered frames at the camera's full frame rate.
|
|
54
|
-
- **Filtered**: rack-processed frames from the filter
|
|
54
|
+
- **Filtered**: rack-processed frames from the filter pipeline.
|
|
55
55
|
- **Display**: rack-processed frames at the throttled display rate.
|
|
56
56
|
|
|
57
57
|
Parameters
|
|
@@ -65,16 +65,15 @@ class FilterRackDemo(QCamcorder):
|
|
|
65
65
|
|
|
66
66
|
def __init__(self, cameraWidget: QCameraTree, **kwargs) -> None:
|
|
67
67
|
super().__init__(cameraWidget, **kwargs)
|
|
68
|
-
self.rack = QFilterRack(self)
|
|
69
|
-
self.rack.
|
|
70
|
-
self.rack.
|
|
71
|
-
self.stack = QFilterStack(self.source, rack=self.rack,
|
|
72
|
-
depth=_QUEUE_DEPTH)
|
|
73
|
-
self.screen.source = self.stack
|
|
68
|
+
self.rack = QFilterRack(self, depth=_QUEUE_DEPTH)
|
|
69
|
+
self.rack.source = self.source
|
|
70
|
+
self.screen.source = self.rack.pipeline
|
|
74
71
|
self._setupModeUi()
|
|
75
72
|
self._connectModeSignals()
|
|
76
73
|
self.controls.layout().addWidget(self._modeBox)
|
|
77
74
|
self.controls.layout().addWidget(self.rack)
|
|
75
|
+
self.rack.add(QSmoothingFilter())
|
|
76
|
+
self.rack.add(QThresholdFilter())
|
|
78
77
|
|
|
79
78
|
def _setupModeUi(self) -> None:
|
|
80
79
|
self._modeBox = QtWidgets.QGroupBox('Record from')
|
|
@@ -97,7 +96,7 @@ class FilterRackDemo(QCamcorder):
|
|
|
97
96
|
def dvrPlayback(self, playback: bool) -> None:
|
|
98
97
|
'''Filter the DVR player instead of the camera during playback.
|
|
99
98
|
|
|
100
|
-
The screen keeps displaying the filter
|
|
99
|
+
The screen keeps displaying the filter pipeline, so playback frames
|
|
101
100
|
pass through the rack exactly once and live camera frames never
|
|
102
101
|
mix with them.
|
|
103
102
|
|
|
@@ -106,12 +105,12 @@ class FilterRackDemo(QCamcorder):
|
|
|
106
105
|
playback : bool
|
|
107
106
|
``True`` when DVR playback begins, ``False`` when it ends.
|
|
108
107
|
'''
|
|
109
|
-
self.
|
|
108
|
+
self.rack.source = self.dvr.player if playback else self.source
|
|
110
109
|
self.cameraWidget.setDisabled(playback)
|
|
111
110
|
|
|
112
111
|
def closeEvent(self, event: QtGui.QCloseEvent) -> None:
|
|
113
|
-
'''Stop the filter
|
|
114
|
-
self.
|
|
112
|
+
'''Stop the filter pipeline, then the camera source.'''
|
|
113
|
+
self.rack.pipeline.stop()
|
|
115
114
|
super().closeEvent(event)
|
|
116
115
|
|
|
117
116
|
@QtCore.Slot(QtWidgets.QAbstractButton, bool)
|
|
@@ -132,7 +131,7 @@ class FilterRackDemo(QCamcorder):
|
|
|
132
131
|
if button is self._modeRaw:
|
|
133
132
|
self.dvr.source = self.source
|
|
134
133
|
elif button is self._modeFiltered:
|
|
135
|
-
self.dvr.source = self.
|
|
134
|
+
self.dvr.source = self.rack.pipeline
|
|
136
135
|
elif button is self._modeDisplay:
|
|
137
136
|
self.dvr.source = self.screen
|
|
138
137
|
|
|
@@ -34,7 +34,7 @@ class CircleTransformFilter(VideoFilter):
|
|
|
34
34
|
|
|
35
35
|
The transform integrates evidence from all ring radii simultaneously,
|
|
36
36
|
so no radius parameter is required. The computation is heavy, so run
|
|
37
|
-
the filter in a :class:`~QVideo.lib.
|
|
37
|
+
the filter in a :class:`~QVideo.lib.QFilterPipeline.QFilterPipeline`, which
|
|
38
38
|
keeps it off the GUI thread.
|
|
39
39
|
|
|
40
40
|
Parameters
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'''Worker thread that runs a
|
|
1
|
+
'''Worker thread that runs a pipeline of video filters.'''
|
|
2
2
|
from collections import deque
|
|
3
3
|
import logging
|
|
4
4
|
import numpy as np
|
|
@@ -9,14 +9,14 @@ from QVideo.lib.videotypes import Image, FrameInfo
|
|
|
9
9
|
|
|
10
10
|
logger = logging.getLogger(__name__)
|
|
11
11
|
|
|
12
|
-
__all__ = ['
|
|
12
|
+
__all__ = ['QFilterPipeline']
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
class
|
|
15
|
+
class QFilterPipeline(QtCore.QThread):
|
|
16
16
|
|
|
17
|
-
'''Apply a
|
|
17
|
+
'''Apply a pipeline of filters to a video source on a worker thread.
|
|
18
18
|
|
|
19
|
-
The
|
|
19
|
+
The pipeline sits between a source and its consumers (a screen, a
|
|
20
20
|
recorder, an overlay). It receives ``newFrame`` from the source,
|
|
21
21
|
runs the filters in order on its own thread, and emits ``newFrame``
|
|
22
22
|
with the result. The GUI thread is never involved in the
|
|
@@ -26,25 +26,25 @@ class QFilterStack(QtCore.QThread):
|
|
|
26
26
|
frame is passed through unchanged, so a processed frame keeps the
|
|
27
27
|
capture time and index of the frame it came from.
|
|
28
28
|
|
|
29
|
-
The
|
|
29
|
+
The pipeline can stand in for a
|
|
30
30
|
:class:`~QVideo.lib.QVideoSource.QVideoSource`: it has ``newFrame``,
|
|
31
31
|
``shapeChanged``, ``fps`` and ``shape``.
|
|
32
32
|
|
|
33
33
|
**Frames that arrive while the worker is busy.** The worker holds up
|
|
34
34
|
to *depth* waiting frames. With the default ``depth=1`` only the
|
|
35
|
-
newest frame waits, so the
|
|
35
|
+
newest frame waits, so the pipeline always processes the latest frame
|
|
36
36
|
and an interactive display never lags. A larger *depth* gives a
|
|
37
37
|
bounded queue for recording. When the queue is full the oldest
|
|
38
38
|
waiting frame is dropped; drops are counted and reported through
|
|
39
39
|
:attr:`framesDropped`.
|
|
40
40
|
|
|
41
41
|
**Failures.** A filter that raises is logged, removed from the
|
|
42
|
-
|
|
42
|
+
pipeline, and reported through :attr:`filterFailed`; the frame continues
|
|
43
43
|
through the remaining filters unchanged by the failed one.
|
|
44
44
|
|
|
45
45
|
**Following a rack.** With a
|
|
46
|
-
:class:`~QVideo.lib.
|
|
47
|
-
rack's switched-on filters, follows the rack as filters are added,
|
|
46
|
+
:class:`~QVideo.lib.QFilterRackWidget.QFilterRackWidget` the pipeline
|
|
47
|
+
runs the rack's switched-on filters, follows the rack as filters are added,
|
|
48
48
|
removed, reordered or toggled, and switches off the rack widget of a
|
|
49
49
|
filter that fails. The worker thread only ever sees
|
|
50
50
|
:class:`~QVideo.lib.QVideoFilter.VideoFilter` objects, never widgets.
|
|
@@ -61,15 +61,15 @@ class QFilterStack(QtCore.QThread):
|
|
|
61
61
|
Filters to apply, in order.
|
|
62
62
|
depth : int
|
|
63
63
|
Number of frames that may wait for the worker. Default: ``1``.
|
|
64
|
-
rack :
|
|
65
|
-
Rack whose switched-on filters the
|
|
64
|
+
rack : QFilterRackWidget or None
|
|
65
|
+
Rack whose switched-on filters the pipeline runs, in place of
|
|
66
66
|
*filters*.
|
|
67
67
|
|
|
68
68
|
Notes
|
|
69
69
|
-----
|
|
70
|
-
The
|
|
70
|
+
The pipeline owns a running thread, so it takes no Qt parent: a parent
|
|
71
71
|
would let Qt delete the thread while it runs. Keep a reference to
|
|
72
|
-
the
|
|
72
|
+
the pipeline for as long as it is needed. The thread stops on
|
|
73
73
|
:meth:`stop`, when the application quits, and when the last
|
|
74
74
|
reference is dropped.
|
|
75
75
|
|
|
@@ -129,7 +129,7 @@ class QFilterStack(QtCore.QThread):
|
|
|
129
129
|
|
|
130
130
|
@property
|
|
131
131
|
def rack(self):
|
|
132
|
-
'''The rack whose filters the
|
|
132
|
+
'''The rack whose filters the pipeline runs, or ``None``.'''
|
|
133
133
|
return self._rack
|
|
134
134
|
|
|
135
135
|
@rack.setter
|
|
@@ -202,7 +202,7 @@ class QFilterStack(QtCore.QThread):
|
|
|
202
202
|
result = video_filter(frame)
|
|
203
203
|
except Exception as error:
|
|
204
204
|
logger.exception(f'{type(video_filter).__name__} failed '
|
|
205
|
-
'and was removed from the filter
|
|
205
|
+
'and was removed from the filter pipeline')
|
|
206
206
|
self.filters = [f for f in self._filters
|
|
207
207
|
if f is not video_filter]
|
|
208
208
|
self.filterFailed.emit(video_filter, error)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'''A filter rack that runs its filters on a worker thread.'''
|
|
2
|
+
from qtpy import QtWidgets
|
|
3
|
+
from QVideo.lib.QFilterRackWidget import QFilterRackWidget
|
|
4
|
+
from QVideo.lib.QFilterPipeline import QFilterPipeline
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
__all__ = ['QFilterRack']
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class QFilterRack(QFilterRackWidget):
|
|
11
|
+
|
|
12
|
+
'''A :class:`~QVideo.lib.QFilterRackWidget.QFilterRackWidget` that
|
|
13
|
+
filters a live source.
|
|
14
|
+
|
|
15
|
+
The rack owns a :class:`~QVideo.lib.QFilterPipeline.QFilterPipeline`
|
|
16
|
+
that follows the rack: it runs the switched-on filters, in order, on
|
|
17
|
+
a worker thread, so a slow filter never stalls the interface or the
|
|
18
|
+
camera, and it keeps the newest frame when it falls behind.
|
|
19
|
+
Connect consumers to :attr:`pipeline`, not to the raw source, so
|
|
20
|
+
that they share one filtered stream::
|
|
21
|
+
|
|
22
|
+
rack = QFilterRack(source=camera)
|
|
23
|
+
screen.source = rack.pipeline
|
|
24
|
+
|
|
25
|
+
Use :class:`~QVideo.lib.QFilterRackWidget.QFilterRackWidget` to
|
|
26
|
+
apply the filters to recorded frames, or to design a pipeline,
|
|
27
|
+
without a thread.
|
|
28
|
+
|
|
29
|
+
Parameters
|
|
30
|
+
----------
|
|
31
|
+
parent : QtWidgets.QWidget or None
|
|
32
|
+
Parent widget. Default: ``None``.
|
|
33
|
+
editable : bool
|
|
34
|
+
If ``False``, the toolbar, drag handles, and close buttons are
|
|
35
|
+
all hidden. Default: ``True``.
|
|
36
|
+
source : QVideoSource or None
|
|
37
|
+
Provider of the frames to filter. It can be set later.
|
|
38
|
+
Default: ``None``.
|
|
39
|
+
depth : int
|
|
40
|
+
Frames the pipeline may queue while its filters are busy.
|
|
41
|
+
Default: ``1``, which always processes the newest.
|
|
42
|
+
'''
|
|
43
|
+
|
|
44
|
+
def __init__(self,
|
|
45
|
+
parent: QtWidgets.QWidget | None = None,
|
|
46
|
+
editable: bool = True,
|
|
47
|
+
source=None,
|
|
48
|
+
depth: int = 1) -> None:
|
|
49
|
+
super().__init__(parent, editable)
|
|
50
|
+
self.pipeline = QFilterPipeline(source, rack=self, depth=depth)
|
|
51
|
+
|
|
52
|
+
@property
|
|
53
|
+
def source(self):
|
|
54
|
+
'''The source whose frames are filtered.'''
|
|
55
|
+
return self.pipeline.source
|
|
56
|
+
|
|
57
|
+
@source.setter
|
|
58
|
+
def source(self, source) -> None:
|
|
59
|
+
self.pipeline.source = source
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
if __name__ == '__main__': # pragma: no cover
|
|
63
|
+
QFilterRack.example()
|
|
@@ -7,7 +7,7 @@ import QVideo.filters as videofilters
|
|
|
7
7
|
import pyqtgraph as pg
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
__all__ = ['
|
|
10
|
+
__all__ = ['QFilterRackWidget']
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class _DragHandle(QtWidgets.QLabel):
|
|
@@ -178,7 +178,7 @@ class _FilterPicker(QtWidgets.QDialog):
|
|
|
178
178
|
return item.text(0) if item.parent() else None
|
|
179
179
|
|
|
180
180
|
|
|
181
|
-
class
|
|
181
|
+
class QFilterRackWidget(QtWidgets.QWidget):
|
|
182
182
|
|
|
183
183
|
'''A dynamic, reorderable pipeline of :class:`~QVideo.lib.QVideoFilter.QVideoFilter` widgets.
|
|
184
184
|
|
|
@@ -190,9 +190,13 @@ class QFilterRack(QtWidgets.QWidget):
|
|
|
190
190
|
|
|
191
191
|
The rack is designed for interactive use, where the pipeline should
|
|
192
192
|
be discoverable and adjustable at runtime. With ``editable=False`` it
|
|
193
|
-
is a fixed panel of filters.
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
is a fixed panel of filters.
|
|
194
|
+
|
|
195
|
+
The widget runs no thread: calling it applies the filters in the
|
|
196
|
+
caller's thread, which suits recorded frames and pipeline design. To
|
|
197
|
+
filter a live stream use :class:`~QVideo.lib.QFilterRack.QFilterRack`,
|
|
198
|
+
which adds a :class:`~QVideo.lib.QFilterPipeline.QFilterPipeline` that
|
|
199
|
+
runs the switched-on filters on a worker thread.
|
|
196
200
|
|
|
197
201
|
Parameters
|
|
198
202
|
----------
|
|
@@ -275,7 +279,7 @@ class QFilterRack(QtWidgets.QWidget):
|
|
|
275
279
|
|
|
276
280
|
These are the :class:`~QVideo.lib.QVideoFilter.VideoFilter`
|
|
277
281
|
objects, not the widgets, so they can be handed to a
|
|
278
|
-
:class:`~QVideo.lib.
|
|
282
|
+
:class:`~QVideo.lib.QFilterPipeline.QFilterPipeline` on another thread.
|
|
279
283
|
'''
|
|
280
284
|
return [widget.filter for widget in self if widget.isChecked()]
|
|
281
285
|
|
|
@@ -283,7 +287,7 @@ class QFilterRack(QtWidgets.QWidget):
|
|
|
283
287
|
def switchOff(self, video_filter: VideoFilter, error: Exception) -> None:
|
|
284
288
|
'''Switch off the widget that holds *video_filter*.
|
|
285
289
|
|
|
286
|
-
Connected to :attr:`
|
|
290
|
+
Connected to :attr:`QFilterPipeline.filterFailed`.
|
|
287
291
|
|
|
288
292
|
Parameters
|
|
289
293
|
----------
|
|
@@ -504,4 +508,4 @@ class QFilterRack(QtWidgets.QWidget):
|
|
|
504
508
|
|
|
505
509
|
|
|
506
510
|
if __name__ == '__main__': # pragma: no cover
|
|
507
|
-
|
|
511
|
+
QFilterRackWidget.example()
|
|
@@ -119,7 +119,7 @@ class VideoFilter(QtCore.QObject):
|
|
|
119
119
|
'''Return a :class:`FilterCode` fragment for pipeline export.
|
|
120
120
|
|
|
121
121
|
Stateless filters implement this to enable
|
|
122
|
-
:meth:`~QVideo.lib.
|
|
122
|
+
:meth:`~QVideo.lib.QFilterRackWidget.QFilterRackWidget.exportPipeline`.
|
|
123
123
|
Stateful filters (those that accumulate state across frames)
|
|
124
124
|
return ``None`` to indicate they cannot be expressed as a
|
|
125
125
|
single-frame pure function.
|
|
@@ -145,8 +145,8 @@ class QVideoFilter(QtWidgets.QGroupBox):
|
|
|
145
145
|
to ``self._layout``.
|
|
146
146
|
|
|
147
147
|
Subclasses should set :attr:`display_name` to a short human-readable
|
|
148
|
-
label. :class:`~QVideo.lib.
|
|
149
|
-
populate the "Add filter…" picker.
|
|
148
|
+
label. :class:`~QVideo.lib.QFilterRackWidget.QFilterRackWidget` uses
|
|
149
|
+
this to populate the "Add filter…" picker.
|
|
150
150
|
|
|
151
151
|
Parameters
|
|
152
152
|
----------
|
|
@@ -22,7 +22,7 @@ class QVideoScreen(GraphicsLayoutWidget):
|
|
|
22
22
|
Displays frames from a :class:`~QVideo.lib.QVideoSource` in real time,
|
|
23
23
|
with optional frame-rate throttling. The screen applies no filters;
|
|
24
24
|
to display filtered frames, make a
|
|
25
|
-
:class:`~QVideo.lib.
|
|
25
|
+
:class:`~QVideo.lib.QFilterPipeline.QFilterPipeline` its source.
|
|
26
26
|
|
|
27
27
|
Inherits from :class:`pyqtgraph.GraphicsLayoutWidget`.
|
|
28
28
|
|
|
@@ -23,16 +23,16 @@ QFrameRelay
|
|
|
23
23
|
Latest-frame handoff from a capture thread to a GUI-thread consumer.
|
|
24
24
|
QVideoFilter
|
|
25
25
|
Qt widget wrapper around a :class:`VideoFilter`.
|
|
26
|
-
|
|
26
|
+
QFilterRackWidget
|
|
27
27
|
Dynamic, user-reorderable pipeline of :class:`QVideoFilter` widgets.
|
|
28
|
-
|
|
29
|
-
Worker thread that applies a
|
|
28
|
+
QFilterPipeline
|
|
29
|
+
Worker thread that applies a pipeline of filters (or a rack) to a source.
|
|
30
|
+
QFilterRack
|
|
31
|
+
A filter rack that owns a :class:`QFilterPipeline` for a live source.
|
|
30
32
|
QVideoReader
|
|
31
33
|
Abstract base class for video file readers.
|
|
32
34
|
QVideoWriter
|
|
33
35
|
Abstract base class for video file writers.
|
|
34
|
-
QFPSMeter
|
|
35
|
-
Frame-rate measurement utility.
|
|
36
36
|
QSnapshot
|
|
37
37
|
Hotkey-triggered still-frame capture from any ``newFrame`` signal.
|
|
38
38
|
QListCameras
|
|
@@ -45,8 +45,9 @@ from .errors import QCameraError, QDriverError, QDeviceError
|
|
|
45
45
|
from .QVideoSource import QVideoSource
|
|
46
46
|
from .QCameraTree import QCameraTree
|
|
47
47
|
from .QVideoScreen import QVideoScreen
|
|
48
|
+
from .QFilterRackWidget import QFilterRackWidget
|
|
49
|
+
from .QFilterPipeline import QFilterPipeline
|
|
48
50
|
from .QFilterRack import QFilterRack
|
|
49
|
-
from .QFilterStack import QFilterStack
|
|
50
51
|
from .QFrameRelay import QFrameRelay
|
|
51
52
|
from .QVideoFilter import VideoFilter, QVideoFilter
|
|
52
53
|
from .QVideoReader import QVideoReader
|
|
@@ -55,7 +56,6 @@ from ._camera import Camera
|
|
|
55
56
|
from .chooser import choose_camera
|
|
56
57
|
from ._launch import launch
|
|
57
58
|
from .QListCameras import QListCameras
|
|
58
|
-
from .QFPSMeter import QFPSMeter
|
|
59
59
|
from .QHistogramWidget import QHistogramWidget
|
|
60
60
|
from .QUniformityWidget import QUniformityWidget
|
|
61
61
|
from .QSnapshot import QSnapshot
|
|
@@ -64,6 +64,7 @@ __all__ = '''Image
|
|
|
64
64
|
FrameInfo
|
|
65
65
|
clickable Camera choose_camera launch QListCameras
|
|
66
66
|
QCamera QCameraError QDriverError QDeviceError QVideoSource QCameraTree
|
|
67
|
-
QFilterRack
|
|
67
|
+
QFilterRackWidget QFilterPipeline QFilterRack QFrameRelay
|
|
68
68
|
QVideoReader QVideoWriter QVideoScreen
|
|
69
|
-
|
|
69
|
+
QHistogramWidget QUniformityWidget QSnapshot
|
|
70
|
+
VideoFilter QVideoFilter'''.split()
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "QVideo"
|
|
7
|
-
version = "4.
|
|
7
|
+
version = "4.5.0"
|
|
8
8
|
description = "PyQt-based framework for integrating video cameras into research applications"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "GPL-3.0-or-later" }
|
|
@@ -6,7 +6,7 @@ import QVideo.overlays.trackpy as _trackpy_mod
|
|
|
6
6
|
from QVideo.cameras.Noise._tree import QNoiseTree
|
|
7
7
|
from QVideo.demos.combineddemo import CombinedDemo
|
|
8
8
|
from QVideo.demos.filterrackdemo import FilterRackDemo
|
|
9
|
-
from QVideo.lib import
|
|
9
|
+
from QVideo.lib import QFilterPipeline
|
|
10
10
|
from QVideo.overlays.trackpy import QTrackpyWidget, _TrackpyWorker
|
|
11
11
|
|
|
12
12
|
|
|
@@ -31,12 +31,12 @@ class TestStructure(unittest.TestCase):
|
|
|
31
31
|
|
|
32
32
|
def test_particles_are_located_in_the_filtered_stream(self):
|
|
33
33
|
demo = make_demo()
|
|
34
|
-
self.assertIsInstance(demo.
|
|
35
|
-
self.assertIs(demo.trackpy.source, demo.
|
|
34
|
+
self.assertIsInstance(demo.rack.pipeline, QFilterPipeline)
|
|
35
|
+
self.assertIs(demo.trackpy.source, demo.rack.pipeline)
|
|
36
36
|
|
|
37
37
|
def test_the_screen_shows_the_filtered_stream(self):
|
|
38
38
|
demo = make_demo()
|
|
39
|
-
self.assertIs(demo.screen.source, demo.
|
|
39
|
+
self.assertIs(demo.screen.source, demo.rack.pipeline)
|
|
40
40
|
|
|
41
41
|
def test_the_overlay_is_drawn_on_the_screen(self):
|
|
42
42
|
demo = make_demo()
|
|
@@ -68,11 +68,11 @@ class TestModes(unittest.TestCase):
|
|
|
68
68
|
self.assertIs(demo.dvr.source, demo.screen)
|
|
69
69
|
self.assertTrue(demo.screen.composite)
|
|
70
70
|
|
|
71
|
-
def
|
|
71
|
+
def test_filtered_records_the_pipeline_without_the_overlay(self):
|
|
72
72
|
demo = make_demo()
|
|
73
73
|
demo._modeComposite.setChecked(True)
|
|
74
74
|
demo._modeFiltered.setChecked(True)
|
|
75
|
-
self.assertIs(demo.dvr.source, demo.
|
|
75
|
+
self.assertIs(demo.dvr.source, demo.rack.pipeline)
|
|
76
76
|
self.assertFalse(demo.screen.composite)
|
|
77
77
|
|
|
78
78
|
def test_display_records_the_screen_without_the_overlay(self):
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
'''Unit tests for FilterCode, VideoFilter.to_code, and
|
|
1
|
+
'''Unit tests for FilterCode, VideoFilter.to_code, and QFilterRackWidget.exportPipeline.'''
|
|
2
2
|
import unittest
|
|
3
3
|
from unittest.mock import patch
|
|
4
4
|
from qtpy import QtCore, QtWidgets
|
|
5
5
|
from QVideo.lib.QVideoFilter import FilterCode, VideoFilter, QVideoFilter
|
|
6
|
-
from QVideo.lib.
|
|
6
|
+
from QVideo.lib.QFilterRackWidget import QFilterRackWidget
|
|
7
7
|
from QVideo.filters.smoothing import SmoothingFilter
|
|
8
8
|
from QVideo.filters.threshold import ThresholdFilter
|
|
9
9
|
from QVideo.filters.edge import EdgeFilter
|
|
@@ -16,8 +16,8 @@ from QVideo.filters.rgb import RGBFilter
|
|
|
16
16
|
app = QtWidgets.QApplication.instance() or QtWidgets.QApplication([])
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
def make_rack() ->
|
|
20
|
-
return
|
|
19
|
+
def make_rack() -> QFilterRackWidget:
|
|
20
|
+
return QFilterRackWidget(parent=None)
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
class TestFilterCode(unittest.TestCase):
|