Correct colours in GenICam Browser's View, incorrect when saved/streamed

We’re using a JAI AP-1600T-PGE under Ubuntu 18.04, and are having issues with the colours provided by CVB.

After performing white balancing (through the GenICam “BalanceWhiteAuto” property of the camera) the image displayed in the GenICam Browser’s view shows what appear to be the correct colours. However, if we save an image from the GenICam Browser the colours are incorrect.

More importantly, the colours are also incorrect when retrieving the image programmatically from the CVB stream.

What is the GenICam Browser’s viewer doing differently to other aspects of CVB? Is the white balance information provided as metadata in some manner that we need to apply ourselves?

Thanks,
Mike

Here’s the image from the GenICam Browser’s view:

And the image saved from the GenICam Browser’s save function (identical to those received from a stream object):

1 Like

Hi @Mike,

please try to open the camera using the CVBViewer.
Also try to check the ColorFormat settings in the driver using the tool icon above the list of configured devices in the GCBrowser.
What I can see from the images does not look like a typical ColorFormat missmatch. However, the only difference between the GCBrowser and the other tools is that, as fas as I am aware, the GCBrowser only configures the camera and driver but does not open the driver for acquisition.

Cheers
Chris

1 Like

Hi Chris,

Thanks for your response; I’ve tried all the ColorFormat options, however, this setting doesn’t appear to have any effect on either the way GCBrowser displays or saves the images, despite selecting Mono8 (for example) I still receive correct colour images in the view and incorrect colour images when saving (instead of monochrome images, as expected)

Unfortunately, the CVBViewer tool doesn’t appear to be included as part of the Linux version of CVB and as this camera is accessed remotely at a customer site, connecting it to a Windows system would be non-trivial.

Thanks,
Mike

A further data point:

Analysing the image displayed in GCBrowser’s view, it appears that the green channel is actually identical to the blue channel. So I’m now suspecting that the white balancing didn’t actually work correctly, and it’s the GCBrowser viewer that’s displaying things incorrectly (but in such a way that co-incidentally looks more like the final white-balanced image should look)

1 Like

Hi Mike,

sorry I missed the part with Ubuntu.
What language are you programming with? I could send you over some snippets that load a driver and save the image.
The thing is, we might possibly be facing a bug in the GC Browser, but as the GC Browser only calls :cvb:`s Save(), the error could also be in this method.

So, please try the different ColorFormats in the Driver (Raw might be a good one to start with) and play with the ColorFormats in the Nodemap of the camera as well.
I can also provide you some code to do this programmatically.

I saw you used your blue channel as ExposureTimeSelector. Also the documentation of the camera:
CamDocu implies a BGR output (Page 24).
So, as :cvb: usually works with RGB it seems to be a missinterpretion of the buffer at some point.
Thats why the red channel might be dominant, as it gets its information from your blue channel that seems to be the master for ExposureTime and thus probably for the white balance as well.

Cheers
Chris

We’re working in Python, I’ve been able to reproduce this with the following minimal snippet:

import cvb
vin_device = cvb.DeviceFactory.open(cvb.install_path() + "/drivers/GenICam.vin")
stream = vin_device.stream
stream.start()
image, status = stream.wait()
image.save("/tmp/test.jpeg")

The red channel actually looks reasonable, its the green channel that has much higher values than expected (giving everything a greenish tint), and since that’s the same channel in either BGR or RGB I suspect that isn’t the issue.

As mentioned above, I’m now no longer confident that the white balancing actually worked, so I’m having our test camera shipped to me to experiment with. I’ll update this thread if I figure anything further out from that.

Thanks!

1 Like

Hi Mike,

I still dont know which settings for the ColorFormat you have tested for the driver combined with which settings for the ColorFormat in the camera.

Also try to save a .bmp for now, please. I am not sure if jpeg handles RGB and BGR different, but .bmp should work.

For your tests:

import os 
import cvb   

# Read and write values from/to NodeMap 
#Tested With Dalsa Genie Nano, names of Nodes may be different on other devices   

# Load driver  
device = cvb.DeviceFactory.open(os.path.join(cvb.install_path(), "drivers", "GenICam.vin"), port=0)  

#Load NodeMap for the device  
dev_node_map = device.node_maps["Device"]    

camModel = dev_node_map["DeviceModelName"]  
print("Loaded device: " + camModel.value) 
 

camFirmware = dev_node_map["DeviceFirmwareVersion"]  
print("Current Firmwareversion : " + camFirmware.value)  

exposureTime = dev_node_map["ExposureTime"] 
print("Current exposure time : " + str(exposureTime.value))  

exposureTimeOld = exposureTime.value 
exposureTime.value = 32 
print("Small exposure time : " + str(exposureTime.value)) 

exposureTime.value = exposureTimeOld 
print("Resetted to old exposure time : " + str(exposureTime.value)) 

I am not yet convinced about this being a whiteBalance issue… still the code (changed to you needs) should help you figure the problem out.

Cheers
Chris