void print_stats(const Pyramid& p, level_t lv) { using namespace stats; if (lv > 0) { std::cout << std::endl << analyse_weights(p.get_links(), lv); } std::cout << std::endl << detail::analyse("area", p.get_area()[lv]); std::cout << std::endl << detail::analyse("looks", p.get_looks()[lv]); std::cout << std::endl << detail::analyse("var", p.get_var()[lv]); std::cout << std::endl << detail::analyse("v1_00", p.get_value1()[lv], 0); std::cout << std::endl << detail::analyse("v1_11", p.get_value1()[lv], 1); std::cout << std::endl << detail::analyse("v1_22", p.get_value1()[lv], 2); std::cout << std::endl << detail::analyse("v2_00", p.get_value2()[lv], 0); std::cout << std::endl << detail::analyse("v2_11", p.get_value2()[lv], 1); std::cout << std::endl << detail::analyse("v2_22", p.get_value2()[lv], 2); std::cout << std::endl; }
void smooth_helper(Pyramid& p, smooth_level_fun smooth, const size_t top_level) { using boost::irange; using boost::adaptors::reversed; using namespace std; auto cnt = 0; auto v_copy = ImagePyramid{p.get_value2()}; auto w_copy = LinkPyramid{p.get_links()}; auto levels = irange(0ul, top_level + 1); for (const auto lv : levels | reversed) { cout << "Smoothing Level " << lv << " ... "; cnt += smooth(v_copy, w_copy, lv); cout << endl; } p.set_result(v_copy.bottom()); cout << "Done." << endl; cout << "Number of Segments: " << cnt << endl; }