test new version

This commit is contained in:
awe
2026-09-16 13:22:21 +03:00
parent b3339d101c
commit 16ccafff69
17 changed files with 213 additions and 37 deletions
@@ -164,7 +164,11 @@ auto load_collection(
return collection;
}
void print_projection_argmax(const radar::ipc::ResultPayload& payload, const char* row_axis_name) {
void print_projection_argmax(
const radar::ipc::ResultPayload& payload,
const char* col_axis_name,
const char* row_axis_name
) {
std::size_t argmax = 0U;
float best = -1.0F;
for (std::size_t index = 0U; index < payload.image_values.size(); ++index) {
@@ -177,9 +181,10 @@ void print_projection_argmax(const radar::ipc::ResultPayload& payload, const cha
const auto col = argmax % nx;
const auto row = argmax / nx;
std::printf(
"%s: max=%.6f at X=%.1f cm, %s=%.1f cm\n",
"%s: max=%.6f at %s=%.1f cm, %s=%.1f cm\n",
payload.processing_name.c_str(),
static_cast<double>(best),
col_axis_name,
static_cast<double>(payload.image_x_axis[col]) * 100.0,
row_axis_name,
static_cast<double>(payload.image_y_axis[row]) * 100.0
@@ -253,10 +258,26 @@ int main(int argc, char** argv) {
}
}
for (const auto& payload : result.collection_payloads) {
if (payload.kind != radar::ipc::ResultKind::ImageF32) {
continue;
if (payload.kind == radar::ipc::ResultKind::ImageF32 && payload.processing_name == "sar3d_proj_xz") {
print_projection_argmax(payload, "X", "Z");
}
}
// Bottom view across the selectable angles: the target's u coordinate must
// move smoothly from its X (front, 0 deg) to its Z (side, 90 deg).
const auto last_previous =
std::span<const radar::ipc::PreprocessedCollection>(history.data(), history.size() - 1U);
for (const float angle_deg : {0.0F, 30.0F, 60.0F, 90.0F}) {
auto live_angle = live;
live_angle.sar3d_bottom_view_deg = angle_deg;
const auto angle_result =
processor.process_collection(run_config, history.back(), last_previous, live_angle);
for (const auto& payload : angle_result.collection_payloads) {
if (payload.kind == radar::ipc::ResultKind::ImageF32 && payload.processing_name == "sar3d_proj_bottom") {
std::printf("bottom @ %2.0f deg -> ", static_cast<double>(angle_deg));
print_projection_argmax(payload, "u", "Y");
}
}
print_projection_argmax(payload, payload.processing_name == "sar3d_proj_xz" ? "Z" : "Y");
}
std::printf("OK: sar3d processor path completed\n");
return 0;