| 8 | |
| 9 | |
| 10 | bool mark_as_picked(float * range_image_ptr, vector<vector<int>> &cloud_neighbors_picked, int h_i, int w_i, int feature_region){ |
| 11 | float near_threshold = 0.2, gap_threshold = 0.3; |
| 12 | int w = cloud_neighbors_picked[0].size(); |
| 13 | bool ret_flag = true; |
| 14 | |
| 15 | float r = range_image_ptr[h_i * w + w_i]; |
| 16 | for (int i = -feature_region; i <= feature_region; i++){ |
| 17 | float r_neighbor = range_image_ptr[h_i * w + w_i + i]; |
| 18 | float dif = r - r_neighbor; |
| 19 | if (abs(dif) < near_threshold) |
| 20 | cloud_neighbors_picked[h_i][w_i] = 1; |
| 21 | if (dif > gap_threshold) |
| 22 | ret_flag = false; |
| 23 | } |
| 24 | return ret_flag; |
| 25 | } |
| 26 | |
| 27 | |
| 28 | std::tuple<py::array_t<float>, py::array_t<int>> extract_features_with_segment(py::array_t<float> range_image, py::array_t<int> seg_idx, int feature_region, int segments, int sharp_num, int less_sharp_num, int flat_num) { |
no outgoing calls
no test coverage detected