X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;f=cpp%2FsampleMinMax%2FsampleMinMax.cpp;h=90ef6d5e8f42552de01a5497a917514f7c86a931;hb=0e07bf0e102380c7ba033175b97ffbe1b020d28b;hp=f637504e848fb775e6931fc999bf728100cc25e0;hpb=84ddb72314a322d17ef0bf69d5df279ae90f1c09;p=201903hackathon.git diff --git a/cpp/sampleMinMax/sampleMinMax.cpp b/cpp/sampleMinMax/sampleMinMax.cpp index f637504..90ef6d5 100644 --- a/cpp/sampleMinMax/sampleMinMax.cpp +++ b/cpp/sampleMinMax/sampleMinMax.cpp @@ -54,6 +54,9 @@ class MyListener : public royale::IDepthDataListener static const uint8_t confidence_threshold_=128; + double last_min_=0; + double last_max_=0; + public: /** * This callback is called for each depth frame that is captured. In a mixed-mode use case @@ -98,10 +101,10 @@ public: std::vector asciiFrame; double min=9999999999.0, max=-99999999999999.0; uint32_t num_values_passing_threshold=0; - uint32_t num_max_size=data->height*data->width; - for (auto y = 0u; y < data->height; y++) + uint32_t num_max_size=data->height/3*data->width/3; + for (auto y = data->height/3; y < data->height/3*2; y++) { - for (auto x = 0u; x < data->width; x++) + for (auto x = data->width/3; x < data->width/3*2; x++) { auto point = data->points[y*data->width+x]; if (point.depthConfidence < confidence_threshold_) @@ -117,7 +120,9 @@ public: } } } - std::cout << "min:" << min << " " << "max:" << max << " %good:" << (static_cast(num_values_passing_threshold)/static_cast(num_max_size)*100.0) << std::endl; + std::cout << "min:" << min << "(diff:" << (last_min_-min) << ")" << " " << "max:" << max << "(diff:" << (last_max_-max) << ")" << " %good:" << (static_cast(num_values_passing_threshold)/static_cast(num_max_size)*100.0) << std::endl; + last_min_=min; + last_max_=max; } /**