Skip to content

Commit

Permalink
split min_cnt_range parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Ylannl committed Apr 14, 2020
1 parent 01e9278 commit 219b090
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/stepedge_nodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<size_t> 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();

Expand Down
5 changes: 4 additions & 1 deletion src/stepedge_nodes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,8 @@ namespace geoflow::nodes::stepedge {
bool linear_knn = false;
float dist_thres = 0.4;
std::pair<int,int> 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;
Expand Down Expand Up @@ -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"));
Expand Down

0 comments on commit 219b090

Please sign in to comment.