24 #pragma warning(disable: 4267 4244)
31 std::vector<float> dis;
32 std::vector<int> neigh;
34 int Required_neighbors_nbr =
n_neigh_+1;
37 std::vector<int> to_erase;
39 for (
size_t i = 1; i < neigh.size(); ++i)
45 ++Required_neighbors_nbr;
47 to_erase.push_back(i);
48 for(
int k = to_erase.size()-1; k>=0; --k)
50 neigh.erase(neigh.begin() + to_erase[k]);
51 dis.erase(dis.begin() + to_erase[k]);
64 Eigen::Vector3f& input,
65 std::vector<int>& indices,
66 std::vector<float>& dists,
69 int dim = input.size();
71 std::vector<float> query;
73 for (
int i = 0; i < dim; i++)
75 flann::Matrix<float> query_mat(&query[0], 1, dim);
79 flann::Matrix<int> indices_mat(&indices[0], 1, nn);
80 flann::Matrix<float> dists_mat(&dists[0], 1, nn);
100 index->knnSearch(query_mat, indices_mat, dists_mat, nn, flann::SearchParams(128));
113 Eigen::SelfAdjointEigenSolver<Eigen::Matrix3f> es(C);
114 return es.eigenvectors().col(0);
121 Eigen::MatrixXf centered_points (
n_neigh_, 3);
125 Eigen::Matrix3f C = centered_points.transpose()*centered_points/
n_neigh_;
137 int N_boundary_neihborhood = (int)(0.2*
neighborhood_.rows());
138 for(
int i = 1; i<=N_boundary_neihborhood; ++i)
140 r /= N_boundary_neihborhood;
148 thresh = sqrt((pow(
curvature_,2)/2)*(1+(sin(theta_m)/theta_m)) - pow(
mean,2));
155 float emax = Xmax+
noise_/2;
173 edge_direction /= edge_direction.norm();
191 for (
int i = 0; i<
weights_.size(); ++i)
198 Eigen::Vector3f pt_moy = Eigen::Vector3f::Zero();
209 proj_moy = sqrt(proj_moy);
247 std::vector<float> er_proj_squared(
n_neigh_);
249 er_proj_squared[c] = pow(
normal.dot(
dist_.row(c)),2);
250 std::sort(er_proj_squared.begin(), er_proj_squared.end());
332 moy_proj /= sum_poids;
424 if( moyErrorFirst_<moyErrorSecond_ && impactFirst_>min_points )