Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions include/cv/aggregator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
#include "utilities/lockptr.hpp"

struct AggregatedRun {
int run_id; // Unique integer ID for this pipeline run
cv::Mat annotatedImage; // The "big image" with bounding boxes drawn
std::vector<Bbox> bboxes; // All bounding boxes in that image
std::vector<GPSCoord> coords; // Matching lat-longs for each bounding box
int run_id; // Unique integer ID for this pipeline run
cv::Mat annotatedImage; // The "big image" with bounding boxes drawn
std::vector<Bbox> bboxes; // All bounding boxes in that image
std::vector<GPSCoord> coords; // Matching lat-longs for each bounding box
std::vector<AirdropType> targetTypes; // The corrsponding target types for each detection
};

struct CVResults {
Expand Down
1 change: 1 addition & 0 deletions src/camera/mock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ std::optional<ImageData> MockCamera::takePicture(const std::chrono::milliseconds
"&alt_ft=" + std::to_string(static_cast<int>((telemetry.altitude_agl_m * 3.281))) + //NOLINT
"&heading=" + std::to_string(telemetry.heading_deg) +
"&format=png");
// httplib::Result res = cli.Get("/generate?&format=png");

if (!res || res->status != 200) {
LOG_F(ERROR, "Failed to query server for images");
Expand Down
4 changes: 2 additions & 2 deletions src/cv/aggregator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ void CVAggregator::worker(ImageData image, int thread_num) {
run.annotatedImage = pipeline_results.imageData.DATA.clone();
run.bboxes.reserve(pipeline_results.targets.size());
run.coords.reserve(pipeline_results.targets.size());

run.targetTypes.reserve(pipeline_results.targets.size());
for (auto& det : pipeline_results.targets) {
run.bboxes.push_back(det.bbox);
run.coords.push_back(det.coord);
run.targetTypes.push_back(det.likely_airdrop);
}

{
Lock lock(this->mut);
this->results->runs.push_back(std::move(run));
Expand Down
2 changes: 2 additions & 0 deletions src/network/gcs_routes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ DEF_GCS_HANDLE(Get, targets, all) {
proto_bbox->set_y1(run.bboxes[i].y1);
proto_bbox->set_x2(run.bboxes[i].x2);
proto_bbox->set_y2(run.bboxes[i].y2);
// Add a target type
target.add_target_type(run.targetTypes[i]);
}

// copy the target to a record object to store
Expand Down