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.
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.GetLinearAccess<uint16>(); int16 spectrum = new int16[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