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

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
-
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.
◆ limited()
|
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()
|
static |
Prove the last addressed row fits before any stride-based pointer arithmetic.
Definition at line 28 of file inference_image.c.
◆ source_pixel()
|
static |
Read one native pixel; missing thermal samples never become invented finite temperatures.
Definition at line 44 of file inference_image.c.