Hyperspectral Imaging

Hi,
I’m working with a Specim FX10e Camera. I am trying to acces the Information both pixelwise and spectrum-wise, but unfortunately the solutions in Separate the R, G, B channels of RGB images into grayscale images. How should I operate? and Linear Access to the image data didn’t help much. Does anyone has any experience on this field?

The FX10e doesn’t output a multichannel image, the raw output of the camera has spatial information in one direction and wavelength info in the other so linear acces to the image should be the right approach. There is a hyperspectral tool in the works @guest24 can say something about that.

1 Like

And how can I linearly access to the Image information? I more or less understand the commands in Linear Access to the image data, but I don’t know how to apply them properly. Is there maybe somewhere a code example?

The image you get from the FX10e is a single planed image with x and y as coordinates. Pixel access is done using linear access. When accessing the pixels you need to remember that y corresponds to the band-index while x corresponds to the spatial resolution (like in the image below)

Note that the FX10e usually outputs 16bit pixel
So let’s say you want to access the spectrum at x=3:

int x = 3;
var linAcc = image.Planes[0].GetLinearAccess<uint16>();
uint16 spectrum[] = new uint16[height];
for(int bandIndex=0; bandIndex < height; ++bandIndex)
  spectrum[bandIndex] = linAcc[x,bandIndex];

I just freestyled this code snippet so there still may be errors.

Now to get from bandIndex to wavelength in nanometer you would need to create your own LUT using the calibration file on the Specim USB-stick.

The new CVB 13.2 release will contain a new tool to work with spectral data in C, C++, .Net and Python. I think this will be handy for you. It contains functions to convert a stack of images to cubes and to convert these cubes to CIE XYZ Lab sRGB

grafik

2 Likes

Thanks a lot, this worked!
I only had to change the pixel data type, which somehow appears to be 8 bit pixel. The compiler throws an InvalidOperationException when trying to run the code with UInt16 (or ushort):

The input image format is unsupported.: UInt16 ?~ 8bpp

Apart from accessing the pixel values, do you knwo how to change the binning settings or the MROI? Unfortunately I couldn’t find out any Information in the documentation about this.

Unfortunately I currently don’t have a FX10e here for testing. But I’m sure that binnung and multi roi should be in the camera nodemap.
Try to use the “Search Property” functionionality of the GeniCamBrowser.
Oh, and don’t foget to switch the visibility to “Guru”

As for multi roi itself:
Currently changing these features might break the standard conformity of the camera. Meaning, the image size the camera states that it has does not reflect the streamed image size in reality (Std::Width and Std::Height).
As far as I know binning should be fine.
grafik

1 Like