Loading...
Searching...
No Matches
soda_object_postprocess.cpp
Go to the documentation of this file.
Bounded C11 EXIF metadata and JPEG streaming interfaces.
int exif_parse(struct exif_view *view, const unsigned char *payload, size_t size)
Validate an EXIF APP1 payload and create a borrowed view.
Definition exifite.c:257
bool exif_get(const struct exif_view *view, enum exif_directory directory, uint16_t tag, struct exif_value *value)
Look up a directory-local tag without copying its bytes.
Definition exifite.c:310
int exif_read_jpeg(const char *filename, unsigned char *payload, size_t capacity, size_t *size)
Read the single EXIF APP1 segment before the first JPEG scan.
Definition exifite.c:1022
#define EXIF_MAX_PAYLOAD
APP1 payload ceiling: the JPEG length includes its own two bytes.
Definition exifite.h:51
Reject invalid Huffman selectors before the bundled codec indexes its tables.
static void usher_jpeg_validate_marker(j_common_ptr state)
Validate marker parameters from an error manager's emit_message callback.
Definition jpeg_marker_guard.h:29
void jpeg_message(j_common_ptr state, int level)
Check JPEG marker bounds before forwarding a codec diagnostic.
Definition soda_object_postprocess.cpp:121
void draw_box_outline(DecodedImage *image, int box_x, int box_y, int box_w, int box_h, int thickness)
Definition soda_object_postprocess.cpp:395
constexpr size_t kObjectLabelCapacity
Definition soda_object_postprocess.cpp:65
void jpeg_error_exit(j_common_ptr jpeg_info)
Definition soda_object_postprocess.cpp:112
bool 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....
Definition soda_object_postprocess.cpp:136
constexpr char kObjectDetectionMarker[]
Definition soda_object_postprocess.cpp:64
constexpr size_t kCopyChunkBytes
Definition soda_object_postprocess.cpp:75
bool sibling_directory(const char *image_path, const char *name, std::string *out)
Definition soda_object_postprocess.cpp:195
std::string csv_field(const std::string &value)
Definition soda_object_postprocess.cpp:514
constexpr size_t kAsciiCommentPrefixSize
Definition soda_object_postprocess.cpp:63
bool decode_jpeg_rgb(const char *path, DecodedImage *image)
Definition soda_object_postprocess.cpp:302
bool write_all_atomic(int fd, const std::string &data)
Definition soda_object_postprocess.cpp:505
bool copy_file_bytes(const char *source_path, const char *dest_path)
Definition soda_object_postprocess.cpp:223
constexpr size_t kCsvRowCapacity
Definition soda_object_postprocess.cpp:78
CropBox compute_crop_box(int box_x, int box_y, int box_w, int box_h, unsigned img_w, unsigned img_h, double margin)
Definition soda_object_postprocess.cpp:280
constexpr int kBoxOutlineThickness
Definition soda_object_postprocess.cpp:72
constexpr double kCropMargin
Definition soda_object_postprocess.cpp:68
bool 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_US...
Definition soda_object_postprocess.cpp:173
std::string basename_of(const char *image_path)
Definition soda_object_postprocess.cpp:208
bool append_detection_csv(const std::string &csv_path, const std::string &image_basename, const ObjectDetection &detection)
Definition soda_object_postprocess.cpp:538
constexpr int kCropJpegQuality
Definition soda_object_postprocess.cpp:80
bool encode_cropped_jpeg(const char *path, const DecodedImage &image, const CropBox &box)
Definition soda_object_postprocess.cpp:438
Small path and writable-directory helpers shared by USHER backends.
static int usher_ensure_directory(const char *path)
Create missing directory components and verify the final directory is writable.
Definition path_utils.h:97
bool soda_process_object_detection(const char *image_path)
Post-process a captured image for an object-detection hit, if it has one.
Definition soda_object_postprocess.cpp:581
EXIF-driven object-hit post-processing for SODA.
Borrowed bytes plus enough type information for safe interpretation.
Definition exifite.h:119
unsigned width
Definition soda_object_postprocess.cpp:99
unsigned height
Definition soda_object_postprocess.cpp:100
std::vector< unsigned char > pixels
Definition soda_object_postprocess.cpp:98
jmp_buf recovery
Definition soda_object_postprocess.cpp:106
void(* emit)(j_common_ptr, int)
Definition soda_object_postprocess.cpp:107
struct jpeg_error_mgr manager
Definition soda_object_postprocess.cpp:105
int box_h
Definition soda_object_postprocess.cpp:88
double confidence
Definition soda_object_postprocess.cpp:86
int box_x
Definition soda_object_postprocess.cpp:88
int box_y
Definition soda_object_postprocess.cpp:88
int box_w
Definition soda_object_postprocess.cpp:88
int count
Definition soda_object_postprocess.cpp:83
std::string label
Definition soda_object_postprocess.cpp:85