Ejemplo n.º 1
0
A GUI that can be used to view live video from two cameras simultaneously.
Also shows off image overlay capabilities: after you've toggled the overlay
button on, click on the main image to gain focus, then use the left and right
arrow keys to switch between overlay images.
"""

import sys
import os.path
from PySide.QtGui import QApplication, QPushButton, QScrollArea, QHBoxLayout
from PySide.QtUiTools import QUiLoader

from instrumental.drivers.cameras import uc480
from instrumental import gui

if __name__ == '__main__':
    cam = uc480.get_camera(serial='4002856484')
    cam.open(num_bufs=2)
    cam.load_stored_parameters(1)

    cam2 = uc480.get_camera(serial='4002862589')
    cam2.open(num_bufs=2)
    cam2.load_stored_parameters(1)

    loader = QUiLoader()
    app = QApplication(sys.argv)
    ui = loader.load('live_gui.ui')

    scrollarea = ui.findChild(QScrollArea, 'scrollArea')
    camview = gui.DrawableCameraView(cam)
    scrollarea.setWidget(camview)
Ejemplo n.º 2
0
Also shows off image overlay capabilities: after you've toggled the overlay
button on, click on the main image to gain focus, then use the left and right
arrow keys to switch between overlay images.
"""

import sys
import os.path
from PySide.QtGui import QApplication, QPushButton, QScrollArea, QHBoxLayout
from PySide.QtUiTools import QUiLoader

from instrumental.drivers.cameras import uc480
from instrumental import gui


if __name__ == '__main__':
    cam = uc480.get_camera(serial='4002856484')
    cam.open(num_bufs=2)
    cam.load_stored_parameters(1)

    cam2 = uc480.get_camera(serial='4002862589')
    cam2.open(num_bufs=2)
    cam2.load_stored_parameters(1)

    loader = QUiLoader()
    app = QApplication(sys.argv)
    ui = loader.load('live_gui.ui')

    scrollarea = ui.findChild(QScrollArea, 'scrollArea')
    camview = gui.DrawableCameraView(cam)
    scrollarea.setWidget(camview)
Ejemplo n.º 3
0
"""
A simple GUI that can grab snapshots from a uc480 camera plugged
into the local machine. Cameras currently only support Windows.
"""

import sys
from PySide.QtGui import QApplication, QScrollArea, QPushButton
from PySide.QtUiTools import QUiLoader

from instrumental.drivers.cameras import uc480
from instrumental import gui

if __name__ == '__main__':
    # Change serial number to match that of your camera
    cam = uc480.get_camera(serial='4002862589')
    cam.open()
    cam.load_stored_parameters(1)  # Load camera's stored parameters (optional)

    # Load Qt and the UI file
    loader = QUiLoader()
    app = QApplication(sys.argv)
    ui = loader.load('snapshot_gui.ui')

    # Create and add CameraView to the GUI's scrollarea
    cam_view = gui.CameraView(cam)
    scroll_area = ui.findChild(QScrollArea, 'scrollArea')
    scroll_area.setWidget(cam_view)

    # Grab a frame whenever the button is pushed
    button = ui.findChild(QPushButton, 'acquireButton')
    button.clicked.connect(cam_view.grab_frame)
Ejemplo n.º 4
0
"""
A simple GUI that can grab snapshots from a uc480 camera plugged
into the local machine. Cameras currently only support Windows.
"""

import sys
from PySide.QtGui import QApplication, QScrollArea, QPushButton
from PySide.QtUiTools import QUiLoader

from instrumental.drivers.cameras import uc480
from instrumental import gui

if __name__ == '__main__':
    # Change serial number to match that of your camera
    cam = uc480.get_camera(serial='4002862589')
    cam.open()
    cam.load_stored_parameters(1) # Load camera's stored parameters (optional)

    # Load Qt and the UI file
    loader = QUiLoader()
    app = QApplication(sys.argv)
    ui = loader.load('snapshot_gui.ui')

    # Create and add CameraView to the GUI's scrollarea
    cam_view = gui.CameraView(cam)
    scroll_area = ui.findChild(QScrollArea, 'scrollArea')
    scroll_area.setWidget(cam_view)

    # Grab a frame whenever the button is pushed
    button = ui.findChild(QPushButton, 'acquireButton')
    button.clicked.connect(cam_view.grab_frame)