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
soda_object_postprocess.cpp File Reference

EXIF-driven object-hit post-processing for SODA. More...

#include "soda_object_postprocess.h"
#include <fcntl.h>
#include <stddef.h>
#include <stdio.h>
#include <jpeglib.h>
#include "exifite.h"
#include <setjmp.h>
#include <unistd.h>
#include <algorithm>
#include <cerrno>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <new>
#include <string>
#include <vector>
#include "path_utils.h"
#include "jpeg_marker_guard.h"
Include dependency graph for soda_object_postprocess.cpp:

Go to the source code of this file.

Data Structures

struct  soda_object_postprocess_detail::ObjectDetection
struct  soda_object_postprocess_detail::CropBox
struct  soda_object_postprocess_detail::DecodedImage
struct  soda_object_postprocess_detail::JpegErrorContext

Namespaces

namespace  soda_object_postprocess_detail

Functions

void soda_object_postprocess_detail::jpeg_error_exit (j_common_ptr jpeg_info)
void soda_object_postprocess_detail::jpeg_message (j_common_ptr state, int level)
 Check JPEG marker bounds before forwarding a codec diagnostic.
bool soda_object_postprocess_detail::parse_object_summary (const std::string &comment_text, ObjectDetection *out)
 Parse an already-decoded EXIF_TAG_USER_COMMENT payload for an AICAM_OBJECTS_V1 hit. Kept separate from the EXIF/file I/O in read_object_detection() so the parsing logic is unit-testable against synthetic buffers without needing a real JPEG on disk.
bool soda_object_postprocess_detail::read_object_detection (const char *image_path, ObjectDetection *out)
 Read the AICAM_OBJECTS_V1 record usher's image_exif_write_object_detections() writes into EXIF_TAG_USER_COMMENT, if present and reporting count >= 1.
bool soda_object_postprocess_detail::sibling_directory (const char *image_path, const char *name, std::string *out)
std::string soda_object_postprocess_detail::basename_of (const char *image_path)
bool soda_object_postprocess_detail::copy_file_bytes (const char *source_path, const char *dest_path)
CropBox soda_object_postprocess_detail::compute_crop_box (int box_x, int box_y, int box_w, int box_h, unsigned img_w, unsigned img_h, double margin)
bool soda_object_postprocess_detail::decode_jpeg_rgb (const char *path, DecodedImage *image)
void soda_object_postprocess_detail::draw_box_outline (DecodedImage *image, int box_x, int box_y, int box_w, int box_h, int thickness)
bool soda_object_postprocess_detail::encode_cropped_jpeg (const char *path, const DecodedImage &image, const CropBox &box)
bool soda_object_postprocess_detail::write_all_atomic (int fd, const std::string &data)
std::string soda_object_postprocess_detail::csv_field (const std::string &value)
bool soda_object_postprocess_detail::append_detection_csv (const std::string &csv_path, const std::string &image_basename, const ObjectDetection &detection)
bool soda_process_object_detection (const char *image_path)
 Post-process a captured image for an object-detection hit, if it has one.

Variables

constexpr size_t soda_object_postprocess_detail::kAsciiCommentPrefixSize = 8
constexpr char soda_object_postprocess_detail::kObjectDetectionMarker [] = "\nAICAM_OBJECTS_V1\n"
constexpr size_t soda_object_postprocess_detail::kObjectLabelCapacity = 64
constexpr double soda_object_postprocess_detail::kCropMargin = 0.18
constexpr int soda_object_postprocess_detail::kBoxOutlineThickness = 4
constexpr size_t soda_object_postprocess_detail::kCopyChunkBytes = 65536
constexpr size_t soda_object_postprocess_detail::kCsvRowCapacity = 512
constexpr int soda_object_postprocess_detail::kCropJpegQuality = 95

Detailed Description

EXIF-driven object-hit post-processing for SODA.

This component does not run inference. It reads USHER's object record, creates sibling review copies and a padded crop, and appends one CSV row. The original flight JPEG is never changed.

Definition in file soda_object_postprocess.cpp.

Function Documentation

◆ soda_process_object_detection()

bool soda_process_object_detection ( const char * image_path)

Post-process a captured image for an object-detection hit, if it has one.

Create SODA review derivatives only when the source EXIF describes an object hit.

Returns
True for no-op/no-hit or complete processing; false when a detected hit could not be fully copied, cropped, or recorded.

Definition at line 581 of file soda_object_postprocess.cpp.