6from timeit
import default_timer
as timer
9NUM_ELEMENTS_TO_ACQUIRE = 5000
10FEEDBACK_INTERVAL = NUM_ELEMENTS_TO_ACQUIRE / 10
27item.set_parameter(
"UseRdma",
"1")
30 node_map = device.node_maps[cvb.NodeMapID.Device]
31 payload_size = node_map.node(
"PayloadSize").value
39 stream.register_managed_flow_set_pool(NUM_FLOW_SETS)
43 for i
in range(NUM_ELEMENTS_TO_ACQUIRE):
44 composite, status, _ = stream.wait_for(TIMEOUT_MS)
48 if i
and i % FEEDBACK_INTERVAL == 0:
51 print(f
"acquired images: {i} | size: {img.width} x {img.height}")
53 print(f
"acquired composites: {i} which is not an image")
56 duration = end - start
58 data_rate = payload_size * NUM_ELEMENTS_TO_ACQUIRE / (1000000 * duration)
61 print(f
"\nacquired {NUM_ELEMENTS_TO_ACQUIRE} buffers in {(duration * 1000):.2f} ms ( {data_rate:.2f} MB/s )")
The composite stream class.
Definition: __init__.py:782
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
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:1550
The Common Vision Blox image.
Definition: __init__.py:2038