Setting Node Map parameters

Hi all,
So, I have a SP series area scanner with which I am trying to acquire images. I can read the images from the camera and change few configuration parameters via Node Map. By doing this, I am currently seeing a issue that it doesn’t work as expected for the first time but runs perfectly when I re run the code in the consecutive runs. The code is as follows

with cvb.DeviceFactory.open(
        os.path.join(cvb.install_path() + "drivers", "GenICam.vin"), 
        cvb.AcquisitionStack.Vin) as vin_device:

        device_node_map = vin_device.node_maps["Device"]

        device_node_map["Width"].value = set_image_width
        device_node_map["Height"].value = set_image_height
        device_node_map["BalanceWhiteAuto"].value = "Continuous"

So, here using the above lines, I can set the height, width of the acquisition and enable auto white balance. When I change any of the above parameters and run the code, during the first run the change of the parameters is not reflected in the output and sometimes the images are distorted. When I run it again without changing anything then the images comes out perfectly fine as expected.

I am thinking the issue is because, the camera is getting initialized from the node map so after the camera is open, it is unable to take the new configuration parameters.

So, is there a way to set/initialize the node map parameters before opening the camera with the following lines

with cvb.DeviceFactory.open(
        os.path.join(cvb.install_path() + "drivers", "GenICam.vin"), 
        cvb.AcquisitionStack.Vin) as vin_device:

Thanks in advance

Please take a look to this post:
How to update driver memory after changing camera parameters - Programming Questions - Common Vision Blox User Forum

This will solve your issue you are facing.

2 Likes

Thank you @Sebastian. It works !!! :slight_smile: :blush:

1 Like