HI,
I am running a C5-2090 camera in chunk data mode. when, I try to collecting the chunk data in pyton by translating the Chunk mode with CVB.net to CVBpy. I tried to adapt the code on https://forum.commonvisionblox.com/t/using-chunk-mode-data-with-cvb-net/333 but, I realized that when I captured the image, using(device image = device.device_image), I don’t get the chunk data.
Also I try to read CVB c++ but, it was not totally clear form how to translate to CVBpy
sorry for the late reply. You can get the chunk data in two ways:
Using the chunk node map, which is device dependent and not supported on your camera.
Attaching the chunk to the image buffer and manually parsing it afterwards. This would require direct buffer access which is currently not supported in python. There might be a hacky way to interpret the image as numpy array and get the chunk data, but we cannot guarantee that you won’t run into more trouble down the road.
If it would be feasible for you to switch to .NET I think it would make more sense to do that and adapt the chunk parser from your linked forum post.
Also why do you need the chunk data? Maybe there is another solution to get the information you need?
Thank you for your answer. I am looking to read the encoder Value, frame ID, AOI in each axe, AOI_idx, timeStamp_trigger, ecoderValue_trigger for every 10 frames or 1 frame, for example.
You can check if you get the values from the camera in the node map. I would recommend the GenICam Browser (set the visibility to Guru → top right four bars → Max visibility → Guru) and look/search for the values. On my camera (Genie Nano M1920) the AOI is in custom nodes (see the Cust:: before the node name). I would get the AOI like so:
# Discover and open a device
discovery = cvb.DeviceFactory.discover_from_root(cvb.DiscoverFlags.IgnoreVins)
device = cvb.DeviceFactory.open(discovery[0].access_token)
device_node_map = device.node_maps["Device"]
# Turn the AOI on
roi_switch = device_node_map["Cust::multipleROIMode"]
roi_switch_entries = roi_switch.entries # check which entry turns the AOI on, for me it's the second
roi_switch.value = roi_switch_entries[1].symbolic_value # turn on
# Get the AOI selector node
roi_selector = device_node_map["Cust::multipleROISelector"]
roi_selector_entries = roi_selector.entries
# Select the first AOI
roi_selector.value = roi_selector_entries[0].symbolic_value
# Get the width of the selected AOI
width1 = device_node_map["Cust::multipleROIWidth"].value
# Select the second AOI
roi_selector.value = roi_selector_entries[1].symbolic_value
# Get the width of the selected (second) AOI
width2 = device_node_map["Cust::multipleROIWidth"].value
If your camera does not have the nodes I would recommend to switch to .NET if that is possible.