genicam / harvesters

Image Acquisition Library for GenICam-based Machine Vision System
Apache License 2.0
502 stars 86 forks source link

Change camera input resolution using harvesters #298

Closed zhifeis closed 2 years ago

zhifeis commented 2 years ago

Hi,

I'm currently using a Keyence VJ H-500CX paired with a VJ-3002 image processing unit alongside the genicam harvesters library w/ matrixvision mvGenTL_Acquire 64. The camera's resolution can be toggled between 2432x2040 (default) and 1600x1200 on their provided GUI. Is there a way to do this via Python code with the harvesters library?

Thanks!

kazunarikudo commented 2 years ago

You can change the resolution by setting values to the Width and the Height nodes.

# Note that "ia" is an object returned by h.create_image_acquirer(0).
ia.remote_device.node_map.Width.value = 2432
ia.remote_device.node_map.Height.value = 2040
ia.start()

Note that those parameters are turned read-only while the device is streaming. You will need to call the ia.stop() method to let the device stop streaming. Best regards, Kazunari.

kazunarikudo commented 2 years ago

Please feel free to close this ticket when you feel the issue/concern is resolved.