6if sys.version_info >= (3, 11):
7 from PySide6.QtCore
import QObject, QUrl
8 from PySide6.QtQml
import qmlRegisterType
9 from PySide6.QtWidgets
import QApplication, QWidget
10 from PySide6.QtQuick
import QQuickView, QQuickPaintedItem
11 from PySide6.QtGui
import QIcon
13 from PySide2.QtCore
import QObject, QUrl
14 from PySide2.QtQml
import qmlRegisterType
15 from PySide2.QtWidgets
import QApplication, QWidget
16 from PySide2.QtQuick
import QQuickView, QQuickPaintedItem
17 from PySide2.QtGui
import QIcon
21if __name__ ==
"__main__":
23 app = QApplication([])
24 app.setOrganizationName(
'STEMMER IMAGING')
25 app.setOrganizationDomain(
'https://www.stemmer-imaging.com/')
26 app.setApplicationName(
'Display Python tutorial')
29 if sys.platform ==
'win32':
31 myappid =
u'stemmerimaging.commonvisionblox.pystreamdisplay.0'
32 ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
34 script_dir = os.path.dirname(os.path.realpath(__file__))
35 icon_path = os.path.join(script_dir,
'Tutorial-Python_32x32.png')
36 app.setWindowIcon(QIcon(icon_path))
41 cvb.AcquisitionStack.Vin)
54 view.setResizeMode(QQuickView.SizeRootObjectToView)
55 context = view.rootContext()
56 context.setContextProperty(
"mainImage", image_controller)
57 filepath = os.path.dirname(os.path.realpath(__file__))
58 view.setSource(QUrl.fromLocalFile(os.path.join(filepath,
"main.qml")))
64 image_controller.refresh(device.device_image, cvb.ui.AutoRefresh.On)
Union[cvb.GenICamDevice, cvb.VinDevice, cvb.EmuDevice, cvb.VideoDevice, cvb.NonStreamingDevice] open(str provider, int acquisition_stack=cvb.AcquisitionStack.PreferVin)
Opens a device with the given provider and acquisition stack.
Definition: __init__.py:1570
Handler object for a single stream.
Definition: __init__.py:5398
Controller object for the QML image view item.
Definition: __init__.py:14
None register(cls, str uri="CvbQuick", int version_major=1, int version_minor=0, str qml_name="ImageView")
Convenience method to register this type or a derived type in QML.
Definition: __init__.py:196
Common Vision Blox UI module for Python.
Definition: __init__.py:1
str install_path()
Directory Common Vision Blox has been installed to.
Definition: __init__.py:8257