Skip to content
Merged
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
18 changes: 11 additions & 7 deletions tools/depth-quality/depth-quality-model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,12 +688,12 @@ namespace rs2
static float prev_metric_angle = 0;
if (_viewer_model.paused)
{
ImGui::Text("%.2f mm", prev_metric_angle);
ImGui::Text("%.2f deg", prev_metric_angle);
}
else
{
auto curr_metric_angle = _metrics_model.get_last_metrics().angle;
ImGui::Text("%.2f mm", curr_metric_angle);
ImGui::Text("%.2f deg", curr_metric_angle);
prev_metric_angle = curr_metric_angle;
}

Expand Down Expand Up @@ -1149,9 +1149,12 @@ namespace rs2

// Generate columns header
csv << "\nSample Id,Frame #,Timestamp (ms),";
for (auto&& matric : _metric_data)
auto records_data = _metric_data;
// Plane Fit RMS error will have dual representation both as mm and % of the range
records_data.push_back({ "Plane Fit RMS Error mm" , "" });
for (auto&& metric : records_data)
{
csv << matric.name << " " << matric.units << ",";
csv << metric.name << " " << metric.units << ",";
}
csv << std::endl;

Expand All @@ -1160,10 +1163,11 @@ namespace rs2
for (auto&& it: _samples)
{
csv << i++ << ","<< it.frame_number << "," << std::fixed << std::setprecision(4) << it.timestamp << ",";
for (auto&& matric : _metric_data)
for (auto&& metric : records_data)
{
auto samp = std::find_if(it.samples.begin(), it.samples.end(), [&](single_metric_data s) {return s.name == matric.name; });
if(samp != it.samples.end()) csv << samp->val << ",";
auto samp = std::find_if(it.samples.begin(), it.samples.end(), [&](single_metric_data s) {return s.name == metric.name; });
if (samp != it.samples.end()) csv << samp->val;
csv << ",";
}
csv << std::endl;
}
Expand Down
8 changes: 6 additions & 2 deletions tools/depth-quality/rs-depth-quality.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int main(int argc, const char * argv[]) try
" i=1 ");

metric sub_pixel_rms_error = model.make_metric(
"Subpixel RMS Error", 0.f, 1.f, true, "(pixel)",
"Subpixel RMS Error", 0.f, 1.f, true, "pixel",
"Subpixel RMS Error .\n"
"This metric provides the subpixel accuracy\n"
"and is calculated as follows:\n"
Expand Down Expand Up @@ -153,7 +153,11 @@ int main(int argc, const char * argv[]) try
auto rms_error_val = static_cast<float>(std::sqrt(plane_fit_err_sqr_sum / distances.size()));
auto rms_error_val_per = TO_PERCENT * (rms_error_val / distance_mm);
plane_fit_rms_error->add_value(rms_error_val_per);
if (record) samples.push_back({ plane_fit_rms_error->get_name(), rms_error_val });
if (record)
{
samples.push_back({ plane_fit_rms_error->get_name(), rms_error_val_per });
samples.push_back({ plane_fit_rms_error->get_name() + " mm", rms_error_val });
}

});

Expand Down