Pixel format doesn't match output

Hi,

I’ve got different cases where the pixel format doesn’t seem to match the actual output. For example I’m receiving BayerRG10, while the pixel format is set to BayerRG8 (this is confirmed by querying the property with the method NMInfoAsString as well as in the GenApi Grid Control). My steps to reproduce this are the following:

  1. Change the pixel format via the GenApi Grid Control to BayerRG10.
  2. Overwrite this setting by loading a GCS file (which only contains the line Std::PixelFormat = “BayerRG8”) with the method NMLoadset.

Querying the pixel format between steps 1 and 2 returns BayerRG10 and after step 2 BayerRG8. Yet, after step 2 the output is BayerRG10. I can also inverse this (BayerRG8 output while set to BayerRG10) and am able to reproduce this on different cameras with different pixel formats. No errors are reported while changing the pixel format during step 1 and 2. Is the node map buffered somewhere before it’s actually applied on the device?

Thanks in advance,
Tomes.

Hi Tomes,

changing image format settings like Width,Height and PixelFormat makes it necessary to tell the driver that the image format has changed.
Otherwise the driver is interpreting the incoming data as it was during initialization of the driver.
During initialization we need to allocate the memory with a specific size and pixel format.

The simplest way is to reload the driver. But it is also the slowest as everything is reinitialized.

You can use the IImageRect Interface from CVB with its IMAGERECT_CMD_RESET command to inform the driver of a changed pixel format.

To test this you can use the C# GenICam example which automatically detects a change of Pixelformat and uses IImageRect to reset the driver.

3 Likes

Hi Sebastian,

Implemented this and I couldn’t reproduce the issue. Thanks!

Hi Tomes,
I have exactly the same issue, but somehow the Driver reset wont work. I also dont find any docu/example.
Can you please share the snippet where you resetted the Driver with imagerect_cmd_reset?

Best regards,
Stefan

Hi @Dastef90

We have a .NET Tutorial which uses the Image Rect Interface to Update the Image with imagerect_cmd_reset.
It is located in the folder:
%CVB%\Tutorial\Hardware\GenICam\CSharp\CSGenICamExample

But this is old C-Style code.
For a modern CVB.NET code example my colleague @silas created a code snippet showing how to update the image.
See this separate post:
How to update driver memory after changing camera parameters - Programming Questions - Common Vision Blox User Forum