QVideo 4.3.0__tar.gz → 4.4.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.4.0}/PKG-INFO +1 -1
- {qvideo-4.3.0 → qvideo-4.4.0}/QCamcorder.py +3 -12
- {qvideo-4.3.0 → qvideo-4.4.0}/QVideo.egg-info/PKG-INFO +1 -1
- {qvideo-4.3.0 → qvideo-4.4.0}/QVideo.egg-info/SOURCES.txt +5 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/demos/ROIdemo.py +2 -16
- {qvideo-4.3.0 → qvideo-4.4.0}/demos/__init__.py +8 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/demos/circulardemo.py +2 -18
- qvideo-4.4.0/demos/combineddemo.py +97 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/demos/compositedemo.py +2 -23
- {qvideo-4.3.0 → qvideo-4.4.0}/demos/demo.py +2 -18
- {qvideo-4.3.0 → qvideo-4.4.0}/demos/filterdemo.py +4 -20
- {qvideo-4.3.0 → qvideo-4.4.0}/demos/filterrackdemo.py +2 -18
- {qvideo-4.3.0 → qvideo-4.4.0}/demos/histogramdemo.py +2 -18
- {qvideo-4.3.0 → qvideo-4.4.0}/demos/trackpydemo.py +2 -23
- {qvideo-4.3.0 → qvideo-4.4.0}/demos/uniformitydemo.py +2 -18
- {qvideo-4.3.0 → qvideo-4.4.0}/demos/yolodemo.py +2 -23
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/__init__.py +2 -1
- qvideo-4.4.0/lib/_launch.py +50 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/pyproject.toml +1 -1
- qvideo-4.4.0/tests/test_combineddemo.py +94 -0
- qvideo-4.4.0/tests/test_docs_quickstart.py +53 -0
- qvideo-4.4.0/tests/test_launch.py +97 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/LICENSE.md +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/QVideo.egg-info/dependency_links.txt +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/QVideo.egg-info/requires.txt +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/QVideo.egg-info/top_level.txt +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/README.md +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/__main__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Basler/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Basler/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Basler/_tree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Flir/QListFlirCameras.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Flir/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Flir/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Flir/_tree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Genicam/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Genicam/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Genicam/_tree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/IDS/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/IDS/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/IDS/_tree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/MV/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/MV/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/MV/_tree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Noise/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Noise/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Noise/_tree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/OpenCV/QListCVCameras.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/OpenCV/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/OpenCV/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/OpenCV/_devices.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/OpenCV/_tree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Picamera/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Picamera/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Picamera/_imx500.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Picamera/_tree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Vimbax/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Vimbax/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/Vimbax/_tree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/cameras/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/dvr/QCircularBuffer.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/dvr/QCircularDVRWidget.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/dvr/QDVRWidget.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/dvr/QHDF5Reader.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/dvr/QHDF5Writer.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/dvr/QOpenCVReader.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/dvr/QOpenCVWriter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/dvr/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/dvr/icons_rc.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/_MedianBase.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/artistic.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/blob.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/circletransform.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/darkframe.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/dejitter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/dog.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/edge.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/exposure.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/flatfield.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/foreground.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/gamma.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/invert.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/laplacian.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/median.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/momean.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/momedian.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/normalize.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/rgb.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/roi.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/samplehold.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/smoothing.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/sobel.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/threshold.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/filters/unsharp.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/QCamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/QCameraTree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/QFPSMeter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/QFilterRack.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/QFilterStack.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/QFrameRelay.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/QHistogramWidget.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/QListCameras.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/QSnapshot.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/QUniformityWidget.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/QVideoFilter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/QVideoReader.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/QVideoScreen.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/QVideoSource.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/QVideoWriter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/_jupyter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/_qabc.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/chooser.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/clickable.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/errors.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/gentl.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/imageops.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/lib/videotypes.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/overlays/__init__.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/overlays/trackpy.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/overlays/yolo.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/setup.cfg +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_artistic.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_blob.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_camera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_chooser.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_circletransform.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_circularbuffer.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_circulardemo.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_circulardvrwidget.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_clickable.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_compositedemo.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_darkframe.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_dejitter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_demo.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_dog.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_edge.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_exposure.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_filter_export.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_filterdemo.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_filterrackdemo.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_filters_gray.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_flatfield.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_foreground.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_gamma.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_gentl.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_histogramdemo.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_histogramwidget.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_icons_rc.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_imageops.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_invert.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_jupyter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_laplacian.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_median.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_momean.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_momedian.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_normalize.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_overlays_package.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qabc.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qbaslercamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qcamcorder.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qcamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qcameratree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qdvrwidget.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qfilterrack.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qfilterstack.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qflircamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qfpsmeter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qframerelay.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qgenicamcamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qgenicamtree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qhdf5reader.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qhdf5writer.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qidscamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qimxcamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qlistcameras.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qlistcvcameras.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qlistflircameras.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qmvcamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qnoisecamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qnoisetree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qopencvcamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qopencvdevices.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qopencvreader.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qopencvtree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qopencvwriter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qpicamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qpicameratree.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qsnapshot.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qt_binding.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qvideoreader.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qvideoscreen.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qvideosource.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qvideowriter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_qvimbaxcamera.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_resolutions.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_rgb.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_roi.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_roidemo.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_samplehold.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_smoothing.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_sobel.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_threshold.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_trackpy_overlay.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_trackpydemo.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_uniformitydemo.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_uniformitywidget.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_unsharp.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_vendor_trees.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_videofilter.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_videotypes.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_yolo_overlay.py +0 -0
- {qvideo-4.3.0 → qvideo-4.4.0}/tests/test_yolodemo.py +0 -0
|
@@ -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__':
|
|
@@ -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
|
|
@@ -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
|
|
@@ -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')
|
|
@@ -62,6 +62,12 @@ compositedemo
|
|
|
62
62
|
and a "Composite" checkbox. When checked, the DVR records the rendered
|
|
63
63
|
scene (video + overlay markers) instead of raw camera frames.
|
|
64
64
|
|
|
65
|
+
combineddemo
|
|
66
|
+
Extends :mod:`filterrackdemo` with a trackpy overlay that locates
|
|
67
|
+
particles in the filtered video, and a fourth recording mode that saves
|
|
68
|
+
the rendered scene. It is a recipe for an application that combines
|
|
69
|
+
filters, an overlay and composite recording.
|
|
70
|
+
|
|
65
71
|
Running
|
|
66
72
|
-------
|
|
67
73
|
Each demo can be launched directly::
|
|
@@ -76,6 +82,7 @@ Each demo can be launched directly::
|
|
|
76
82
|
python -m QVideo.demos.trackpydemo
|
|
77
83
|
python -m QVideo.demos.yolodemo
|
|
78
84
|
python -m QVideo.demos.compositedemo
|
|
85
|
+
python -m QVideo.demos.combineddemo
|
|
79
86
|
|
|
80
87
|
Camera selection
|
|
81
88
|
----------------
|
|
@@ -113,4 +120,5 @@ from .ROIdemo import ROIFilter, ROIDemo
|
|
|
113
120
|
from .trackpydemo import TrackpyDemo
|
|
114
121
|
from .yolodemo import YoloDemo
|
|
115
122
|
from .compositedemo import CompositeDemo
|
|
123
|
+
from .combineddemo import CombinedDemo
|
|
116
124
|
|
|
@@ -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
|
+
stack: ``camera -> stack -> screen``.
|
|
17
|
+
3. :meth:`CombinedDemo._setupOverlay` adds the trackpy overlay. It
|
|
18
|
+
detects particles in the frames of the stack, 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 stack -> 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
|
+
stack 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.stack
|
|
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, QFilterStack
|
|
11
|
+
from QVideo.lib import QCameraTree, QFilterRack, QFilterStack, launch
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
__all__ = ['FilterDemo']
|
|
@@ -55,23 +55,7 @@ class FilterDemo(Demo):
|
|
|
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'])
|
|
@@ -31,7 +31,7 @@ see each frame exactly once.
|
|
|
31
31
|
|
|
32
32
|
from qtpy import QtCore, QtGui, QtWidgets
|
|
33
33
|
from QVideo.QCamcorder import QCamcorder
|
|
34
|
-
from QVideo.lib import QCameraTree, QFilterRack, QFilterStack
|
|
34
|
+
from QVideo.lib import QCameraTree, QFilterRack, QFilterStack, launch
|
|
35
35
|
from QVideo.filters import QSmoothingFilter, QThresholdFilter
|
|
36
36
|
|
|
37
37
|
|
|
@@ -137,21 +137,5 @@ class FilterRackDemo(QCamcorder):
|
|
|
137
137
|
self.dvr.source = self.screen
|
|
138
138
|
|
|
139
139
|
|
|
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
140
|
if __name__ == '__main__': # pragma: no cover
|
|
157
|
-
|
|
141
|
+
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')
|
|
@@ -7,7 +7,7 @@ Run directly::
|
|
|
7
7
|
'''
|
|
8
8
|
|
|
9
9
|
from QVideo.demos.demo import Demo
|
|
10
|
-
from QVideo.lib import QCameraTree, QUniformityWidget
|
|
10
|
+
from QVideo.lib import QCameraTree, QUniformityWidget, launch
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
__all__ = ['UniformityDemo']
|
|
@@ -39,21 +39,5 @@ class UniformityDemo(Demo):
|
|
|
39
39
|
self._controls.addWidget(self.uniformity)
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
def main() -> None: # pragma: no cover
|
|
43
|
-
'''Launch the uniformity demo with an interactively chosen camera.'''
|
|
44
|
-
import pyqtgraph as pg
|
|
45
|
-
from QVideo.lib import choose_camera
|
|
46
|
-
|
|
47
|
-
from qtpy import QtGui, QtWidgets
|
|
48
|
-
app = pg.mkQApp('Uniformity Demo')
|
|
49
|
-
camera = choose_camera().start()
|
|
50
|
-
widget = UniformityDemo(camera)
|
|
51
|
-
QtWidgets.QShortcut(
|
|
52
|
-
QtGui.QKeySequence('Ctrl+Q'), widget
|
|
53
|
-
).activated.connect(app.quit)
|
|
54
|
-
widget.show()
|
|
55
|
-
pg.exec()
|
|
56
|
-
|
|
57
|
-
|
|
58
42
|
if __name__ == '__main__': # pragma: no cover
|
|
59
|
-
|
|
43
|
+
launch(UniformityDemo, 'Uniformity Demo')
|
|
@@ -9,7 +9,7 @@ See :mod:`QVideo.overlays.yolo` 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 QYoloWidget
|
|
14
14
|
|
|
15
15
|
|
|
@@ -45,26 +45,5 @@ class YoloDemo(Demo):
|
|
|
45
45
|
self._controls.addWidget(self.yolo)
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
def main() -> None: # pragma: no cover
|
|
49
|
-
'''Launch the YOLO demo with an interactively chosen camera.'''
|
|
50
|
-
import sys
|
|
51
|
-
import pyqtgraph as pg
|
|
52
|
-
from QVideo.lib import choose_camera
|
|
53
|
-
|
|
54
|
-
from qtpy import QtGui, QtWidgets
|
|
55
|
-
app = pg.mkQApp()
|
|
56
|
-
camera = choose_camera().start()
|
|
57
|
-
try:
|
|
58
|
-
widget = YoloDemo(camera)
|
|
59
|
-
except ImportError as e:
|
|
60
|
-
print(f'Error: {e}', file=sys.stderr)
|
|
61
|
-
sys.exit(1)
|
|
62
|
-
QtWidgets.QShortcut(
|
|
63
|
-
QtGui.QKeySequence('Ctrl+Q'), widget
|
|
64
|
-
).activated.connect(app.quit)
|
|
65
|
-
widget.show()
|
|
66
|
-
pg.exec()
|
|
67
|
-
|
|
68
|
-
|
|
69
48
|
if __name__ == '__main__': # pragma: no cover
|
|
70
|
-
|
|
49
|
+
launch(YoloDemo, 'YOLO Demo')
|
|
@@ -53,6 +53,7 @@ from .QVideoReader import QVideoReader
|
|
|
53
53
|
from .QVideoWriter import QVideoWriter
|
|
54
54
|
from ._camera import Camera
|
|
55
55
|
from .chooser import choose_camera
|
|
56
|
+
from ._launch import launch
|
|
56
57
|
from .QListCameras import QListCameras
|
|
57
58
|
from .QFPSMeter import QFPSMeter
|
|
58
59
|
from .QHistogramWidget import QHistogramWidget
|
|
@@ -61,7 +62,7 @@ from .QSnapshot import QSnapshot
|
|
|
61
62
|
|
|
62
63
|
__all__ = '''Image
|
|
63
64
|
FrameInfo
|
|
64
|
-
clickable Camera choose_camera QListCameras
|
|
65
|
+
clickable Camera choose_camera launch QListCameras
|
|
65
66
|
QCamera QCameraError QDriverError QDeviceError QVideoSource QCameraTree
|
|
66
67
|
QFilterRack QFilterStack QFrameRelay
|
|
67
68
|
QVideoReader QVideoWriter QVideoScreen
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'''Run a camera application: the startup that every demo shares.'''
|
|
2
|
+
import sys
|
|
3
|
+
import pyqtgraph as pg
|
|
4
|
+
from qtpy import QtGui, QtWidgets
|
|
5
|
+
from QVideo.lib.chooser import choose_camera
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
__all__ = ['launch']
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def launch(widget: type[QtWidgets.QWidget],
|
|
12
|
+
title: str | None = None,
|
|
13
|
+
**kwargs) -> None:
|
|
14
|
+
'''Show *widget* for a camera chosen on the command line, and run it.
|
|
15
|
+
|
|
16
|
+
The camera backend comes from the command-line flags described in
|
|
17
|
+
:func:`~QVideo.lib.chooser.choose_camera` (a noise camera if there are
|
|
18
|
+
none). The window closes on Ctrl+Q. A widget that needs an optional
|
|
19
|
+
package that is not installed ends the program with the error message.
|
|
20
|
+
|
|
21
|
+
Parameters
|
|
22
|
+
----------
|
|
23
|
+
widget : type
|
|
24
|
+
Class of the application window. It is called with the camera
|
|
25
|
+
tree as its first argument, as :class:`~QVideo.demos.demo.Demo` and
|
|
26
|
+
:class:`~QVideo.QCamcorder.QCamcorder` expect.
|
|
27
|
+
title : str, optional
|
|
28
|
+
Name of the application.
|
|
29
|
+
**kwargs :
|
|
30
|
+
Further keyword arguments for *widget*.
|
|
31
|
+
|
|
32
|
+
Examples
|
|
33
|
+
--------
|
|
34
|
+
::
|
|
35
|
+
|
|
36
|
+
from QVideo.lib import launch
|
|
37
|
+
from QVideo.demos import HistogramDemo
|
|
38
|
+
|
|
39
|
+
launch(HistogramDemo, 'Histogram Demo')
|
|
40
|
+
'''
|
|
41
|
+
app = pg.mkQApp(title)
|
|
42
|
+
tree = choose_camera().start()
|
|
43
|
+
try:
|
|
44
|
+
window = widget(tree, **kwargs)
|
|
45
|
+
except ImportError as error:
|
|
46
|
+
sys.exit(f'Error: {error}')
|
|
47
|
+
QtWidgets.QShortcut(
|
|
48
|
+
QtGui.QKeySequence('Ctrl+Q'), window).activated.connect(app.quit)
|
|
49
|
+
window.show()
|
|
50
|
+
pg.exec()
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "QVideo"
|
|
7
|
-
version = "4.
|
|
7
|
+
version = "4.4.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" }
|