From 219b09052d040a3c7badb7b4ba38196a1929c169 Mon Sep 17 00:00:00 2001 From: Ylannl Date: Tue, 14 Apr 2020 22:31:44 +0200 Subject: [PATCH] split min_cnt_range parameter --- src/stepedge_nodes.cpp | 4 +--- src/stepedge_nodes.hpp | 5 ++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/stepedge_nodes.cpp b/src/stepedge_nodes.cpp index 54915d1..3644af3 100644 --- a/src/stepedge_nodes.cpp +++ b/src/stepedge_nodes.cpp @@ -1838,12 +1838,10 @@ void BuildArrFromLinesNode::process() { inline void DetectLinesNode::detect_lines_ring_m1(linedect::LineDetector& LD, SegmentCollection& segments_out) { LD.dist_thres = dist_thres * dist_thres; LD.N = k; - auto& c_upper = min_cnt_range.first; - auto& c_lower = min_cnt_range.second; std::vector detected_regions; size_t ringsize = LD.point_segment_idx.size(); RingSegMap ring_seg_map; - for (size_t i=c_upper; i>=c_lower; --i){ + for (size_t i=min_cnt_range_upper; i>=min_cnt_range_lower; --i){ LD.min_segment_count = i; auto new_regions = LD.detect(); diff --git a/src/stepedge_nodes.hpp b/src/stepedge_nodes.hpp index 08d246e..b401b46 100644 --- a/src/stepedge_nodes.hpp +++ b/src/stepedge_nodes.hpp @@ -397,6 +397,8 @@ namespace geoflow::nodes::stepedge { bool linear_knn = false; float dist_thres = 0.4; std::pair min_cnt_range = {5,10}; + int min_cnt_range_lower = 5; + int min_cnt_range_upper = 10; int k = 10; float snap_threshold = 1; float line_extend = 0.05; @@ -425,7 +427,8 @@ namespace geoflow::nodes::stepedge { add_param(ParamBool(linear_knn, "linear_knn", "Use linear neighbourhood for ring input")); add_param(ParamFloat(dist_thres, "dist_thres", "dist_thres")); - add_param(ParamIntRange(min_cnt_range, "min_cnt_range", "Minimum segment count")); + add_param(ParamInt(min_cnt_range_lower, "min_cnt_range_lower", "Minimum count lower")); + add_param(ParamInt(min_cnt_range_upper, "min_cnt_range_upper", "Minimum count upper")); add_param(ParamInt(k, "k", "k")); add_param(ParamFloat(snap_threshold, "snap_threshold", "Chain snap thres")); add_param(ParamFloat(line_extend, "line_extend", "Extend lines"));