Impact Acquire SDK Python
GenICam™ GenDC Format

Since version 2.50 Impact Acquire supports the GenICam™ GenDC format developed by the GenICam working group. This format was triggered by the need to allow various vendors to transfer specific payload without the need to standardize a new payload format all the time. By using this format devices have an interoperable way to transfer e.g. 3D data which typically consists of several independent parts of data belonging together. So the main idea was to be able to report a single block of memory to the user that contains all this information and to have an interface that can access each part of this block of memory. A typical example where the GenDC format could be used is with a 3D camera or a dual head stereo camera where either multiple images that logically belong together (left sensor and right sensor or 3D image and confidence mask). But there are other use cases as well like e.g. when a device supports a hardware JPEG encoder an application might want to access both the raw data and the compressed data for different purposes like perform image processing on the raw data while streaming the compressed data via the network.

The API for accessing GenDC or multi-part data belonging to a mvIMPACT.acquire.Request request object basically consists of 2 functions:

properties residing in a separate list BufferParts within each request.

When mvIMPACT.acquire.ptGenDC data is reported by the mvIMPACT.acquire.Request.payloadType property and the mvIMPACT.acquire.SystemSettings.genDCParserEnable property is set to mvIMPACT.acquire.bTrue (the default) all the properties residing in the Image list of a request are don't care thus have the cfInvisible flag set. If normal (thus non-multi-part or GenDC) data is reported or mvIMPACT.acquire.SystemSettings.genDCParserEnable is switched off all properties residing in the BufferParts list of a request are don't care thus have the cfInvisible flag set. For GenDC data then mvIMPACT.acquire.Request.imageData points to the start of the container descriptor. Details on how to parse a GenICam™ GenDC descriptor can be found in the GenDC specification

The memory layout of a GenDC buffer can roughly be described like this:

One way of dealing with GenDC data in Impact Acquire could be implemented like this:

# ... more code
requestNr = fi.imageRequestWaitFor(timeout_ms)
if fi.isRequestNrValid(requestNr):
pRequest = fi.getRequest(requestNr)
if pRequest.isOK:
bufferPartCount = pRequest.getBufferPartCount()
if bufferPartCount > 0:
# data has been delivered in multi-part format. Features like 'pRequest.imageWidth' are "don't care"
for i in range(bufferPartCount):
part = pRequest.getBufferPart(i)
print("Part {0:d} carries data type {1}, {2} bytes starting at {3}".format(i, part.dataType.readS(), part.dataSize.read(), part.address.read()))
else:
# access feature the standard way. This buffer does not carry multi-part information
print("Data has been captured: {0:d}x{1:d}@{2:d}x{3:d}({4})".format(pRequest.imageOffsetX.read(), pRequest.imageOffsetY.read(), pRequest.imageWidth.read(), pRequest.imageHeight.read(), pRequest.imagePixelFormat.readS()))
# chunk data evaluation would start here as it works exactly the same way no matter in which
# format the data is delivered!
# ... even more code

In case the unprocessed GenDC container shall be received something like this could be implemented:

... more code ss = acquire.SystemSettings(getDevicePointerFromSomewhere()) ss.genDCParserEnable.write(acquire.bFalse) ... more code fi = getFunctionInterfaceFromSomewhere() requestNr = fi.imageRequestWaitFor(timeout_ms) if fi.isRequestNrValid(requestNr): pRequest = fi.getRequest(requestNr) if pRequest.isOK: if pRequest.payloadType.read() == acquire.ptGenDC:

This buffer does carry a GenDC container

print("A GenDC Container has been captured! Start parsing it at {0}".format(pRequest.imageData.read())) else:

In case GenDC and nothing else was expected raise the alarm

... even more code

Limitations

For mvIMPACT.acquire.ptGenDC payload currently the same limitations as described here will apply: Limitations