I am trying to use CVB for ARM (on a NVIDIA Jetson) and having problems saving images. The camera is outputting RGB images and I can see them as color in the CVB GenICam browser, but when I save the image it is saved as a grayscale image.
I also have a standard CVB Linux installation, and that saves color images just fine.
Can anyone think of a reason why this would be?
can you please provide some more details:
- From where/with what method are you saving the images?
- What format are you trying to save the images in?
- When saving from within your software: Have you double checked that the image you are trying to save is an RGB image? (the return value of
ImageDimension must be 3)
####• From where/with what method are you saving the images?
Using the GenICam Browser I can view the output of the camera and these images are in color.
If I use the GenICam Browser to save an image it is saved as grayscale.
This also occurs when I use my code to save an image.
Using this same code on a Laptop rather than the ARM device I am able to save the images in color.
####• What format are you trying to save the images in?
I have tried .bmp .png and .jpg each with the same result.
####• When saving from within your software: Have you double checked that the image you are trying to save is an RGB image? (the return value of ImageDimension must be 3)
I checked this today and on the ARM device the output of ImageDimension is 1 so this is obviously why I am unable to write color images.
Using the same camera setup and code on the Laptop the output of ImageDimension is 3 and saving color images works.
From what you describe I assume that you are using a color camera with a Bayer pattern. The sensor of such a camera has a Bayer mosaic filter applied to its pixels with which it is capable of acquiring color images with sub sampled color data. These sub sampled color images are more economic in terms of bandwidth (see also this discussion) and are technically transmitted in a format with only 8 bits per pixel. In the computer, this raw Bayer format is usually visualized as monochrome, but if you have a closer look at these images you can still see the actual Bayer filter.
For example the Bayer representation of this image:
looks like this (200% zoom):
What might be happening on your system:
- The GenICamBrowser detects the Bayer format and applies the necessary conversion in order to be able to display the images as color images.
- However, this does not alter the actual image data. When trying to save the image, only the actual image data, not the current visualization will be stored to disc, and as the actual image data seems to still be mono8, only a monochrome image will be stored (in which you will most likely be able to see the characteristic pattern…).
- The GenICam.vin also only acquires the raw image data - which as you confirmed is a monochrome image.
Can you double check your $CVBDATA/GenICam.ini file on both systems? There might be differences between the two systems, especially the
PixelFormat settings seems to be different according to your account (a setting
PixelFormat = 0 on the Jetson would explain the behavior you are seeing, whereas the PC seems to be using either
PixelFormat = 5 or
PixelFormat = 2 see also here for a description of these settings).