API Reference
Complete API documentation for all public classes, functions, and types
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.
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.
| Symbol | Kind | Constructor Parameters | Description |
|---|---|---|---|
SeekCameraManager | Class | io_type: int (see SeekCameraIOType) | Entry point for camera discovery and lifecycle management. |
SeekCamera | Class | Instantiated by the manager — not constructed directly | Represents a single connected camera. |
SeekCameraFrame | Class | Instantiated by the SDK — not constructed directly | Container for all frame formats delivered in a single capture event. |
SeekFrame | Class | Instantiated by the SDK — not constructed directly | A single decoded frame buffer exposing pixel data as a NumPy array. |
SeekCameraFrameHeader | Class | Instantiated by the SDK — not constructed directly | Metadata header attached to a captured frame. |
SeekCameraManagerEvent | IntEnum | — | CONNECT=0, DISCONNECT=1, ERROR=2, READY_TO_PAIR=3 |
SeekCameraIOType | IntEnum | — | USB=0x01, SPI=0x02 |
SeekCameraFirmwareVersion | Class | product=0, variant=0, major=0, minor=0 | Firmware version quad. |
SeekCameraAppResourcesRegion | IntEnum | — | REGION_0=11, REGION_1=12, REGION_2=13 |
SeekCameraColorPalette | IntEnum | — | WHITE_HOT=0 … USER_4=13 (see Notes for full list) |
SeekCameraColorPaletteData | Class | data: Optional[Iterable[Tuple[int,int,int,int]]] | 256-entry (b, g, r, a) palette definition. |
SeekCameraAGCMode | IntEnum | — | LINEAR=0, HISTEQ=1 |
SeekCameraLinearAGCLockMode | IntEnum | — | AUTO=0, MANUAL=1, MANUAL_MIN=2, MANUAL_MAX=3 |
SeekCameraPipelineMode | IntEnum | — | LITE=0, LEGACY=1, SEEKVISION=2 |
SeekCameraShutterMode | IntEnum | — | AUTO=0, MANUAL=1 |
SeekCameraTemperatureUnit | IntEnum | — | CELSIUS=0, FAHRENHEIT=1, KELVIN=2 |
SeekCameraFilter | IntEnum | — | GRADIENT_CORRECTION=0, FLAT_SCENE_CORRECTION=1, SHARPEN_CORRECTION=2 |
SeekCameraFilterState | IntEnum | — | DISABLED=0, ENABLED=1 |
SeekCameraHistEQAGCGainLimitFactorMode | IntEnum | — | AUTO=0, MANUAL=1 |
SeekCameraUSBIOProperties | Class | bus_number=0, port_numbers=None | USB-specific IO descriptor. |
SeekCameraSPIIOProperties | Class | bus_number=0, cs_number=0 | SPI-specific IO descriptor. |
SeekCameraIOProperties | Class | type_: SeekCameraIOType, usb=None, spi=None | Generic IO descriptor wrapping USB or SPI properties. |
SeekCameraVersion | Class | No constructor args; attributes are class-level constants | Library version (MAJOR=1, MINOR=3, PATCH=0). |
SeekCameraFrameFormat | IntEnum | — | Frame format selector passed to capture_session_start. |
SeekCameraFlatSceneCorrectionID | IntEnum | — | Identifies a stored flat-scene correction slot. |
SeekCameraHistEQAGCPlateauRedistributionMode | IntEnum | — | Controls how histogram plateau values are redistributed. |
Key SeekCamera methods
| Method | Parameters | Description |
|---|---|---|
capture_session_start(frame_format) | frame_format: int | Begins streaming; raises on error. |
capture_session_stop() | — | Stops streaming. |
register_frame_available_callback(callback, user_data) | callback: Callable, user_data: Any | Registers the frame-delivery callback. |
get_color_palette() | — | Returns the active SeekCameraColorPalette. |
set_color_palette(palette) | palette: SeekCameraColorPalette | Sets the active color palette. |
set_color_palette_data(palette, data) | palette: SeekCameraColorPalette, data: SeekCameraColorPaletteData | Uploads custom palette data for a USER slot. |
get_pipeline_mode() | — | Returns the active SeekCameraPipelineMode. |
set_pipeline_mode(mode) | mode: SeekCameraPipelineMode | Sets the processing pipeline. |
get_agc_mode() | — | Returns the active SeekCameraAGCMode. |
set_agc_mode(mode) | mode: SeekCameraAGCMode | Sets 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: int | Sets 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: Any | Writes calibration data to device flash. |
update_firmware(firmware_path, callback, user_data) | firmware_path: str, callback: Callable, user_data: Any | Updates camera firmware. |
store_flat_scene_correction(fsc_id, callback, user_data) | fsc_id: SeekCameraFlatSceneCorrectionID, callback, user_data | Captures and stores a flat-scene correction. |
delete_flat_scene_correction(fsc_id, callback, user_data) | fsc_id: SeekCameraFlatSceneCorrectionID, callback, user_data | Deletes a stored flat-scene correction. |
load_app_resources(region, data_size, callback, user_data) | region: SeekCameraAppResourcesRegion, data_size: int, callback, user_data | Reads customer app data from device flash. |
store_app_resources(region, data, data_size, callback, user_data) | region: SeekCameraAppResourcesRegion, data, data_size: int, callback, user_data | Writes customer app data to device flash. |
SeekCameraManager usage
SeekCameraManager is used as a context manager. Its constructor accepts a bitwise OR of SeekCameraIOType values.
| Parameter | Type | Required | Description |
|---|---|---|---|
io_type | int | Yes | Bitmask of SeekCameraIOType values indicating which transports to monitor. |
SeekCameraColorPaletteData constructor
| Parameter | Type | Required | Description |
|---|---|---|---|
data | Iterable[Tuple[int, int, int, int]] | No | 256 (b, g, r, a) tuples. Defaults to all zeros. |
SeekCameraFirmwareVersion constructor
| Parameter | Type | Required | Description |
|---|---|---|---|
product | int | No | Product field. Defaults to 0. |
variant | int | No | Variant field. Defaults to 0. |
major | int | No | Major field. Defaults to 0. |
minor | int | No | Minor field. Defaults to 0. |
Return values depend on whether you are calling a getter method, a context manager, or registering a callback.
SeekCameraManager.__enter__— Returns theSeekCameraManagerinstance itself, allowingwith SeekCameraManager(...) as manager:usage.SeekCamera.get_color_palette()— Returns aSeekCameraColorPaletteenum member.SeekCamera.get_pipeline_mode()— Returns aSeekCameraPipelineModeenum member.SeekCamera.get_agc_mode()— Returns aSeekCameraAGCModeenum member.SeekCamera.get_thermography_window()— Returns a 4-tuple(x, y, width, height)ofint.SeekCamera.get_firmware_version()— Returns aSeekCameraFirmwareVersioninstance.SeekCamera.get_chipid()— Returns astrof up to 16 characters.SeekCamera.get_serial_number()— Returns astrof up to 16 characters.SeekCamera.get_core_part_number()— Returns astrof up to 32 characters.SeekCamera.get_io_type()— Returns aSeekCameraIOTypeenum member.SeekCamera.get_io_properties()— Returns aSeekCameraIOPropertiesinstance whose.usbor.spifield is populated according to.type.- Setter methods (
set_color_palette,set_pipeline_mode, etc.) — ReturnNone; they raise on failure. - Frame callback (
register_frame_available_callback) — Your callback receives(camera: SeekCamera, camera_frame: SeekCameraFrame, user_data: Any)and must returnNone. SeekFrame.data— A NumPyndarraywhose dtype and shape depend on the frame format requested at session start.SeekCameraColorPaletteData.__len__()— Always returns256.is_error(status)— Returnsbool;Truewhenstatus != 0.error_from_status(status)— Returns the most-specificSeekCameraErrorsubclass that matches the given status code, orSeekCameraErroritself when no subclass matches.
All errors raised by this library are subclasses of SeekCameraError and originate from the underlying Seek Thermal C SDK status codes.
| Exception | Status Code | When it occurs |
|---|---|---|
SeekCameraError | (base) | Fallback when no specific subclass matches. |
SeekCameraDeviceCommunicationError | -1 | USB or SPI communication with the device failed. |
SeekCameraInvalidParameterError | -2 | A 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 | -3 | The process lacks OS-level permission to access the device (e.g., missing udev rules on Linux). |
SeekCameraNoDeviceError | -4 | A command was issued but no device is present. |
SeekCameraDeviceNotFoundError | -5 | The device was expected but could not be located. |
SeekCameraDeviceBusyError | -6 | The device is currently handling another request. |
SeekCameraTimeoutError | -7 | An operation did not complete within the allowed time. |
SeekCameraOverflowError | -8 | A buffer or counter overflow was detected. |
SeekCameraUnknownRequestError | -9 | The SDK received a request it did not recognise. |
SeekCameraInterruptedError | -10 | An in-progress operation was interrupted. |
SeekCameraOutOfMemoryError | -11 | Host memory allocation failed. |
SeekCameraNotSupportedError | -12 | The requested feature is not supported by this camera or firmware version. |
SeekCameraOtherError | -99 | An unclassified error occurred in the SDK. |
SeekCameraCannotPerformRequestError | -103 | The camera cannot perform the request in its current state. |
SeekCameraFlashAccessFailure | -104 | Reading from or writing to device flash failed. |
SeekCameraImplementationError | -105 | An internal SDK implementation error occurred. |
SeekCameraRequestPendingError | -106 | A previous request of the same type is still pending. |
SeekCameraInvalidFirmwareImageError | -107 | The firmware image file is corrupt or incompatible. |
SeekCameraInvalidKeyError | -108 | A cryptographic or licence key was invalid. |
SeekCameraSensorCommunicationError | -109 | The SDK could not communicate with the thermal sensor inside the camera. |
SeekCameraOutOfRangeError | -301 | A value exceeded the allowed range. |
SeekCameraVerifyFailedError | -302 | A post-operation verification check failed. |
SeekCameraSystemCallFailedError | -303 | A host OS system call returned an error. |
SeekCameraFileDoesNotExistError | -400 | A required file was not found on the host filesystem. |
SeekCameraDirectoryDoesNotExistError | -401 | A required directory was not found on the host filesystem. |
SeekCameraFileReadFailedError | -402 | Reading a file from the host filesystem failed. |
SeekCameraFileWriteFailedError | -403 | Writing a file to the host filesystem failed. |
SeekCameraNotImplementedError | -1000 | The called function is not yet implemented in this SDK version. |
SeekCameraNotPairedError | -1001 | The function requires a paired camera but the device is unpaired. Pair the camera first by handling the READY_TO_PAIR manager event. |
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_0 – USER_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)
SeekCameraColorPalette — full member list
| Member | Value | Description |
|---|---|---|
WHITE_HOT | 0 | Standard white-hot thermogram. |
BLACK_HOT | 1 | Inverted white-hot. |
SPECTRA | 2 | Spectra false-colour. |
PRISM | 3 | Prism false-colour. |
TYRIAN | 4 | Tyrian false-colour. |
IRON | 5 | Classic iron false-colour. |
AMBER | 6 | Amber false-colour. |
HI | 7 | Hi false-colour. |
GREEN | 8 | Green false-colour. |
USER_0–USER_4 | 9–13 | Customer-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.