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 File Reference

Source-independent, bounded model preprocessing with reversible coordinate bookkeeping. More...

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

Go to the source code of this file.

Data Structures

struct  inference_image
 Borrowed immutable planes; lengths/strides prove all addressed rows are available. More...
struct  inference_image_spec
 Model-owned preprocessing; normalized samples are (sample - mean) * scale. More...
struct  inference_image_transform
 Exact resized content rectangle, including rounded letterbox offsets. More...

Enumerations

enum  inference_pixel_format { INFERENCE_RGB8 , INFERENCE_GRAY8 , INFERENCE_YUV420 , INFERENCE_KELVIN64 }
 Accepted source layouts; Kelvin64 is little-endian native radiometric evidence. More...
enum  inference_layout { INFERENCE_NCHW , INFERENCE_NHWC }
 Destination memory order, independent of source strides. More...
enum  inference_units { INFERENCE_PIXEL , INFERENCE_RAW_KELVIN64 , INFERENCE_KELVIN , INFERENCE_CELSIUS }
 Explicit physical input domain; display brightness is never inferred to be a temperature. More...

Functions

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.
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.

Detailed Description

Source-independent, bounded model preprocessing with reversible coordinate bookkeeping.

Definition in file inference_image.h.

Enumeration Type Documentation

◆ inference_layout

Destination memory order, independent of source strides.

Enumerator
INFERENCE_NCHW 
INFERENCE_NHWC 

Definition at line 32 of file inference_image.h.

◆ inference_pixel_format

Accepted source layouts; Kelvin64 is little-endian native radiometric evidence.

Enumerator
INFERENCE_RGB8 
INFERENCE_GRAY8 
INFERENCE_YUV420 
INFERENCE_KELVIN64 

Definition at line 30 of file inference_image.h.

◆ inference_units

Explicit physical input domain; display brightness is never inferred to be a temperature.

Enumerator
INFERENCE_PIXEL 
INFERENCE_RAW_KELVIN64 
INFERENCE_KELVIN 
INFERENCE_CELSIUS 

Definition at line 34 of file inference_image.h.

Function Documentation

◆ inference_image_point()

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.

Parameters
transformRectangle produced by successful preparation.
input_xHorizontal model-input pixel coordinate.
input_yVertical model-input pixel coordinate.
source_xWritable horizontal source coordinate.
source_yWritable vertical source coordinate.
Returns
True for a finite point inside the actual content, including its boundary.

Definition at line 154 of file inference_image.c.

◆ inference_image_prepare()

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.

Parameters
imageImmutable bounded source planes.
specValidated model preprocessing contract.
tensorAligned writable destination, separate from the source planes.
capacityExact destination tensor bytes, not an oversized capacity hint.
transformSource-to-input rectangle written for later result projection.
errorWritable failure diagnostic.
error_capacityAvailable bytes in error.
Returns
True after complete finite conversion; discard partial output/transform on false.

Definition at line 69 of file inference_image.c.