How do I start using the MATLAB Image Acquisition Toolbox with my FLIR Ax5?

To connect your FLIR Ax5 camera to MATLAB, you can use either the FLIR Atlas SDK for MATLAB, which has built in support for FLIR cameras as well as samples that show you how to save images and video, or you can use the MATLAB Image Acquisition Toolbox.

If you choose to use the Image Acquisition Toolbox, you need hardware support for GigE cameras, which can be accessed from the MATLAB home screen under Add-Ons > Get Hardware Support, and then searching for Gige and Genicam. You need these two hardware support packages:

  • Image Acquisition Toolbox Support Package for GigE Vision Hardware
  • Image Acquisition Toolbox Support Package for GenICam Interface

To check the connected cameras, use the MATLAB command gigecamlist: this will give you a list of the connected cameras.

Once you have activated and downloaded the two packages, you should be able to run the attached program (Ax5_test.m). The program is also written below for you to copy and paste.

The program shows how you can get one frame. If you want a continuous stream of frames, you can use a loop. To get access to the temperature data, look at the matrix temp_data_celcius. In the matrix temp_data_celcius, each pixel is represented by its absolute temperature value. The matrix (one frame) from the camera will be in a temperature linear format, and needs to be transformed to temperature by a linear operation: see the code for more information.


video_input = videoinput('gige'); %connect to the first gige camera
source = video_input.Source; %get the source object

%To get temperature linear data, the following GenICam registers needs
%to be set
source.SensorGainMode = 'HighGainMode';
source.TemperatureLinearMode = 'On';
source.TemperatureLinearResolution = 'High';


%start the video acquisition
start(video_input);

%MATLAB will receive data in uint16 format, the camera streams in 14bit
%therefor we have to remove the two most significant bits (2^14 and 2^15)
temp_linear = double(getdata(video_input, 1, 'uint16'));
temp_linear_stripped = temp_linear -(2^15) - (2^14); %removing the 2 MSB

%the temperature is linear in this format: T = Signal * 0.04
temp_data_kelvin = temp_linear_stripped * 0.04;
%we get the data in Kelvin, so it needs to be converted
temp_data_celcius = temp_data_kelvin - 273.15;

%displaying the temperature in pixel(100,100)
disp(temp_data_celcius(100,100));

%to display the image, we can use imagesc
imagesc(temp_data_celcius);

stop(video_input);
imaqreset;

 

File Attachment(s)

Ax5_test.m (1.06 KB)

Back to top