Seek ThermalThermal sensing for mission critical applications
API reference

API Reference

Complete API documentation for all public classes, functions, and types


Description

The seekcamera package exposes all public classes, enumerations, and exceptions needed to discover Seek Thermal OEM camera cores, configure their image-processing pipelines, and consume thermal frame data in Python. Import directly from the top-level seekcamera namespace to access every symbol documented here. This reference covers every public type in version 1.3.0 of the library.


Parameters

Most API entry points are methods on the SeekCameraManager and SeekCamera classes rather than module-level functions. The table below lists every constructable public class or enumeration and its constructor parameters where applicable.

SymbolKindConstructor ParametersDescription
SeekCameraManagerClassio_type: int (see SeekCameraIOType)Entry point for camera discovery and lifecycle management.
SeekCameraClassInstantiated by the manager — not constructed directlyRepresents a single connected camera.
SeekCameraFrameClassInstantiated by the SDK — not constructed directlyContainer for all frame formats delivered in a single capture event.
SeekFrameClassInstantiated by the SDK — not constructed directlyA single decoded frame buffer exposing pixel data as a NumPy array.
SeekCameraFrameHeaderClassInstantiated by the SDK — not constructed directlyMetadata header attached to a captured frame.
SeekCameraManagerEventIntEnumCONNECT=0, DISCONNECT=1, ERROR=2, READY_TO_PAIR=3
SeekCameraIOTypeIntEnumUSB=0x01, SPI=0x02
SeekCameraFirmwareVersionClassproduct=0, variant=0, major=0, minor=0Firmware version quad.
SeekCameraAppResourcesRegionIntEnumREGION_0=11, REGION_1=12, REGION_2=13
SeekCameraColorPaletteIntEnumWHITE_HOT=0USER_4=13 (see Notes for full list)
SeekCameraColorPaletteDataClassdata: Optional[Iterable[Tuple[int,int,int,int]]]256-entry (b, g, r, a) palette definition.
SeekCameraAGCModeIntEnumLINEAR=0, HISTEQ=1
SeekCameraLinearAGCLockModeIntEnumAUTO=0, MANUAL=1, MANUAL_MIN=2, MANUAL_MAX=3
SeekCameraPipelineModeIntEnumLITE=0, LEGACY=1, SEEKVISION=2
SeekCameraShutterModeIntEnumAUTO=0, MANUAL=1
SeekCameraTemperatureUnitIntEnumCELSIUS=0, FAHRENHEIT=1, KELVIN=2
SeekCameraFilterIntEnumGRADIENT_CORRECTION=0, FLAT_SCENE_CORRECTION=1, SHARPEN_CORRECTION=2
SeekCameraFilterStateIntEnumDISABLED=0, ENABLED=1
SeekCameraHistEQAGCGainLimitFactorModeIntEnumAUTO=0, MANUAL=1
SeekCameraUSBIOPropertiesClassbus_number=0, port_numbers=NoneUSB-specific IO descriptor.
SeekCameraSPIIOPropertiesClassbus_number=0, cs_number=0SPI-specific IO descriptor.
SeekCameraIOPropertiesClasstype_: SeekCameraIOType, usb=None, spi=NoneGeneric IO descriptor wrapping USB or SPI properties.
SeekCameraVersionClassNo constructor args; attributes are class-level constantsLibrary version (MAJOR=1, MINOR=3, PATCH=0).
SeekCameraFrameFormatIntEnumFrame format selector passed to capture_session_start.
SeekCameraFlatSceneCorrectionIDIntEnumIdentifies a stored flat-scene correction slot.
SeekCameraHistEQAGCPlateauRedistributionModeIntEnumControls how histogram plateau values are redistributed.

Key SeekCamera methods

MethodParametersDescription
capture_session_start(frame_format)frame_format: intBegins streaming; raises on error.
capture_session_stop()Stops streaming.
register_frame_available_callback(callback, user_data)callback: Callable, user_data: AnyRegisters the frame-delivery callback.
get_color_palette()Returns the active SeekCameraColorPalette.
set_color_palette(palette)palette: SeekCameraColorPaletteSets the active color palette.
set_color_palette_data(palette, data)palette: SeekCameraColorPalette, data: SeekCameraColorPaletteDataUploads custom palette data for a USER slot.
get_pipeline_mode()Returns the active SeekCameraPipelineMode.
set_pipeline_mode(mode)mode: SeekCameraPipelineModeSets the processing pipeline.
get_agc_mode()Returns the active SeekCameraAGCMode.
set_agc_mode(mode)mode: SeekCameraAGCModeSets the AGC algorithm.
get_thermography_window()Returns (x, y, w, h) of the thermography ROI.
set_thermography_window(x, y, w, h)x, y, w, h: intSets the thermography ROI in pixels.
get_firmware_version()Returns SeekCameraFirmwareVersion.
get_chipid()Returns the chip ID string.
get_serial_number()Returns the serial number string.
get_core_part_number()Returns the core part number string.
get_io_type()Returns SeekCameraIOType.
get_io_properties()Returns SeekCameraIOProperties.
store_calibration_data(source_dir, callback, user_data)source_dir: str, callback: Callable, user_data: AnyWrites calibration data to device flash.
update_firmware(firmware_path, callback, user_data)firmware_path: str, callback: Callable, user_data: AnyUpdates camera firmware.
store_flat_scene_correction(fsc_id, callback, user_data)fsc_id: SeekCameraFlatSceneCorrectionID, callback, user_dataCaptures and stores a flat-scene correction.
delete_flat_scene_correction(fsc_id, callback, user_data)fsc_id: SeekCameraFlatSceneCorrectionID, callback, user_dataDeletes a stored flat-scene correction.
load_app_resources(region, data_size, callback, user_data)region: SeekCameraAppResourcesRegion, data_size: int, callback, user_dataReads customer app data from device flash.
store_app_resources(region, data, data_size, callback, user_data)region: SeekCameraAppResourcesRegion, data, data_size: int, callback, user_dataWrites customer app data to device flash.

SeekCameraManager usage

SeekCameraManager is used as a context manager. Its constructor accepts a bitwise OR of SeekCameraIOType values.

ParameterTypeRequiredDescription
io_typeintYesBitmask of SeekCameraIOType values indicating which transports to monitor.

SeekCameraColorPaletteData constructor

ParameterTypeRequiredDescription
dataIterable[Tuple[int, int, int, int]]No256 (b, g, r, a) tuples. Defaults to all zeros.

SeekCameraFirmwareVersion constructor

ParameterTypeRequiredDescription
productintNoProduct field. Defaults to 0.
variantintNoVariant field. Defaults to 0.
majorintNoMajor field. Defaults to 0.
minorintNoMinor field. Defaults to 0.

Returns

Return values depend on whether you are calling a getter method, a context manager, or registering a callback.

  • SeekCameraManager.__enter__ — Returns the SeekCameraManager instance itself, allowing with SeekCameraManager(...) as manager: usage.
  • SeekCamera.get_color_palette() — Returns a SeekCameraColorPalette enum member.
  • SeekCamera.get_pipeline_mode() — Returns a SeekCameraPipelineMode enum member.
  • SeekCamera.get_agc_mode() — Returns a SeekCameraAGCMode enum member.
  • SeekCamera.get_thermography_window() — Returns a 4-tuple (x, y, width, height) of int.
  • SeekCamera.get_firmware_version() — Returns a SeekCameraFirmwareVersion instance.
  • SeekCamera.get_chipid() — Returns a str of up to 16 characters.
  • SeekCamera.get_serial_number() — Returns a str of up to 16 characters.
  • SeekCamera.get_core_part_number() — Returns a str of up to 32 characters.
  • SeekCamera.get_io_type() — Returns a SeekCameraIOType enum member.
  • SeekCamera.get_io_properties() — Returns a SeekCameraIOProperties instance whose .usb or .spi field is populated according to .type.
  • Setter methods (set_color_palette, set_pipeline_mode, etc.) — Return None; they raise on failure.
  • Frame callback (register_frame_available_callback) — Your callback receives (camera: SeekCamera, camera_frame: SeekCameraFrame, user_data: Any) and must return None.
  • SeekFrame.data — A NumPy ndarray whose dtype and shape depend on the frame format requested at session start.
  • SeekCameraColorPaletteData.__len__() — Always returns 256.
  • is_error(status) — Returns bool; True when status != 0.
  • error_from_status(status) — Returns the most-specific SeekCameraError subclass that matches the given status code, or SeekCameraError itself when no subclass matches.

Errors

All errors raised by this library are subclasses of SeekCameraError and originate from the underlying Seek Thermal C SDK status codes.

ExceptionStatus CodeWhen it occurs
SeekCameraError(base)Fallback when no specific subclass matches.
SeekCameraDeviceCommunicationError-1USB or SPI communication with the device failed.
SeekCameraInvalidParameterError-2A parameter passed to an API call was None, out of range, or otherwise invalid. Also raised by error_from_status when the provided status code is not an error.
SeekCameraPermissionsError-3The process lacks OS-level permission to access the device (e.g., missing udev rules on Linux).
SeekCameraNoDeviceError-4A command was issued but no device is present.
SeekCameraDeviceNotFoundError-5The device was expected but could not be located.
SeekCameraDeviceBusyError-6The device is currently handling another request.
SeekCameraTimeoutError-7An operation did not complete within the allowed time.
SeekCameraOverflowError-8A buffer or counter overflow was detected.
SeekCameraUnknownRequestError-9The SDK received a request it did not recognise.
SeekCameraInterruptedError-10An in-progress operation was interrupted.
SeekCameraOutOfMemoryError-11Host memory allocation failed.
SeekCameraNotSupportedError-12The requested feature is not supported by this camera or firmware version.
SeekCameraOtherError-99An unclassified error occurred in the SDK.
SeekCameraCannotPerformRequestError-103The camera cannot perform the request in its current state.
SeekCameraFlashAccessFailure-104Reading from or writing to device flash failed.
SeekCameraImplementationError-105An internal SDK implementation error occurred.
SeekCameraRequestPendingError-106A previous request of the same type is still pending.
SeekCameraInvalidFirmwareImageError-107The firmware image file is corrupt or incompatible.
SeekCameraInvalidKeyError-108A cryptographic or licence key was invalid.
SeekCameraSensorCommunicationError-109The SDK could not communicate with the thermal sensor inside the camera.
SeekCameraOutOfRangeError-301A value exceeded the allowed range.
SeekCameraVerifyFailedError-302A post-operation verification check failed.
SeekCameraSystemCallFailedError-303A host OS system call returned an error.
SeekCameraFileDoesNotExistError-400A required file was not found on the host filesystem.
SeekCameraDirectoryDoesNotExistError-401A required directory was not found on the host filesystem.
SeekCameraFileReadFailedError-402Reading a file from the host filesystem failed.
SeekCameraFileWriteFailedError-403Writing a file to the host filesystem failed.
SeekCameraNotImplementedError-1000The called function is not yet implemented in this SDK version.
SeekCameraNotPairedError-1001The function requires a paired camera but the device is unpaired. Pair the camera first by handling the READY_TO_PAIR manager event.

Examples

Import the package

All public symbols are available from the top-level namespace:

from seekcamera import (
    SeekCameraManager,
    SeekCameraIOType,
    SeekCameraManagerEvent,
    SeekCameraFrameFormat,
)

Connect to a USB camera and capture frames

The most common workflow: create a manager, register an event callback, start a capture session inside the CONNECT event, and process frames in a frame-available callback.

from seekcamera import (
    SeekCameraManager,
    SeekCameraIOType,
    SeekCameraManagerEvent,
    SeekCameraFrameFormat,
)

def on_frame(camera, camera_frame, user_data):
    # Retrieve the thermography floating-point frame
    frame = camera_frame.thermography_float
    print(f"Frame shape: {frame.data.shape}, dtype: {frame.data.dtype}")

def on_event(camera, event_type, error, user_data):
    if event_type == SeekCameraManagerEvent.CONNECT:
        camera.register_frame_available_callback(on_frame, user_data=None)
        camera.capture_session_start(SeekCameraFrameFormat.THERMOGRAPHY_FLOAT)

    elif event_type == SeekCameraManagerEvent.DISCONNECT:
        print(f"Camera disconnected: {camera.get_serial_number()}")

    elif event_type == SeekCameraManagerEvent.ERROR:
        print(f"Camera error: {error}")

    elif event_type == SeekCameraManagerEvent.READY_TO_PAIR:
        print("Camera is unpaired — pairing required before use.")

with SeekCameraManager(SeekCameraIOType.USB) as manager:
    manager.register_event_callback(on_event, user_data=None)
    input("Press ENTER to stop...\n")

Expected output (example):

Frame shape: (156, 206), dtype: float32
Frame shape: (156, 206), dtype: float32
...

Read camera identity information

def on_event(camera, event_type, error, user_data):
    if event_type == SeekCameraManagerEvent.CONNECT:
        print("Serial number :", camera.get_serial_number())
        print("Chip ID       :", camera.get_chipid())
        print("Part number   :", camera.get_core_part_number())
        print("Firmware      :", camera.get_firmware_version())
        print("IO type       :", camera.get_io_type())

Expected output:

Serial number : A1BC234567890DEF
Chip ID       : ABCD1234EFGH5678
Part number   : SX00X-0000-0000
Firmware      : 1.5.3.0
IO type       : USB

Set a color palette and AGC mode

from seekcamera import SeekCameraColorPalette, SeekCameraAGCMode

def on_event(camera, event_type, error, user_data):
    if event_type == SeekCameraManagerEvent.CONNECT:
        camera.set_color_palette(SeekCameraColorPalette.IRON)
        camera.set_agc_mode(SeekCameraAGCMode.HISTEQ)
        camera.capture_session_start(SeekCameraFrameFormat.COLOR_ARGB8888)

Upload a custom color palette

Custom palettes must target one of the USER_0USER_4 slots.

from seekcamera import SeekCameraColorPalette, SeekCameraColorPaletteData

# Build a simple greyscale ramp
palette_data = SeekCameraColorPaletteData(
    data=[(i, i, i, 255) for i in range(256)]  # (b, g, r, a)
)

def on_event(camera, event_type, error, user_data):
    if event_type == SeekCameraManagerEvent.CONNECT:
        camera.set_color_palette_data(SeekCameraColorPalette.USER_0, palette_data)
        camera.set_color_palette(SeekCameraColorPalette.USER_0)
        camera.capture_session_start(SeekCameraFrameFormat.COLOR_ARGB8888)

Set the thermography ROI window

def on_event(camera, event_type, error, user_data):
    if event_type == SeekCameraManagerEvent.CONNECT:
        # Restrict thermography calculations to a 100×80 pixel window
        # starting at pixel (20, 10)
        camera.set_thermography_window(x=20, y=10, w=100, h=80)
        camera.capture_session_start(SeekCameraFrameFormat.THERMOGRAPHY_FLOAT)

Check the library version

from seekcamera import SeekCameraVersion

v = SeekCameraVersion()
print(v)        # 1.3.0
print(repr(v))  # SeekCameraVersion(1, 3, 0)

Expected output:

1.3.0
SeekCameraVersion(1, 3, 0)

Handle errors defensively

from seekcamera import SeekCameraError, SeekCameraNotPairedError

def on_event(camera, event_type, error, user_data):
    if event_type == SeekCameraManagerEvent.CONNECT:
        try:
            camera.capture_session_start(SeekCameraFrameFormat.THERMOGRAPHY_FLOAT)
        except SeekCameraNotPairedError:
            print("Camera must be paired before starting a capture session.")
        except SeekCameraError as exc:
            print(f"Unexpected camera error: {exc}")

Iterate a SeekCameraColorPaletteData object

from seekcamera import SeekCameraColorPaletteData

palette_data = SeekCameraColorPaletteData()
palette_data[0:3] = [(255, 0, 0, 255), (0, 255, 0, 255), (0, 0, 255, 255)]

for index, value in enumerate(palette_data):
    if index < 3:
        print(index, value)

Expected output:

0 (255, 0, 0, 255)
1 (0, 255, 0, 255)
2 (0, 0, 255, 255)

Notes

SeekCameraColorPalette — full member list

MemberValueDescription
WHITE_HOT0Standard white-hot thermogram.
BLACK_HOT1Inverted white-hot.
SPECTRA2Spectra false-colour.
PRISM3Prism false-colour.
TYRIAN4Tyrian false-colour.
IRON5Classic iron false-colour.
AMBER6Amber false-colour.
HI7Hi false-colour.
GREEN8Green false-colour.
USER_0USER_49–13Customer-defined slots; populate with set_color_palette_data before selecting.

Shutter mode is Mosaic Core-only

SeekCameraShutterMode and any shutter-related API calls apply only to Mosaic Core devices. Calling shutter APIs on non-Mosaic devices raises SeekCameraNotSupportedError.


SeekCameraManager must be used as a context manager

Always use with SeekCameraManager(...) as manager: to guarantee that the underlying C handle is properly destroyed. Failing to exit the context manager cleanly can leave camera handles dangling, preventing reconnection until the process restarts.


Frame callbacks execute on an internal SDK thread

Your frame-available callback is invoked from a thread managed by the Seek Thermal C SDK, not from your main Python thread. Avoid blocking I/O, GUI updates, or long-running computations inside the callback. Copy or queue the data for processing on another thread if needed.


SeekCameraFrame lifetime

The SeekCameraFrame object (and the underlying pixel buffers it references) is only valid for the duration of the callback invocation. If you need to retain pixel data beyond the callback, copy frame.data (a NumPy array) using frame.data.copy().


READY_TO_PAIR vs. CONNECT

A freshly manufactured or factory-reset camera emits READY_TO_PAIR instead of CONNECT. In this state the camera has no stored calibration on the host. You must initiate pairing (e.g., call store_calibration_data) before the camera will transition to the CONNECT state on subsequent connections. Attempting to start a capture session on an unpaired camera raises SeekCameraNotPairedError.


Shared library discovery

The seekcamera package loads libseekcamera.so (Linux/macOS) or seekcamera.dll (Windows) at import time via ctypes. The library must be on the system library path or reachable through the SEEKTHERMAL_LIB_DIR environment variable. On Windows, if SEEKTHERMAL_LIB_DIR is not set, the loader searches the default install directory C:\Program Files\Seek Thermal\Seek Thermal SDK\ and requires SDK version ≥ 4.2.0. Import will raise RuntimeError — not a SeekCameraError — if the shared library cannot be found or if the runtime version requirement is not met.


SeekCameraColorPaletteData colour channel order

Tuples are ordered (b, g, r, a) — not the more common (r, g, b, a). Swapping channels will produce incorrect colours without raising an error.


SeekCameraLinearAGCLockMode affects output range mapping

Regardless of which lock mode is active, the output range is always linearly stretched across the interval [0, 255]. The lock mode only controls how the minimum and maximum bounding values are determined (automatically from the scene, or manually supplied by you).


error_from_status is for advanced use

error_from_status(status) and is_error(status) are low-level helpers used internally by the library to translate C SDK status integers into Python exceptions. You do not need to call these functions in normal application code — the library raises the appropriate exception automatically. They are useful if you are extending or wrapping the C layer yourself.