Associate detections with the native thermal samples of a saved LWIR frame. More...
#include "lwir_spotter.h"#include "spotter_cam_pipe.h"#include "imx500_pipe.h"#include "camera_profile.h"#include "bounded_ini.h"#include "lwir_container.h"#include "lwir_render.h"#include <errno.h>#include <limits.h>#include <math.h>#include <stdio.h>#include <string.h>#include <sys/stat.h>#include <unistd.h>
Go to the source code of this file.
Macros | |
| #define | USHER_SPOTTERCAM_COMMAND "./bin/spottercam" |
Functions | |
| bool | lwir_spotter_settings (const char *settings) |
| Select a separate ONNX detector assignment. | |
| bool | lwir_spotter_profile (const char *filename) |
| Load a native LWIR intrinsics and mount profile. | |
| bool | lwir_spotter_limits (const char *limits) |
| Set the timing and pose uncertainty limits for projection. | |
| bool | lwir_spotter_enabled (void) |
| Test whether saved-LWIR analysis was explicitly selected. | |
| void | lwir_spotter_stop (void) |
| Stop the exclusively owned model worker. | |
| static bool | same_file (const struct stat *before, const struct stat *after) |
| Check whether an image still matches its pre-analysis metadata. | |
| int | lwir_spotter_analyze (const char *filename, const union dc_shot_union *shot, const struct capture_timing *timing, const volatile sig_atomic_t *running) |
| Analyse one immutable image with copied capture evidence; no camera is acquired. | |
Variables | |
| static struct imx500_pipe | analysis = IMX500_PIPE_INITIALIZER |
| static const char * | selected_settings |
| static struct usher_camera_profile | profile |
| static bool | profile_loaded |
| static unsigned | request_sequence |
| static uint64_t | maximum_interval_us = 5000 |
| static double | maximum_uncertainty_m = 1.0 |
| static uint8_t | combined [256U *192U *4U] |
| static struct spotter_detections | detections |
Detailed Description
Associate detections with the native thermal samples of a saved LWIR frame.
Reuse the Spottercam analysis worker on already-published captures. Keep display coordinates, native sensor coordinates, and optional geographic estimates distinct. The image is checked again before the sidecar is published so a replaced capture is not silently paired with another frame's detections.
Definition in file lwir_spotter.c.
Macro Definition Documentation
◆ USHER_SPOTTERCAM_COMMAND
| #define USHER_SPOTTERCAM_COMMAND "./bin/spottercam" |
Definition at line 43 of file lwir_spotter.c.
Function Documentation
◆ lwir_spotter_analyze()
| int lwir_spotter_analyze | ( | const char * | filename, |
| const union dc_shot_union * | shot, | ||
| const struct capture_timing * | timing, | ||
| const volatile sig_atomic_t * | running ) |
Analyse one immutable image with copied capture evidence; no camera is acquired.
Caller serializes calls. Geographic results require qualified exposure timing and pose; an unavailable position never invalidates a good image result.
- Parameters
-
filename Path to the published LWIR JPEG with embedded thermal evidence. shot Capture trigger carrying the photo number. timing Frame delivery and optional exposure/pose evidence for this image. running Cancellation flag passed to the subprocess wrapper.
- Returns
- Zero for disabled or successful analysis, minus one on failure.
Definition at line 118 of file lwir_spotter.c.
◆ lwir_spotter_enabled()
| bool lwir_spotter_enabled | ( | void | ) |
Test whether saved-LWIR analysis was explicitly selected.
- Returns
- True if a settings path has been selected.
This reports configuration, not worker readiness or model validity.
Definition at line 91 of file lwir_spotter.c.
◆ lwir_spotter_limits()
| bool lwir_spotter_limits | ( | const char * | limits | ) |
Set the timing and pose uncertainty limits for projection.
- Parameters
-
limits Comma-separated maximum exposure interval in microseconds and maximum pose uncertainty in metres.
- Returns
- True if both positive bounds were accepted.
Apply both limits together after parsing, before the worker starts. They constrain geographic estimates, not pixel-space detection.
Definition at line 74 of file lwir_spotter.c.
◆ lwir_spotter_profile()
| bool lwir_spotter_profile | ( | const char * | profile | ) |
Load a native LWIR intrinsics and mount profile.
- Parameters
-
profile Path of the camera profile to read.
- Returns
- True if an LWIR profile with 256 by 192 calibration was loaded.
Validate a candidate before replacing the current profile. A profile cannot be replaced while the analysis worker is live.
Definition at line 63 of file lwir_spotter.c.
◆ lwir_spotter_settings()
| bool lwir_spotter_settings | ( | const char * | settings | ) |
Select a separate ONNX detector assignment.
- Parameters
-
settings Borrowed settings path; keep it valid while analysis is enabled.
- Returns
- True if the path was accepted; false for an empty path or a live worker.
Store the selection without starting a worker. The first analysis request loads the assignment.
Definition at line 56 of file lwir_spotter.c.
◆ lwir_spotter_stop()
| void lwir_spotter_stop | ( | void | ) |
Stop the exclusively owned model worker.
Call after the analysis owner has joined. Stopping the process does not clear the selected settings.
Definition at line 96 of file lwir_spotter.c.
◆ same_file()
|
static |
Check whether an image still matches its pre-analysis metadata.
- Parameters
-
before Metadata captured before reading the image. after Metadata captured after a later processing step.
- Returns
- True if the later file is regular and the identity and metadata match.
Device and inode catch replacement; size, modification time and change time detect ordinary in-place edits without rereading the image. This check is not a content hash.
Definition at line 110 of file lwir_spotter.c.
Variable Documentation
◆ analysis
|
static |
Definition at line 46 of file lwir_spotter.c.
◆ combined
|
static |
Definition at line 53 of file lwir_spotter.c.
◆ detections
|
static |
Definition at line 54 of file lwir_spotter.c.
◆ maximum_interval_us
|
static |
Definition at line 51 of file lwir_spotter.c.
◆ maximum_uncertainty_m
|
static |
Definition at line 52 of file lwir_spotter.c.
◆ profile
|
static |
Definition at line 48 of file lwir_spotter.c.
◆ profile_loaded
|
static |
Definition at line 49 of file lwir_spotter.c.
◆ request_sequence
|
static |
Definition at line 50 of file lwir_spotter.c.
◆ selected_settings
|
static |
Definition at line 47 of file lwir_spotter.c.