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_analysis.h
Go to the documentation of this file.
1/*
2 * Copyright 2026 OpenUAS
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef SENSORAIA_LWIR_ANALYSIS_H
19#define SENSORAIA_LWIR_ANALYSIS_H
20/** @file
21 * @brief Optional saved-image adapter combining thermal detection, pose and projection.
22 *
23 * @details Compiled only in analysis builds (`LWIR_ENABLE_ANALYSIS=1`, see
24 * lwir_features.h); imagery-only builds contain none of this code or its static
25 * scratch storage. The adapter post-processes an LWIR JPEG that was already saved
26 * with its exact native temperature plane embedded (LWIRRAW1, or LWIRSIM1 for
27 * simulated evidence, read via lwir_container.h). It is invoked by lwircam after a
28 * capture is written and by the `--geolocate` command-line mode.
29 *
30 * Pipeline: temperature plane -> lwir_detect_hotspots() (pixel candidates) ->
31 * pose parsed from the image's EXIF ImageDescription -> optional
32 * lwir_geolocation_project() -> text record appended to EXIF UserComment.
33 * Detection and projection stay separate modules so they can be reused without
34 * JPEG or flight EXIF.
35 */
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40/** @brief Annotate a saved thermal JPEG without recompressing its display pixels.
41 * @param filename Exclusively owned image; native thermal and SENSOR02 evidence survive.
42 * @param calibration_path Projection calibration, or NULL for pixel-only results.
43 * @return Zero on success, otherwise -1. Missing pose/calibration is recorded, not invented.
44 * @details Serial worker adapter with its own bounded workspace. The underlying
45 * detector and projection interfaces remain usable without JPEG or flight EXIF.
46 *
47 * The record is written to EXIF UserComment after the existing ImageDescription
48 * text and a `LWIR_HOTSPOTS_V1` separator line. A record is still published (with
49 * a `status=` explaining why) when the thermal plane is invalid or absent, the pose
50 * is missing, calibration is missing/invalid/unverified, or nothing is detected.
51 * Coordinates appear only for `status=estimated` hotspots whose projection succeeds.
52 *
53 * @warning Not reentrant or thread-safe: all large buffers are file-scope statics.
54 * Call from one worker thread at a time.
55 * @warning Projection is not gated on capture timing. The record carries
56 * `capture_pose_synchronized` and `capture_pose_uncertainty_m`; consumers must
57 * reject or down-weight coordinates whose pose is not exposure-qualified (for
58 * example a host arrival timestamp).
59 * @note C has no exceptions; -1 is returned when the file cannot be read or
60 * rewritten, the detector rejects the plane, or the record would exceed its
61 * fixed 8192-byte buffer. errno may reflect the last failing system call but is
62 * not guaranteed to be meaningful. Failures before publishing leave the file
63 * untouched; with IMAGE_EXIF_ATOMIC_REPLACE a failed rewrite also keeps the
64 * original, whereas the in-place fallback offers no such guarantee.
65 */
66int lwir_geolocate_image(const char *filename, const char *calibration_path);
67
68#ifdef __cplusplus
69}
70#endif
71#endif
int lwir_geolocate_image(const char *filename, const char *calibration_path)
Annotate a saved thermal JPEG without recompressing its display pixels.
static const char * calibration_path