Source-independent, bounded model preprocessing with reversible coordinate bookkeeping. More...
#include "onnx_session.h"

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
| enum 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
| enum 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
-
transform Rectangle produced by successful preparation. input_x Horizontal model-input pixel coordinate. input_y Vertical model-input pixel coordinate. source_x Writable horizontal source coordinate. source_y Writable 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
-
image Immutable bounded source planes. spec Validated model preprocessing contract. tensor Aligned writable destination, separate from the source planes. capacity Exact destination tensor bytes, not an oversized capacity hint. transform Source-to-input rectangle written for later result projection. error Writable failure diagnostic. error_capacity Available bytes in error.
- Returns
- True after complete finite conversion; discard partial output/transform on false.
Definition at line 69 of file inference_image.c.