Object-model decoder, detection sidecar writer and detector entry point. More...
#include <algorithm>#include <array>#include <cerrno>#include <cmath>#include <cstdio>#include <cstdlib>#include <cstring>#include <chrono>#include <poll.h>#include <sys/stat.h>#include <unistd.h>#include "version.h"#include "inference_worker.h"#include "spotter_targets.h"#include "camera_profile.h"#include "imx500_camera.hpp"#include "imx500_tensor.h"#include "inference_capture.hpp"
Go to the source code of this file.
Data Structures | |
| struct | spottercam::BasicDetection |
| One accepted object in final still-image coordinates. More... | |
| struct | spottercam::BasicResult |
| struct | TargetTransaction |
| Publish a proposed slot and commit only after the transport confirms it. More... | |
Namespaces | |
| namespace | spottercam |
Functions | |
| uint32_t | spottercam::read_u32 (const uint8_t *data) |
| BasicResult | spottercam::decode (imx500::Span< const float > tensor, imx500::Span< const uint8_t > info, libcamera::Rectangle crop, libcamera::Size image) |
| BasicResult | spottercam::frame_result (const imx500::FrameView &frame) |
| Interpret only the detector model's outputs from this retained exposure. | |
| bool | spottercam::detector_ready (const imx500::FrameView &frame) |
| Qualify startup from a valid detector head, including zero detections. | |
| bool | spottercam::write_detections (const imx500::FrameView &frame, const char *filename) |
| Publish detector results, never LOOM features or navigation evidence. | |
| static int | simulation_mode (int argc, char **argv) |
| Select simulation input using the common bounded settings parser. | |
| static int | project_ground (int argc, char **argv) |
| Project one delivered-image point with the shared camera/coverage geometry. | |
| static int | target_line (char *line, size_t capacity, bool acknowledgement) |
| Read one bounded printable protocol line. | |
| static bool | publish_target (void *context, unsigned slot, const spotter_target *target) |
| Propose a target update and require its matching acknowledgement. | |
| static int | target_server () |
| Run a bounded, model-independent geographic target stream. | |
| int | main (int argc, char **argv) |
| Select detector-specific policy, then run neutral capture mechanics. | |
Detailed Description
Object-model decoder, detection sidecar writer and detector entry point.
Camera/DMA/JPEG ownership belongs to imx500_camera.cpp. This application interprets retained frame metadata only as object boxes; it contains no LOOM feature processing, reference matching or waypoint policy. A structurally valid empty detection result is useful evidence and differs from missing or malformed inference; keep that distinction when extending the model contract.
Definition in file spotter_cam.cpp.
Function Documentation
◆ main()
| int main | ( | int | argc, |
| char ** | argv ) |
Select detector-specific policy, then run neutral capture mechanics.
- Parameters
-
argc Command-line token count. argv Version or probe/capture/serve arguments.
- Returns
- Zero on success, two for syntax errors, one for worker failure.
The explicit .objects.ini callback keeps object interpretation out of the shared camera and out of LOOM's independently linked executable.
Definition at line 763 of file spotter_cam.cpp.
◆ project_ground()
|
static |
Project one delivered-image point with the shared camera/coverage geometry.
Emits east/north offsets, not a new navigation command. The caller supplies the observed pose and retains ownership of the geographic datum.
Definition at line 622 of file spotter_cam.cpp.
◆ publish_target()
|
static |
Propose a target update and require its matching acknowledgement.
- Parameters
-
[in,out] context Active TargetTransaction holding the correlation sequence. slot Proposed target slot. target Borrowed ranked target observation.
- Returns
- True only if the peer acknowledged this transaction.
Flush before reading the reply. Distinguish a missing or malformed line from a complete nonmatching response so the caller can detect channel failure.
Definition at line 699 of file spotter_cam.cpp.
◆ simulation_mode()
|
static |
Select simulation input using the common bounded settings parser.
Only an absent model permits fabricated spotting. A present ONNX file is qualified by the normal shared analysis worker, never by this probe.
Definition at line 553 of file spotter_cam.cpp.
◆ target_line()
|
static |
Read one bounded printable protocol line.
- Parameters
-
[out] line Buffer for the line, newline and terminator. capacity Total buffer bytes. acknowledgement True to impose a deadline on the read.
- Returns
- One for a complete line, zero for clean EOF, or -1 on failure.
Keep one deadline across all bytes of an acknowledgement so a partially responsive peer cannot prolong a pending transaction indefinitely.
Definition at line 669 of file spotter_cam.cpp.
◆ target_server()
|
static |
Run a bounded, model-independent geographic target stream.
- Returns
- Zero on orderly EOF, two for malformed/out-of-order input, one for I/O failure.
OBS sequence latitude longitude ellipsoid_mm score proposes one observation. MOVE awaits ACK sequence; OK commits, SKIP retains existing slots. Restarting the worker clears all five slots without moving any FC waypoint.
Definition at line 718 of file spotter_cam.cpp.