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

Bounded pixel/thermal conversion shared by live frames and decoded JPEG rows. More...

#include "inference_image.h"
#include <math.h>
#include <stdint.h>
#include <stdio.h>
Include dependency graph for inference_image.c:

Go to the source code of this file.

Functions

static bool plane_valid (const struct inference_image *image, size_t plane, unsigned width, unsigned height, unsigned bytes)
 Prove the last addressed row fits before any stride-based pointer arithmetic.
static double limited (double value)
 Clamp full-range JPEG/YUV color conversion without changing the raw source evidence.
static bool source_pixel (const struct inference_image *image, const struct inference_image_spec *spec, unsigned column, unsigned row, double pixel[3])
 Read one native pixel; missing thermal samples never become invented finite temperatures.
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

Bounded pixel/thermal conversion shared by live frames and decoded JPEG rows.

Resize, channel order and physical units are declared model policy, not camera defaults.

Definition in file inference_image.c.

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.

◆ limited()

double limited ( double value)
static

Clamp full-range JPEG/YUV color conversion without changing the raw source evidence.

Definition at line 38 of file inference_image.c.

◆ plane_valid()

bool plane_valid ( const struct inference_image * image,
size_t plane,
unsigned width,
unsigned height,
unsigned bytes )
static

Prove the last addressed row fits before any stride-based pointer arithmetic.

Definition at line 28 of file inference_image.c.

◆ source_pixel()

bool source_pixel ( const struct inference_image * image,
const struct inference_image_spec * spec,
unsigned column,
unsigned row,
double pixel[3] )
static

Read one native pixel; missing thermal samples never become invented finite temperatures.

Definition at line 44 of file inference_image.c.