Multi Part Image

<< Click to Display Table of Contents >>

Navigation:  Migration Guide for the Acquisition Stacks > CVBpy >

Multi Part Image

Multi part basically means that the stream returns a composite instead of an image which may itself consist of one or more image(s), planes of point cloud(s) etc. In other words: A composite is a way to iterate over and interpret the delivered data and it will in fact be necessary to do so in order to make sense of the acquired data.

The use of a composite element's data is represented by the composite purpose, which can be:

Custom: an unspecified custom composite - consult the source of the image for an interpretation.

Image: one image, potentially with extra data.

ImageList: multiple images grouped together.

MultiAoi: multiple images that represent multiple AOIs in one frame.

RangeMap: a 2.5D image, potentially with extra data.

PointCloud: 3D data, potentially with extra data.

ImageCube: a (hyper spectral) image cube.

The different part types are:

A standard image

A single plane of data holding, e.g for point clouds confidence data

A collection of grouped planes, e.g. R,G and B planes

A generic raw buffer

A raw buffer following Pixel Format Naming Convention (PFNC) for e.g. packed data, which is not representable as an image.

 

Code Example

3rd generation stack

1

2

3

4

5

6

7

8

9

10

11

devices = DeviceFactory.discover_from_root(DiscoverFlags.IgnoreVins)

with DeviceFactory.open(devices[0].access_token, AcquisitionStack.GenTL) as device:

  stream = device.stream(ImageStream)

  stream.start()

  for _ in range(10):

      image, status, node_maps = stream.wait()

      with image:

          for part in image:

              if isinstance(part, Image):

                  pass

  stream.abort()

(8) Get the parts of the image.

(9) The type of this element can be verified by the isinstance function.

 

Summary

As has been shown, acquiring multi part data from a camera is not actually any more complex than acquiring a composite - the actual effort with multi part data goes into parsing the content of the received composite. Usually this will be done with the properties of the hardware in mind, i.e. like in the example above, the code usually contains assumptions about the content of the composite (that should, of course, be verified) and therefore tends to be somewhat device-specific.