Skip to content

Commit

Permalink
Merge pull request #6434 from ev-mp/dqt_enh
Browse files Browse the repository at this point in the history
Handle DQT UI fixes and enhancements
  • Loading branch information
ev-mp committed May 21, 2020
2 parents 0bb2efa + a8f58f3 commit 2e684e7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
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

0 comments on commit 2e684e7

Please sign in to comment.