QVideo 4.3.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.3.0 → qvideo-4.5.0}/PKG-INFO +2 -2
- {qvideo-4.3.0 → qvideo-4.5.0}/QCamcorder.py +3 -12
- {qvideo-4.3.0 → qvideo-4.5.0}/QVideo.egg-info/PKG-INFO +2 -2
- {qvideo-4.3.0 → qvideo-4.5.0}/QVideo.egg-info/SOURCES.txt +9 -4
- {qvideo-4.3.0 → qvideo-4.5.0}/README.md +1 -1
- {qvideo-4.3.0 → qvideo-4.5.0}/demos/ROIdemo.py +2 -16
- {qvideo-4.3.0 → qvideo-4.5.0}/demos/__init__.py +9 -2
- {qvideo-4.3.0 → qvideo-4.5.0}/demos/circulardemo.py +2 -18
- qvideo-4.5.0/demos/combineddemo.py +97 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/demos/compositedemo.py +2 -23
- {qvideo-4.3.0 → qvideo-4.5.0}/demos/demo.py +2 -18
- {qvideo-4.3.0 → qvideo-4.5.0}/demos/filterdemo.py +13 -29
- {qvideo-4.3.0 → qvideo-4.5.0}/demos/filterrackdemo.py +17 -34
- {qvideo-4.3.0 → qvideo-4.5.0}/demos/histogramdemo.py +2 -18
- {qvideo-4.3.0 → qvideo-4.5.0}/demos/trackpydemo.py +2 -23
- {qvideo-4.3.0 → qvideo-4.5.0}/demos/uniformitydemo.py +2 -18
- {qvideo-4.3.0 → qvideo-4.5.0}/demos/yolodemo.py +2 -23
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/circletransform.py +1 -1
- qvideo-4.3.0/lib/QFilterStack.py → qvideo-4.5.0/lib/QFilterPipeline.py +16 -16
- qvideo-4.5.0/lib/QFilterRack.py +63 -0
- qvideo-4.3.0/lib/QFilterRack.py → qvideo-4.5.0/lib/QFilterRackWidget.py +12 -8
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/QVideoFilter.py +3 -3
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/QVideoScreen.py +1 -1
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/__init__.py +12 -10
- qvideo-4.5.0/lib/_launch.py +50 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/pyproject.toml +1 -1
- qvideo-4.5.0/tests/test_combineddemo.py +94 -0
- qvideo-4.5.0/tests/test_docs_quickstart.py +53 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_filter_export.py +4 -4
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_filterdemo.py +12 -12
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_filterrackdemo.py +18 -18
- qvideo-4.5.0/tests/test_launch.py +97 -0
- qvideo-4.3.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.3.0/tests/test_qfilterrack.py → qvideo-4.5.0/tests/test_qfilterrackwidget.py +27 -26
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qvideoscreen.py +1 -1
- qvideo-4.3.0/lib/QFPSMeter.py +0 -92
- qvideo-4.3.0/tests/test_qfpsmeter.py +0 -217
- {qvideo-4.3.0 → qvideo-4.5.0}/LICENSE.md +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/QVideo.egg-info/dependency_links.txt +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/QVideo.egg-info/requires.txt +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/QVideo.egg-info/top_level.txt +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/__main__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Basler/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Basler/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Basler/_tree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Flir/QListFlirCameras.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Flir/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Flir/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Flir/_tree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Genicam/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Genicam/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Genicam/_tree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/IDS/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/IDS/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/IDS/_tree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/MV/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/MV/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/MV/_tree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Noise/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Noise/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Noise/_tree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/OpenCV/QListCVCameras.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/OpenCV/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/OpenCV/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/OpenCV/_devices.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/OpenCV/_tree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Picamera/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Picamera/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Picamera/_imx500.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Picamera/_tree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Vimbax/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Vimbax/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/Vimbax/_tree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/cameras/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/dvr/QCircularBuffer.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/dvr/QCircularDVRWidget.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/dvr/QDVRWidget.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/dvr/QHDF5Reader.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/dvr/QHDF5Writer.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/dvr/QOpenCVReader.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/dvr/QOpenCVWriter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/dvr/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/dvr/icons_rc.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/_MedianBase.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/artistic.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/blob.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/darkframe.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/dejitter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/dog.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/edge.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/exposure.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/flatfield.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/foreground.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/gamma.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/invert.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/laplacian.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/median.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/momean.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/momedian.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/normalize.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/rgb.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/roi.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/samplehold.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/smoothing.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/sobel.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/threshold.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/filters/unsharp.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/QCamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/QCameraTree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/QFrameRelay.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/QHistogramWidget.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/QListCameras.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/QSnapshot.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/QUniformityWidget.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/QVideoReader.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/QVideoSource.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/QVideoWriter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/_jupyter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/_qabc.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/chooser.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/clickable.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/errors.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/gentl.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/imageops.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/lib/videotypes.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/overlays/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/overlays/trackpy.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/overlays/yolo.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/setup.cfg +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_artistic.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_blob.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_chooser.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_circletransform.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_circularbuffer.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_circulardemo.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_circulardvrwidget.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_clickable.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_compositedemo.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_darkframe.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_dejitter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_demo.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_dog.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_edge.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_exposure.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_filters_gray.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_flatfield.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_foreground.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_gamma.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_gentl.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_histogramdemo.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_histogramwidget.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_icons_rc.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_imageops.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_invert.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_jupyter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_laplacian.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_median.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_momean.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_momedian.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_normalize.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_overlays_package.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qabc.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qbaslercamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qcamcorder.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qcamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qcameratree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qdvrwidget.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qflircamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qframerelay.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qgenicamcamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qgenicamtree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qhdf5reader.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qhdf5writer.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qidscamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qimxcamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qlistcameras.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qlistcvcameras.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qlistflircameras.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qmvcamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qnoisecamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qnoisetree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qopencvcamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qopencvdevices.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qopencvreader.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qopencvtree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qopencvwriter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qpicamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qpicameratree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qsnapshot.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qt_binding.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qvideoreader.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qvideosource.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qvideowriter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_qvimbaxcamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_resolutions.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_rgb.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_roi.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_roidemo.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_samplehold.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_smoothing.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_sobel.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_threshold.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_trackpy_overlay.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_trackpydemo.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_uniformitydemo.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_uniformitywidget.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_unsharp.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_vendor_trees.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_videofilter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_videotypes.py +0 -0
- {qvideo-4.3.0 → qvideo-4.5.0}/tests/test_yolo_overlay.py +0 -0
- {qvideo-4.3.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
|
|
@@ -24,7 +24,8 @@ If no flag is given, a noise camera is used as a fallback.
|
|
|
24
24
|
'''
|
|
25
25
|
|
|
26
26
|
from qtpy import QtCore, QtWidgets, QtGui
|
|
27
|
-
from QVideo.lib import QCameraTree, QVideoSource, QVideoScreen, QSnapshot
|
|
27
|
+
from QVideo.lib import (QCameraTree, QVideoSource, QVideoScreen, QSnapshot,
|
|
28
|
+
launch)
|
|
28
29
|
from QVideo.dvr import QDVRWidget
|
|
29
30
|
|
|
30
31
|
|
|
@@ -128,17 +129,7 @@ class QCamcorder(QtWidgets.QWidget):
|
|
|
128
129
|
|
|
129
130
|
def main() -> None: # pragma: no cover
|
|
130
131
|
'''Launch the camcorder with an interactively chosen camera.'''
|
|
131
|
-
|
|
132
|
-
from QVideo.lib import choose_camera
|
|
133
|
-
|
|
134
|
-
app = pg.mkQApp('QCamcorder')
|
|
135
|
-
camera = choose_camera()
|
|
136
|
-
widget = QCamcorder(camera.start())
|
|
137
|
-
QtWidgets.QShortcut(
|
|
138
|
-
QtGui.QKeySequence('Ctrl+Q'), widget
|
|
139
|
-
).activated.connect(app.quit)
|
|
140
|
-
widget.show()
|
|
141
|
-
pg.exec()
|
|
132
|
+
launch(QCamcorder, 'QCamcorder')
|
|
142
133
|
|
|
143
134
|
|
|
144
135
|
if __name__ == '__main__':
|
|
@@ -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
|
|
@@ -47,6 +47,7 @@ cameras/Vimbax/_tree.py
|
|
|
47
47
|
demos/ROIdemo.py
|
|
48
48
|
demos/__init__.py
|
|
49
49
|
demos/circulardemo.py
|
|
50
|
+
demos/combineddemo.py
|
|
50
51
|
demos/compositedemo.py
|
|
51
52
|
demos/demo.py
|
|
52
53
|
demos/filterdemo.py
|
|
@@ -92,9 +93,9 @@ filters/threshold.py
|
|
|
92
93
|
filters/unsharp.py
|
|
93
94
|
lib/QCamera.py
|
|
94
95
|
lib/QCameraTree.py
|
|
95
|
-
lib/
|
|
96
|
+
lib/QFilterPipeline.py
|
|
96
97
|
lib/QFilterRack.py
|
|
97
|
-
lib/
|
|
98
|
+
lib/QFilterRackWidget.py
|
|
98
99
|
lib/QFrameRelay.py
|
|
99
100
|
lib/QHistogramWidget.py
|
|
100
101
|
lib/QListCameras.py
|
|
@@ -108,6 +109,7 @@ lib/QVideoWriter.py
|
|
|
108
109
|
lib/__init__.py
|
|
109
110
|
lib/_camera.py
|
|
110
111
|
lib/_jupyter.py
|
|
112
|
+
lib/_launch.py
|
|
111
113
|
lib/_qabc.py
|
|
112
114
|
lib/chooser.py
|
|
113
115
|
lib/clickable.py
|
|
@@ -127,10 +129,12 @@ tests/test_circularbuffer.py
|
|
|
127
129
|
tests/test_circulardemo.py
|
|
128
130
|
tests/test_circulardvrwidget.py
|
|
129
131
|
tests/test_clickable.py
|
|
132
|
+
tests/test_combineddemo.py
|
|
130
133
|
tests/test_compositedemo.py
|
|
131
134
|
tests/test_darkframe.py
|
|
132
135
|
tests/test_dejitter.py
|
|
133
136
|
tests/test_demo.py
|
|
137
|
+
tests/test_docs_quickstart.py
|
|
134
138
|
tests/test_dog.py
|
|
135
139
|
tests/test_edge.py
|
|
136
140
|
tests/test_exposure.py
|
|
@@ -149,6 +153,7 @@ tests/test_imageops.py
|
|
|
149
153
|
tests/test_invert.py
|
|
150
154
|
tests/test_jupyter.py
|
|
151
155
|
tests/test_laplacian.py
|
|
156
|
+
tests/test_launch.py
|
|
152
157
|
tests/test_median.py
|
|
153
158
|
tests/test_momean.py
|
|
154
159
|
tests/test_momedian.py
|
|
@@ -160,10 +165,10 @@ tests/test_qcamcorder.py
|
|
|
160
165
|
tests/test_qcamera.py
|
|
161
166
|
tests/test_qcameratree.py
|
|
162
167
|
tests/test_qdvrwidget.py
|
|
168
|
+
tests/test_qfilterpipeline.py
|
|
163
169
|
tests/test_qfilterrack.py
|
|
164
|
-
tests/
|
|
170
|
+
tests/test_qfilterrackwidget.py
|
|
165
171
|
tests/test_qflircamera.py
|
|
166
|
-
tests/test_qfpsmeter.py
|
|
167
172
|
tests/test_qframerelay.py
|
|
168
173
|
tests/test_qgenicamcamera.py
|
|
169
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
|
|
@@ -11,6 +11,7 @@ import pyqtgraph as pg
|
|
|
11
11
|
import numpy as np
|
|
12
12
|
from pathlib import Path
|
|
13
13
|
from QVideo.QCamcorder import QCamcorder
|
|
14
|
+
from QVideo.lib import launch
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
__all__ = ['ROIFilter', 'ROIDemo']
|
|
@@ -153,20 +154,5 @@ class ROIDemo(QCamcorder):
|
|
|
153
154
|
self.source.newFrame.disconnect(self.roi.crop)
|
|
154
155
|
|
|
155
156
|
|
|
156
|
-
def main() -> None: # pragma: no cover
|
|
157
|
-
'''Launch the ROI demo with an interactively chosen camera.'''
|
|
158
|
-
from QVideo.lib import choose_camera
|
|
159
|
-
|
|
160
|
-
from qtpy import QtGui, QtWidgets
|
|
161
|
-
app = pg.mkQApp('ROI Demo')
|
|
162
|
-
camera = choose_camera().start()
|
|
163
|
-
widget = ROIDemo(camera)
|
|
164
|
-
QtWidgets.QShortcut(
|
|
165
|
-
QtGui.QKeySequence('Ctrl+Q'), widget
|
|
166
|
-
).activated.connect(app.quit)
|
|
167
|
-
widget.show()
|
|
168
|
-
pg.exec()
|
|
169
|
-
|
|
170
|
-
|
|
171
157
|
if __name__ == '__main__': # pragma: no cover
|
|
172
|
-
|
|
158
|
+
launch(ROIDemo, 'ROI Demo')
|
|
@@ -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
|
|
|
@@ -62,6 +61,12 @@ compositedemo
|
|
|
62
61
|
and a "Composite" checkbox. When checked, the DVR records the rendered
|
|
63
62
|
scene (video + overlay markers) instead of raw camera frames.
|
|
64
63
|
|
|
64
|
+
combineddemo
|
|
65
|
+
Extends :mod:`filterrackdemo` with a trackpy overlay that locates
|
|
66
|
+
particles in the filtered video, and a fourth recording mode that saves
|
|
67
|
+
the rendered scene. It is a recipe for an application that combines
|
|
68
|
+
filters, an overlay and composite recording.
|
|
69
|
+
|
|
65
70
|
Running
|
|
66
71
|
-------
|
|
67
72
|
Each demo can be launched directly::
|
|
@@ -76,6 +81,7 @@ Each demo can be launched directly::
|
|
|
76
81
|
python -m QVideo.demos.trackpydemo
|
|
77
82
|
python -m QVideo.demos.yolodemo
|
|
78
83
|
python -m QVideo.demos.compositedemo
|
|
84
|
+
python -m QVideo.demos.combineddemo
|
|
79
85
|
|
|
80
86
|
Camera selection
|
|
81
87
|
----------------
|
|
@@ -113,4 +119,5 @@ from .ROIdemo import ROIFilter, ROIDemo
|
|
|
113
119
|
from .trackpydemo import TrackpyDemo
|
|
114
120
|
from .yolodemo import YoloDemo
|
|
115
121
|
from .compositedemo import CompositeDemo
|
|
122
|
+
from .combineddemo import CombinedDemo
|
|
116
123
|
|
|
@@ -7,7 +7,7 @@ Run directly::
|
|
|
7
7
|
'''
|
|
8
8
|
|
|
9
9
|
from QVideo.demos.demo import Demo
|
|
10
|
-
from QVideo.lib import QCameraTree
|
|
10
|
+
from QVideo.lib import QCameraTree, launch
|
|
11
11
|
from QVideo.dvr import QCircularDVRWidget
|
|
12
12
|
|
|
13
13
|
|
|
@@ -38,21 +38,5 @@ class CircularDemo(Demo):
|
|
|
38
38
|
self._controls.addWidget(self.dvr)
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
def main() -> None: # pragma: no cover
|
|
42
|
-
'''Launch the circular buffer demo with an interactively chosen camera.'''
|
|
43
|
-
import pyqtgraph as pg
|
|
44
|
-
from QVideo.lib import choose_camera
|
|
45
|
-
|
|
46
|
-
from qtpy import QtGui, QtWidgets
|
|
47
|
-
app = pg.mkQApp('Circular Buffer Demo')
|
|
48
|
-
camera = choose_camera().start()
|
|
49
|
-
widget = CircularDemo(camera)
|
|
50
|
-
QtWidgets.QShortcut(
|
|
51
|
-
QtGui.QKeySequence('Ctrl+Q'), widget
|
|
52
|
-
).activated.connect(app.quit)
|
|
53
|
-
widget.show()
|
|
54
|
-
pg.exec()
|
|
55
|
-
|
|
56
|
-
|
|
57
41
|
if __name__ == '__main__': # pragma: no cover
|
|
58
|
-
|
|
42
|
+
launch(CircularDemo, 'Circular Buffer Demo')
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
'''Camcorder that combines filters, a detection overlay and composite
|
|
3
|
+
recording.
|
|
4
|
+
|
|
5
|
+
Run directly::
|
|
6
|
+
|
|
7
|
+
python -m QVideo.demos.combineddemo
|
|
8
|
+
|
|
9
|
+
This demo is a recipe for an application that uses several extensions at
|
|
10
|
+
once. It adds one extension at a time to the demo before it, and each
|
|
11
|
+
step is a short method of its own:
|
|
12
|
+
|
|
13
|
+
1. :class:`~QVideo.QCamcorder.QCamcorder` supplies the screen, the camera
|
|
14
|
+
controls and the recorder.
|
|
15
|
+
2. :class:`~QVideo.demos.filterrackdemo.FilterRackDemo` adds a filter
|
|
16
|
+
pipeline: ``camera -> pipeline -> screen``.
|
|
17
|
+
3. :meth:`CombinedDemo._setupOverlay` adds the trackpy overlay. It
|
|
18
|
+
detects particles in the frames of the pipeline, so it sees what the
|
|
19
|
+
screen shows.
|
|
20
|
+
4. :meth:`CombinedDemo._setupCompositeMode` adds a recording mode that
|
|
21
|
+
saves the rendered scene: the filtered video with the particle
|
|
22
|
+
markers drawn on it.
|
|
23
|
+
|
|
24
|
+
Data flow::
|
|
25
|
+
|
|
26
|
+
camera -> filter pipeline -> screen (+ trackpy markers)
|
|
27
|
+
| |
|
|
28
|
+
| +--> recorder, in Display or Composite mode
|
|
29
|
+
+--> trackpy detection
|
|
30
|
+
+--> recorder, in Filtered mode
|
|
31
|
+
|
|
32
|
+
Extensions that depend on each other, as the overlay depends on the
|
|
33
|
+
pipeline here, are combined by application code like this and not by the
|
|
34
|
+
framework, because only the application knows which stream each one needs.
|
|
35
|
+
'''
|
|
36
|
+
|
|
37
|
+
from qtpy import QtWidgets
|
|
38
|
+
from QVideo.demos.filterrackdemo import FilterRackDemo
|
|
39
|
+
from QVideo.lib import QCameraTree, launch
|
|
40
|
+
from QVideo.overlays import QTrackpyWidget
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
__all__ = ['CombinedDemo']
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class CombinedDemo(FilterRackDemo):
|
|
47
|
+
'''Camcorder with a filter rack, a trackpy overlay and four recording
|
|
48
|
+
modes.
|
|
49
|
+
|
|
50
|
+
Extends :class:`~QVideo.demos.filterrackdemo.FilterRackDemo` with a
|
|
51
|
+
:class:`~QVideo.overlays.trackpy.QTrackpyWidget` that locates
|
|
52
|
+
particles in the filtered video, and a **Composite** recording mode
|
|
53
|
+
in which the recorder saves the rendered scene (filtered video plus
|
|
54
|
+
particle markers).
|
|
55
|
+
|
|
56
|
+
Parameters
|
|
57
|
+
----------
|
|
58
|
+
cameraWidget : QCameraTree
|
|
59
|
+
Camera control tree providing the video source.
|
|
60
|
+
**kwargs :
|
|
61
|
+
Additional keyword arguments forwarded to
|
|
62
|
+
:class:`~QVideo.demos.filterrackdemo.FilterRackDemo`.
|
|
63
|
+
'''
|
|
64
|
+
|
|
65
|
+
def __init__(self, cameraWidget: QCameraTree, **kwargs) -> None:
|
|
66
|
+
super().__init__(cameraWidget, **kwargs)
|
|
67
|
+
self._setupOverlay()
|
|
68
|
+
self._setupCompositeMode()
|
|
69
|
+
|
|
70
|
+
def _setupOverlay(self) -> None:
|
|
71
|
+
'''Detect particles in the filtered stream and mark them on the
|
|
72
|
+
screen.'''
|
|
73
|
+
self.trackpy = QTrackpyWidget(self)
|
|
74
|
+
self.trackpy.source = self.rack.pipeline
|
|
75
|
+
self.screen.addOverlay(self.trackpy.overlay)
|
|
76
|
+
self.controls.layout().addWidget(self.trackpy)
|
|
77
|
+
|
|
78
|
+
def _setupCompositeMode(self) -> None:
|
|
79
|
+
'''Add the recording mode that saves the rendered scene.'''
|
|
80
|
+
self._modeComposite = QtWidgets.QRadioButton('Composite')
|
|
81
|
+
self._modeBox.layout().addWidget(self._modeComposite)
|
|
82
|
+
self._modeGroup.addButton(self._modeComposite)
|
|
83
|
+
|
|
84
|
+
def _onModeToggled(self,
|
|
85
|
+
button: QtWidgets.QAbstractButton,
|
|
86
|
+
checked: bool) -> None:
|
|
87
|
+
'''Record the rendered scene in Composite mode, and the usual
|
|
88
|
+
stream in the other modes.'''
|
|
89
|
+
if checked:
|
|
90
|
+
self.screen.composite = button is self._modeComposite
|
|
91
|
+
super()._onModeToggled(button, checked)
|
|
92
|
+
if checked and button is self._modeComposite:
|
|
93
|
+
self.dvr.source = self.screen
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
if __name__ == '__main__': # pragma: no cover
|
|
97
|
+
launch(CombinedDemo, 'Combined Demo')
|
|
@@ -12,7 +12,7 @@ camera frames.
|
|
|
12
12
|
|
|
13
13
|
from qtpy import QtCore, QtWidgets
|
|
14
14
|
from QVideo.QCamcorder import QCamcorder
|
|
15
|
-
from QVideo.lib import QCameraTree
|
|
15
|
+
from QVideo.lib import QCameraTree, launch
|
|
16
16
|
from QVideo.overlays import QTrackpyWidget
|
|
17
17
|
|
|
18
18
|
|
|
@@ -65,26 +65,5 @@ class CompositeDemo(QCamcorder):
|
|
|
65
65
|
self.dvr.source = self.screen if checked else self.source
|
|
66
66
|
|
|
67
67
|
|
|
68
|
-
def main() -> None: # pragma: no cover
|
|
69
|
-
'''Launch the composite demo with an interactively chosen camera.'''
|
|
70
|
-
import sys
|
|
71
|
-
import pyqtgraph as pg
|
|
72
|
-
from QVideo.lib import choose_camera
|
|
73
|
-
|
|
74
|
-
from qtpy import QtGui
|
|
75
|
-
app = pg.mkQApp()
|
|
76
|
-
camera = choose_camera().start()
|
|
77
|
-
try:
|
|
78
|
-
widget = CompositeDemo(camera)
|
|
79
|
-
except ImportError as e:
|
|
80
|
-
print(f'Error: {e}', file=sys.stderr)
|
|
81
|
-
sys.exit(1)
|
|
82
|
-
QtWidgets.QShortcut(
|
|
83
|
-
QtGui.QKeySequence('Ctrl+Q'), widget
|
|
84
|
-
).activated.connect(app.quit)
|
|
85
|
-
widget.show()
|
|
86
|
-
pg.exec()
|
|
87
|
-
|
|
88
|
-
|
|
89
68
|
if __name__ == '__main__': # pragma: no cover
|
|
90
|
-
|
|
69
|
+
launch(CompositeDemo, 'Composite Demo')
|
|
@@ -7,7 +7,7 @@ Run directly::
|
|
|
7
7
|
'''
|
|
8
8
|
|
|
9
9
|
from qtpy import QtWidgets
|
|
10
|
-
from QVideo.lib import QVideoScreen, QCameraTree
|
|
10
|
+
from QVideo.lib import QVideoScreen, QCameraTree, launch
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
__all__ = ['Demo']
|
|
@@ -47,21 +47,5 @@ class Demo(QtWidgets.QWidget):
|
|
|
47
47
|
self._controls.addWidget(self.cameraTree)
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
def main() -> None: # pragma: no cover
|
|
51
|
-
'''Launch the demo with an interactively chosen camera.'''
|
|
52
|
-
import pyqtgraph as pg
|
|
53
|
-
from QVideo.lib import choose_camera
|
|
54
|
-
|
|
55
|
-
from qtpy import QtGui, QtWidgets
|
|
56
|
-
app = pg.mkQApp('QVideo Demo')
|
|
57
|
-
camera = choose_camera().start()
|
|
58
|
-
widget = Demo(camera)
|
|
59
|
-
QtWidgets.QShortcut(
|
|
60
|
-
QtGui.QKeySequence('Ctrl+Q'), widget
|
|
61
|
-
).activated.connect(app.quit)
|
|
62
|
-
widget.show()
|
|
63
|
-
pg.exec()
|
|
64
|
-
|
|
65
|
-
|
|
66
50
|
if __name__ == '__main__': # pragma: no cover
|
|
67
|
-
|
|
51
|
+
launch(Demo, 'QVideo Demo')
|
|
@@ -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,35 +43,19 @@ 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
|
|
|
58
|
-
def main() -> None: # pragma: no cover
|
|
59
|
-
'''Launch the filter demo with an interactively chosen camera.'''
|
|
60
|
-
import pyqtgraph as pg
|
|
61
|
-
from QVideo.lib import choose_camera
|
|
62
|
-
|
|
63
|
-
from qtpy import QtGui, QtWidgets
|
|
64
|
-
app = pg.mkQApp('Filter Demo')
|
|
65
|
-
camera = choose_camera().start()
|
|
66
|
-
filters = ['Color Channel', 'Smoothing', 'Sample and Hold',
|
|
67
|
-
'Threshold', 'Blob', 'Canny']
|
|
68
|
-
widget = FilterDemo(camera, filters)
|
|
69
|
-
QtWidgets.QShortcut(
|
|
70
|
-
QtGui.QKeySequence('Ctrl+Q'), widget
|
|
71
|
-
).activated.connect(app.quit)
|
|
72
|
-
widget.show()
|
|
73
|
-
pg.exec()
|
|
74
|
-
|
|
75
|
-
|
|
76
58
|
if __name__ == '__main__': # pragma: no cover
|
|
77
|
-
|
|
59
|
+
launch(FilterDemo, 'Filter Demo',
|
|
60
|
+
filters=['Color Channel', 'Smoothing', 'Sample and Hold',
|
|
61
|
+
'Threshold', 'Blob', 'Canny'])
|
|
@@ -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,26 +131,10 @@ 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
|
|
|
139
138
|
|
|
140
|
-
def main() -> None: # pragma: no cover
|
|
141
|
-
'''Launch the filter rack demo with an interactively chosen camera.'''
|
|
142
|
-
import pyqtgraph as pg
|
|
143
|
-
from QVideo.lib import choose_camera
|
|
144
|
-
|
|
145
|
-
from qtpy import QtGui
|
|
146
|
-
app = pg.mkQApp('Filter Rack Demo')
|
|
147
|
-
camera = choose_camera().start()
|
|
148
|
-
widget = FilterRackDemo(camera)
|
|
149
|
-
QtWidgets.QShortcut(
|
|
150
|
-
QtGui.QKeySequence('Ctrl+Q'), widget
|
|
151
|
-
).activated.connect(app.quit)
|
|
152
|
-
widget.show()
|
|
153
|
-
pg.exec()
|
|
154
|
-
|
|
155
|
-
|
|
156
139
|
if __name__ == '__main__': # pragma: no cover
|
|
157
|
-
|
|
140
|
+
launch(FilterRackDemo, 'Filter Rack Demo')
|
|
@@ -7,7 +7,7 @@ Run directly::
|
|
|
7
7
|
'''
|
|
8
8
|
|
|
9
9
|
from QVideo.demos.demo import Demo
|
|
10
|
-
from QVideo.lib import QCameraTree, QHistogramWidget
|
|
10
|
+
from QVideo.lib import QCameraTree, QHistogramWidget, launch
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
__all__ = ['HistogramDemo']
|
|
@@ -37,21 +37,5 @@ class HistogramDemo(Demo):
|
|
|
37
37
|
self._controls.addWidget(self.histogram)
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
def main() -> None: # pragma: no cover
|
|
41
|
-
'''Launch the histogram demo with an interactively chosen camera.'''
|
|
42
|
-
import pyqtgraph as pg
|
|
43
|
-
from QVideo.lib import choose_camera
|
|
44
|
-
|
|
45
|
-
from qtpy import QtGui, QtWidgets
|
|
46
|
-
app = pg.mkQApp('Histogram Demo')
|
|
47
|
-
camera = choose_camera().start()
|
|
48
|
-
widget = HistogramDemo(camera)
|
|
49
|
-
QtWidgets.QShortcut(
|
|
50
|
-
QtGui.QKeySequence('Ctrl+Q'), widget
|
|
51
|
-
).activated.connect(app.quit)
|
|
52
|
-
widget.show()
|
|
53
|
-
pg.exec()
|
|
54
|
-
|
|
55
|
-
|
|
56
40
|
if __name__ == '__main__': # pragma: no cover
|
|
57
|
-
|
|
41
|
+
launch(HistogramDemo, 'Histogram Demo')
|
|
@@ -9,7 +9,7 @@ See :mod:`QVideo.overlays.trackpy` for literature references.
|
|
|
9
9
|
'''
|
|
10
10
|
|
|
11
11
|
from QVideo.demos.demo import Demo
|
|
12
|
-
from QVideo.lib import QCameraTree
|
|
12
|
+
from QVideo.lib import QCameraTree, launch
|
|
13
13
|
from QVideo.overlays import QTrackpyWidget
|
|
14
14
|
|
|
15
15
|
|
|
@@ -39,26 +39,5 @@ class TrackpyDemo(Demo):
|
|
|
39
39
|
self._controls.addWidget(self.trackpy)
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
def main() -> None: # pragma: no cover
|
|
43
|
-
'''Launch the trackpy demo with an interactively chosen camera.'''
|
|
44
|
-
import sys
|
|
45
|
-
import pyqtgraph as pg
|
|
46
|
-
from QVideo.lib import choose_camera
|
|
47
|
-
|
|
48
|
-
from qtpy import QtGui, QtWidgets
|
|
49
|
-
app = pg.mkQApp()
|
|
50
|
-
camera = choose_camera().start()
|
|
51
|
-
try:
|
|
52
|
-
widget = TrackpyDemo(camera)
|
|
53
|
-
except ImportError as e:
|
|
54
|
-
print(f'Error: {e}', file=sys.stderr)
|
|
55
|
-
sys.exit(1)
|
|
56
|
-
QtWidgets.QShortcut(
|
|
57
|
-
QtGui.QKeySequence('Ctrl+Q'), widget
|
|
58
|
-
).activated.connect(app.quit)
|
|
59
|
-
widget.show()
|
|
60
|
-
pg.exec()
|
|
61
|
-
|
|
62
|
-
|
|
63
42
|
if __name__ == '__main__': # pragma: no cover
|
|
64
|
-
|
|
43
|
+
launch(TrackpyDemo, 'Trackpy Demo')
|