Illustrated C/C++ source sheets, symbol index, API relationship graph, compiler console and debug trace

LIVE AI / FLEXIBLE SENSING / FLIGHT CONTEXT

Sensoraia API

Live AI and sensing, connected to the flight.
See, listen, inspect and return supported results while airborne.

Loading...
Searching...
No Matches
lwir_detection.h File Reference

Optional thermal candidate detection, independent of pose and image files. More...

#include "lwir_frame.h"
Include dependency graph for lwir_detection.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  lwir_hotspot
 A thermal component expressed only in native sensor coordinates. More...
struct  lwir_hotspot_set
 Bounded ranking, retaining the existing two-candidate mission policy. More...
struct  lwir_detection_workspace
 Caller-owned scratch storage; never reserved by an imagery-only build. More...

Functions

bool lwir_detect_hotspots (const uint8_t *temperature, size_t bytes, unsigned width, unsigned height, struct lwir_detection_workspace *workspace, struct lwir_hotspot_set *result)
 Rank native thermal components without touching hardware, pose or files.

Detailed Description

Optional thermal candidate detection, independent of pose and image files.

Compiled only in analysis builds (LWIR_ENABLE_ANALYSIS=1). Input is the exact native Kelvin*64 temperature plane embedded in a saved LWIR JPEG, never the compressed display pixels, so thresholds operate on sensor values. The detector does no I/O, uses no heap, and keeps all scratch storage in a caller-provided lwir_detection_workspace. lwir_analysis.c is the in-tree caller.

Definition in file lwir_detection.h.

Function Documentation

◆ lwir_detect_hotspots()

bool lwir_detect_hotspots ( const uint8_t * temperature,
size_t bytes,
unsigned width,
unsigned height,
struct lwir_detection_workspace * workspace,
struct lwir_hotspot_set * result )

Rank native thermal components without touching hardware, pose or files.

Parameters
temperatureImmutable little-endian Kelvin*64 plane.
bytesExact accessible plane length, width * height * 2.
widthNative width, at most LWIR_MAX_WIDTH.
heightNative height, at most LWIR_MAX_HEIGHT.
workspaceExclusive scratch storage for this call, separate from input/result.
resultBounded candidates; ignore on failure.
Returns
True for a valid plane, including a plane with no candidates or no valid codes at all (then background_celsius and threshold_celsius are NaN). False for NULL pointers, zero or oversized dimensions, or a length mismatch.

Threshold = max(60 C absolute, frame median + max(20 C, 6 robust sigma)), where robust sigma is 1.4826 x the median absolute deviation. Pixels at or above it form 8-connected components; each must exceed its local background by at least 15 C. See lwir_detection.c for the full algorithm. Endpoint codes 0 and 65535 are invalid samples: they are excluded from the frame median, noise estimate, components and local backgrounds.

Note
Temperatures are apparent sensor values without emissivity or atmospheric correction; the 60/100 C limits apply to those values.

Rank native thermal components without touching hardware, pose or files.

See lwir_detection.h for the contract and the file overview for the algorithm. All arithmetic stays in raw Kelvin*64 codes until results are converted to Celsius (code / 64 - 273.15); temperature differences convert by dividing by 64 only.

Returns
True for a valid plane (even with zero candidates); false for invalid arguments.

Definition at line 172 of file lwir_detection.c.