Camera access / Chunk data access with IDS camera

Hello !

I’m trying to update our software to support IDS camera (GV-527xCP-C). We already support Flir-Teledyne and Lucid Vision cameras.

We are using CVB 14.00.008. (We also tried CVB 14.01.006) on Nvidia Jetson.

IDS Camera has the latest firmware installed.

We both use C++ API and python bindings depending on purpose (production or calibration).

We installed ids-peak package to get the correct cti files.

After installing version 2.17, the GENICAM_GENTL64_PATH is updated to /usr/lib/ids/cti

Lucid camera are not detected anymore (make sense). IDS are still detected but can’t be opened anymore:Traceback (most recent call last):
  File "/home/nvidia/workspace/platform/edge/test_ids_chunk_issue.py", line 18, in <module>
    with cvb.DeviceFactory.open(
RuntimeError: Unspecified GenTL error

Reverting the GENICAM_GENTL64_PATH to GENICAM_GENTL64_PATH=/opt/cvb/drivers/genicam, we can open the camera. When Chunk Mode is deactivated, image acquisition works just fine :

Set Node Std::ChunkModeActive to false

  • Composite purpose is Image

  • First item type is cvb.Image

  • Access the image from the composite object

Number of parts: 1, purpose: 0
First part type: <class 'cvb.Image'>
Trying to convert to MultiPartImage
Size of image: 1536.0, 2048.0

When Chunk Mode is activated, it doesn’t work:

Set Node Std::ChunkModeActive and Std::ChunkEnable[Std::ChunkSelector(Timestamp)] to true

  • Composite purpose is custom

  • First item type is NoneType

  • ChunkTimestamp node is not readable

Number of parts: 1, purpose: -1
First part type: <class 'NoneType'>
Trying to convert to MultiPartImage
Size of image: 0.0, 0.0
Traceback (most recent call last):
  File "/usr/app/test_ids_chunk_issue.py", line 18, in <module>
    with cvb.DeviceFactory.open(
  File "/usr/app/test_ids_chunk_issue.py", line 47, in <module>
    print(f"Chunk timestamp: {chunk_timestamp_node.value}")
RuntimeError: Node is not readable.

It also works fine with the default CVB GENICAM_GENTL64_PATH for Lucid Cameras:

Number of parts: 1, purpose: 0
First part type: <class 'cvb.Image'>
Trying to convert to MultiPartImage
Size of image: 1536.0, 2048.0
Chunk timestamp: 61804137122696

I think it’s related to the cti file (tbc?)

Based on what I read on this forum and in the documentation, I briefly tried to use the solution by using PFNCBuffer but it didn’t work.

I didn’t investigate more this solution because when I try to access the camera through GenICamBrowser (using theGENICAM_GENTL64_PATH=/usr/lib/ids/cti ), everything works ! Even setting the ChunkMode works, the ChunkTimestamp Node is readable and visible.

So I wanted to know why it’s working fine with GenICamBrowser but not with the python script (or cpp script) ?

Here is the small script I use for test :

import cvb
from typing import Optional, Tuple

if __name__ == "__main__":
    exp_serial_num = "4108794564"
    exp_device = None
    devices = cvb.DeviceFactory.discover_from_root(flags=cvb.DiscoverFlags.IgnoreVins)
    for device in devices:
        if device.read_property(cvb.DiscoveryProperties.DeviceSerialNumber) == exp_serial_num:
            exp_device = device
            break
    
    if exp_device is None:
        raise ValueError("Device not found")
    
    exp_device.set_parameter("AttachChunk","1")
    
    print(f"token: {exp_device.access_token}")
    with cvb.DeviceFactory.open(
                    provider=exp_device.access_token, acquisition_stack=cvb.AcquisitionStack.GenTL
                ) as exp_device_ptr:
        node_map = exp_device_ptr.node_maps[cvb.NodeMapID.Device]
        # Chunk mode active
        chunk_mode_active = node_map["Std::ChunkModeActive"]
        chunk_mode_active.from_string("1")
        #chunk_selector = node_map["Std::ChunkSelector"]
        #chunk_selector.from_string("Timestamp")
        #chunk_enable = node_map["Std::ChunkEnable"]
        #chunk_enable.from_string("1")
        
        # grab
        stream: Optional[cvb.CompositeStream] = exp_device_ptr.stream(stream_type=cvb.CompositeStream)
        stream.start()
        result: Tuple[Optional[cvb.Composite], int, Optional[cvb.NodeMapEnumerator]] = stream.wait_for(
            time_span=1000
        )
        composite, status, _ = result
        if status == cvb.WaitStatus.Ok:
            print(f"Number of parts: {composite.item_count}, purpose: {composite.purpose}")
            print(f"First part type: {type(composite[0])}")
            try:
                print("Trying to convert to MultiPartImage")
                img :cvb.MultiPartImage =  cvb.MultiPartImage.from_composite(composite)
                print(f"Size of image: {img.size.height}, {img.size.width}")
            except Exception as e:
                print(f"Error: {e}")
            chunk_timestamp_node = node_map["Std::ChunkTimestamp"]
            print(f"Chunk timestamp: {chunk_timestamp_node.value}")
        stream.stop()

Hi @mmuhieddine ,

IDS TL Issue

Currently, i do not see why the IDS TL works in the GenICam Browser but not within the CVB code.

Based on your description I would have expected an issue related to the IDS TL. But then it should not work with the GenICam Browser as well.

Chunk data access with our TL

As it works with the Lucid camera we probably have not a general issue. Maybe there is another difference between your Lucid camera and your IDS camera which influences the acquisition, like the Pixel Format.

Which PixelFormats are you using for tests.

Hi @Sebastian

Thanks for your reply.
I agree with your statement, if it was from the IDS TL, it shouldn’t even work with GenICamBrowser. That’s why I think I’m missing something here.
We use the same configuration for both Lucid and IDS cameras, which include Pixel Format BayerRG8.

Hi @mmuhieddine ,

I would kindly ask you to contact our support department for this topic:

https://www.stemmer-imaging.com/our-services/customer-services/support?redirect=false

I think this needs some clarification that might involve further testing on our side.
As we are working with third party vendors/TLs here, we might very likely have an issue with the standard not being fulfilled 100%.
Unfortunately this happens from time to time but in order for you to get a working solution as fast as possible, our regular support might be the best way to continue from here.

Cheers
Chris

Hi @Chris,

I will contact your support department then and keep this topic up-to-date if anything new pops up.

Thanks for your help,
Marin