CVBpy 15.0
cvb/DiscoverDevices
1# CVBpy Example Script
2#
3# 1. Discover all devices.
4# 2. Load the first device found.
5# 3. Acquire images.
6#
7
8
9import cvb
10
11
13
14mock_info = next((info for info in discover if "CVMock.vin" in info.access_token), None)
15if mock_info is None:
16 raise RuntimeError("unable to find CVMock.vin")
17
18
20 mock_info.access_token, cvb.AcquisitionStack.Vin) as device:
21
22 stream = device.stream()
23 stream.start()
24
25 for i in range(10):
26 image, status = stream.wait()
27 if status == cvb.WaitStatus.Ok:
28 print("Acquired image: " + str(i))
29
30 stream.abort()
31
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:1629
List[cvb.DiscoveryInformation] discover_from_root(int flags=cvb.DiscoverFlags.FindAll, int time_span=300)
Discovers available devices / nodes depending on the given flags.
Definition: __init__.py:1609