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_inference.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/** @file lwir_inference.h
19 * @brief Optional serialized LWIR model adapter, separate from USB capture and calibration.
20 * @details Built only with LWIR_ENABLE_ANALYSIS. Analyses an already saved photo and
21 * writes a separate sidecar; a failed analysis never affects the photograph. */
22#ifndef SENSORAIA_LWIR_INFERENCE_H
23#define SENSORAIA_LWIR_INFERENCE_H
24
25#include "inference_settings.h"
26
27/** @brief Open one explicit LWIR classifier with a declared pixel or radiometric input domain.
28 * @param settings Resolved ONNX settings owned by the caller.
29 * @param threshold Inclusive probability gate in [0,1].
30 * @param category Index within the model's finite probability vector.
31 * @param error Writable failure diagnostic.
32 * @param capacity Available bytes in error.
33 * @return True for a qualified classifier contract, not calibrated temperatures or detection accuracy.
34 * @pre Calls are serialized by the capture/analysis owner; configure before acquiring a live stream.
35 * @note @p error is overwritten even on success. Once open, later calls return true
36 * without applying new @p threshold or @p category; close first to change them. */
37bool lwir_inference_open(const struct inference_settings *settings, double threshold, unsigned category,
38 char *error, size_t capacity);
39/** @brief Classify one immutable JPEG/temperature plane and exclusively publish its model-identified sidecar.
40 * @param filename JPEG whose original compressed pixels and temperature evidence are never rewritten.
41 * @param sequence Producer correlation number, not proof of exposure synchronization.
42 * @param error Writable failure diagnostic.
43 * @param capacity Available bytes in error.
44 * @return True for complete inference/publication; false never invalidates the retained photograph.
45 * @details Sidecar is "<name>.lwir.ini" beside "<name>.jpg", created exclusively, so an
46 * existing sidecar makes the call fail instead of being replaced. */
47bool lwir_inference_image(const char *filename, unsigned long long sequence, char *error, size_t capacity);
48/** @brief Release the serialized classifier; repeated closes are harmless. */
49void lwir_inference_close(void);
50
51#endif
static unsigned capacity[COVERAGE_CAMERAS]
Shared application_settings.ini discovery with module-owned extra keys.
struct jpeg_error_mgr error
Definition lwir_image.c:60
void lwir_inference_close(void)
Release the serialized classifier; repeated closes are harmless.
bool lwir_inference_image(const char *filename, unsigned long long sequence, char *error, size_t capacity)
Classify one immutable JPEG/temperature plane and exclusively publish its model-identified sidecar.
bool lwir_inference_open(const struct inference_settings *settings, double threshold, unsigned category, char *error, size_t capacity)
Open one explicit LWIR classifier with a declared pixel or radiometric input domain.
Per-application configuration; all resolved paths belong to this caller-owned value.