Common Vision Blox 15.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Friends Modules Pages
Image Manager/CVBpy/MultiPart

This example program is located in your CVB installation under %CVB%Tutorial/Image Manager/CVBpy/MultiPart.

multi_part.py:

# @brief Example for acquiring multi part images.
# CVBpy Example Script for multi part image
#
# 1. Open the device with 3rd generation acq stack.
# 2. Get the composite stream
# 3. Acquire composites
# 4. Get the parts of a composite
# 5. Check the type of the part
#
# Requires: A connected and configured GenICam device which has multipart composites
import cvb
devices = cvb.DeviceFactory.discover_from_root(cvb.DiscoverFlags.IgnoreVins)
with cvb.DeviceFactory.open(devices[0].access_token, cvb.AcquisitionStack.GenTL) as device:
stream = device.stream(cvb.CompositeStream)
stream.start()
for _ in range(10):
composite, status, node_maps = stream.wait()
with composite:
for part in composite:
if isinstance(part, cvb.Image):
img: cvb.Image = part
print(f"Part of image is of type IMAGE: {img.width}x{img.height}")
# using this you can check for all the different types that could be in the composite
stream.abort()
Union[cvb.GenICamDevice, cvb.VinDevice, cvb.EmuDevice, cvb.VideoDevice, cvb.NonStreamingDevice] open(str provider, int acquisition_stack=cvb.AcquisitionStack.PreferVin)
List[cvb.DiscoveryInformation] discover_from_root(int flags=cvb.DiscoverFlags.FindAll, int time_span=300)