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
inference_image.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 inference_image.h
19 * @brief Source-independent, bounded model preprocessing with reversible coordinate bookkeeping. */
20#ifndef SENSORAIA_INFERENCE_IMAGE_H
21#define SENSORAIA_INFERENCE_IMAGE_H
22
23#include "onnx_session.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29/** @brief Accepted source layouts; Kelvin64 is little-endian native radiometric evidence. */
31/** @brief Destination memory order, independent of source strides. */
33/** @brief Explicit physical input domain; display brightness is never inferred to be a temperature. */
35
36/** @brief Borrowed immutable planes; lengths/strides prove all addressed rows are available. */
38 const unsigned char *planes[3];
39 size_t lengths[3], strides[3];
40 unsigned width, height;
42};
43
44/** @brief Model-owned preprocessing; normalized samples are (sample - mean) * scale. */
53
54/** @brief Exact resized content rectangle, including rounded letterbox offsets. */
59
60/** @brief Convert with the declared nearest-neighbor policy, not a guessed training transform.
61 * @param image Immutable bounded source planes.
62 * @param spec Validated model preprocessing contract.
63 * @param tensor Aligned writable destination, separate from the source planes.
64 * @param capacity Exact destination tensor bytes, not an oversized capacity hint.
65 * @param transform Source-to-input rectangle written for later result projection.
66 * @param error Writable failure diagnostic.
67 * @param error_capacity Available bytes in error.
68 * @return True after complete finite conversion; discard partial output/transform on false. */
70 const struct inference_image_spec *spec,
71 void *tensor, size_t capacity,
72 struct inference_image_transform *transform,
73 char *error, size_t error_capacity);
74/** @brief Map a model-input point back to source pixels, rejecting letterbox-only coordinates.
75 * @param transform Rectangle produced by successful preparation.
76 * @param input_x Horizontal model-input pixel coordinate.
77 * @param input_y Vertical model-input pixel coordinate.
78 * @param source_x Writable horizontal source coordinate.
79 * @param source_y Writable vertical source coordinate.
80 * @return True for a finite point inside the actual content, including its boundary. */
81bool inference_image_point(const struct inference_image_transform *transform,
82 double input_x, double input_y, double *source_x, double *source_y);
83
84#ifdef __cplusplus
85}
86#endif
87#endif
static unsigned capacity[COVERAGE_CAMERAS]
inference_layout
Destination memory order, independent of source strides.
@ INFERENCE_NHWC
@ INFERENCE_NCHW
bool inference_image_point(const struct inference_image_transform *transform, double input_x, double input_y, double *source_x, double *source_y)
Map a model-input point back to source pixels, rejecting letterbox-only coordinates.
inference_units
Explicit physical input domain; display brightness is never inferred to be a temperature.
@ INFERENCE_KELVIN
@ INFERENCE_PIXEL
@ INFERENCE_RAW_KELVIN64
@ INFERENCE_CELSIUS
bool inference_image_prepare(const struct inference_image *image, const struct inference_image_spec *spec, void *tensor, size_t capacity, struct inference_image_transform *transform, char *error, size_t error_capacity)
Convert with the declared nearest-neighbor policy, not a guessed training transform.
inference_pixel_format
Accepted source layouts; Kelvin64 is little-endian native radiometric evidence.
@ INFERENCE_KELVIN64
@ INFERENCE_RGB8
@ INFERENCE_GRAY8
@ INFERENCE_YUV420
struct jpeg_error_mgr error
Definition lwir_image.c:60
Bounded tensor bindings and cooperative execution policy, independent of CAM semantics.
onnx_element_type
Supported numeric types; values match the ONNX Runtime C ABI.
Model-owned preprocessing; normalized samples are (sample - mean) * scale.
enum inference_layout layout
enum inference_units units
enum onnx_element_type type
Exact resized content rectangle, including rounded letterbox offsets.
Borrowed immutable planes; lengths/strides prove all addressed rows are available.
const unsigned char * planes[3]
enum inference_pixel_format format
struct captured_image image
Definition usher.c:371