Acquiring Multiband Near Infrared Images from Helios EVK G2 Near Infrared Camera

1 Ansicht (letzte 30 Tage)
Dear Community,
I am trying to acquire Hyperspectral Images from a EVK G2 Near Infrared Camera. I am using the gige connection and the image acquisition toolbox.
So far I managed to establish a connection between Matlab and the camera and to acquire an image from the camera. The issue is, I only get a 2D image in the dimensions of the working width and the number of lines the camera has taken.
I am stuck getting the third dimension which contains the actual spectral information I am trying to get. The dimension of the attained spectral cube should be 312xLinesx220 with 312 being the x Dimensionsion, Lines specifying the y dimension and 220 specifying the 220 discrete points distributed over the wavelength band.
%% Prepare Workspace
clc
clear all
close all
%% Use the gigecamlist function to ensure that MATLAB is discovering your camera.
gigecamlist
%% Create an object g
if exist('g','var') == 0
g = gigecam;
end
%% Adjust Packet Size to 1492
g.PacketSize = 1492;
%% Acquire One Image Frame from a GigE Camera
% Preview the image from the camera.
preview(g)
% Show for 1 Second
pause(10)
% Close the preview.
closePreview(g)
%% Acquire a single image from the camera using the snapshot function, and assign it to the variable img
img = snapshot(g);
% Display the acquired image.
imshow(img)
%% Create an image of 30s of recording
img = [] % Create empty image
user_input_time = 30; % Seconds
tic; % Start timer
while (toc < user_input_time) && (size(img,1) < 1000) % While loop runs for x seconds and as long as the image is less than 1000 rows high
img_curr = snapshot(g); % Take the image
img = [img; img_curr] % Append to the existing image
end
% Display the acquired image.
imshow(img)

Antworten (1)

Garmit Pant
Garmit Pant am 1 Feb. 2024
Hello Gerald
From what I gather, you are working with EVK Helios G2-320 Near Infrared Camera to acquire hyperspectral image data using connection to MATLAB via the GigE connection. You are able to capture 2D data using the MATLAB function “snapshot” and are looking for a method to capture 3D hyperspectral data.
Here are some points that can answer your question:
  • CORE vs CLASS: EVK Helios cameras are available in 2 different specifications, i.e., CORE and CLASS. CORE devices output high-quality spectra that can be used for further processing. CLASS devices come with an integrated embedded Classification System and output 4-bit classified data. Please check the specification of the device that you are using. For this answer, further points will be relevant to CORE devices, given that you are able to capture 2D data.
  • Pushbroom Cameras: EVK Helios G2-320 is a pushbroom camera. Pushbroom cameras have a 2D sensor array. To capture a 3D data cube, it is necessary to perform a sweep capture as it is not possible to obtain all the necessary information in one frame. In every captured frame, pushbroom cameras capture just one line (1D images) of spatial information (using the other dimension of the sensor to store the spectral information). The ensemble of all these 1D lines captured together constitutes the regular 2D image. Therefore, with push-broom cameras, it is required to have a relative linear motion between the camera and the sample to perform a spatial sweep. Thus, using “snapshot,” the 2D data that you get for each frame contains the spatial line image data as the first image and the second frame captures the spectral data. The following code snippet contains the modified loop from your code to capture the data:
%% Create an image of 30s of recording
img = [] % Create empty image
spectralData = [];
user_input_time = 30; % Seconds
tic; % Start timer
while (toc < user_input_time) && (size(img,1) < 1000) % While loop runs for x seconds and as long as the image is less than 1000 rows high
img_curr = snapshot(g); % Take the image
img = [img, img_curr(:,1)]; % Append to the existing image
spectralData = [spectralData, img_curr(:,2)];
end
  • Camera properties: Please ensure that you set the correct “PixelFormat” for your camera. By default, the value is “Mono8”. You can use the following code snippet to change the “PixelFormat”:
%% g.PixelFormat = <Appropriate Pixel Format>;
For further understanding on the methods mentioned above, you can refer to the following MATLAB Documentation:
  1. snapshot” function of Image Acquisition Toolbox: https://www.mathworks.com/help/releases/R2021a/imaq/snapshot.html
  2. How to set the properties of the GigE Camera: https://www.mathworks.com/help/releases/R2021a/supportpkg/gigevisionhardware/ug/set-properties-for-gige-acquisition.html
I hope you find the above explanation and suggestions useful!

Produkte


Version

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by