FLIR

FLIR Hardware cameras

OpenHSI Hardware Camera Implementations

Tip

This module can be imported using from openhsi.cameras import *

Wrapper class and example code for getting images from the OpenHSI.

Tip

To use the camera, you will need some calibration files. You can also generate these files following this guide which uses the calibrate module.

FLIR

This camera requires the Spinnaker SDK and corepsonding Python pyspin .whl file from https://www.teledynevisionsolutions.com/products/spinnaker-sdk.

Note

PySpin only supports specific python versions. Be sure to pair your python version with the package you install. As of June 2025, the latest version of python supported is 3.10.

Note on properties:

FLIR cameras can have different property names across models and firmware versions. For example, some cameras use “AcquisitionFrameRateEnabled” while others use “AcquisitionFrameRateEnable”. The following utility functions provide a robust way to handle these differences.


source

set_camera_attribute

 set_camera_attribute (camera, attribute_name, value, alternatives=None,
                       required=True)

*Set a camera attribute with support for alternative attribute names.

FLIR cameras with different models or firmware versions may use slightly different property names for the same functionality. This function attempts to set an attribute using the primary name first, then falls back to alternative names if provided.

Args: camera: Camera object attribute_name: Primary attribute name to try value: Value to set alternatives: List of alternative attribute names to try if primary fails required: If True, raise an error if none of the attributes exist

Returns: bool: True if attribute was set successfully*


source

get_min_exposure

 get_min_exposure (camera)

*Get minimum exposure time in microseconds with graceful fallback.

Different FLIR camera models expose the minimum exposure time through different property names. This function tries several known property names and provides a reasonable default if none are found.

Args: camera: Camera object

Returns: float: Minimum exposure time in microseconds*


source

FlirCameraBase

 FlirCameraBase ()

*Interface for FLIR camera

Any keyword-value pair arguments must match the those avaliable in settings file. FlirCamera expects the ones listed below:

  • win_resolution: size of area on detector to readout (width, height)
  • win_offset: offsets (x,y) from edge of detector for a selective
  • exposure_ms: is the camera exposure time to use
  • pixel_format: format of pixels readout sensor, ie Mono8, Mono10, Mono10p, Mono10Packed, Mono12, Mono12p, Mono12Packed, Mono16*

source

FlirCamera

 FlirCamera ()

*Interface for FLIR camera

Any keyword-value pair arguments must match the those avaliable in settings file. FlirCamera expects the ones listed below:

  • win_resolution: size of area on detector to readout (width, height)
  • win_offset: offsets (x,y) from edge of detector for a selective
  • exposure_ms: is the camera exposure time to use
  • pixel_format: format of pixels readout sensor, ie Mono8, Mono10, Mono10p, Mono10Packed, Mono12, Mono12p, Mono12Packed, Mono16*
json_path='../assets/cam_settings_flir.json'
cal_path='../assets/cam_calibration_flir.pkl'

with FlirCamera(n_lines=256, 
                 processing_lvl = -1,
                 cal_path=cal_path,json_path=json_path,
                 exposure_ms=10,
                ) as cam:
    cam.collect()
    fig = cam.show(hist_eq=True)
    
fig
Allocated 472.31 MB of RAM. There was 14520.77 MB available.
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 256/256 [00:02<00:00, 90.37it/s]

Multiprocessing camera export

Export cameras using the SharedOpenHSI class.


source

SharedFlirCamera

 SharedFlirCamera ()

*Interface for FLIR camera

Any keyword-value pair arguments must match the those avaliable in settings file. FlirCamera expects the ones listed below:

  • win_resolution: size of area on detector to readout (width, height)
  • win_offset: offsets (x,y) from edge of detector for a selective
  • exposure_ms: is the camera exposure time to use
  • pixel_format: format of pixels readout sensor, ie Mono8, Mono10, Mono10p, Mono10Packed, Mono12, Mono12p, Mono12Packed, Mono16*