Skip to content

Commit df6a48c

Browse files
author
Alexandre Boulch
committed
correction of radius bug
1 parent 36137c7 commit df6a48c

File tree

1 file changed

+32
-30
lines changed

1 file changed

+32
-30
lines changed

pcl/PCL_normEst.h

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
/* License Information
22
*
33
* Copyright (C) 2013 Boulch Alexandre, Ecole Nationale des Ponts et Chaussees
4-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
5-
* software and associated documentation files (the "Software"), to deal in the Software
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
5+
* software and associated documentation files (the "Software"), to deal in the Software
66
* without restriction, including without limitation the rights to use, copy, modify, merge,
7-
* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
7+
* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
88
* to whom the Software is furnished to do so, subject to the following conditions:
9-
*
9+
*
1010
* The above copyright notice and this permission notice shall be included in all copies or
1111
* substantial portions of the Software.
1212
*
13-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
14-
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
15-
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16-
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
17-
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
13+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
14+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
15+
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
17+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
1818
* OR OTHER DEALINGS IN THE SOFTWARE.
1919
*
2020
* Note that this library relies on external libraries subject to their own license.
21-
* To use this software, you are subject to the dependencies license, these licenses
21+
* To use this software, you are subject to the dependencies license, these licenses
2222
* applies to the dependency ONLY and NOT this code.
2323
* Please refer below to the web sites for license informations.
2424
*
@@ -39,7 +39,7 @@
3939
#include <omp.h>
4040
#endif
4141

42-
#include <iostream>
42+
#include <iostream>
4343
#include <time.h>
4444
#include <vector>
4545
#include <set>
@@ -683,7 +683,7 @@ class PCL_Normal_Estimator{
683683
* @param points - table of random points in the unit ball
684684
* @param vecInt - table of random integers
685685
*/
686-
inline void generate_list_of_triplets(std::vector<Eigen::Vector3i> &triplets,
686+
inline void generate_list_of_triplets(std::vector<Eigen::Vector3i> &triplets,
687687
int plane_number, float radius1,
688688
float radius2,pcl::KdTreeFLANN<Point> &tree,
689689
Point & pt,
@@ -1024,9 +1024,9 @@ class PCL_Normal_Estimator{
10241024
permutation[j] = temp;
10251025
}
10261026

1027-
#if defined(_OPENMP) && defined(USE_OPENMP_FOR_NORMEST)
1028-
#pragma omp parallel for schedule(guided)
1029-
#endif
1027+
#if defined(_OPENMP) && defined(USE_OPENMP_FOR_NORMEST)
1028+
#pragma omp parallel for schedule(guided)
1029+
#endif
10301030
for(int per=0; per<(int)pts->size(); per++){
10311031

10321032
int n = permutation[per];
@@ -1133,9 +1133,9 @@ class PCL_Normal_Estimator{
11331133
permutation[j] = temp;
11341134
}
11351135

1136-
#if defined(_OPENMP) && defined(USE_OPENMP_FOR_NORMEST)
1137-
#pragma omp parallel for schedule(guided)
1138-
#endif
1136+
#if defined(_OPENMP) && defined(USE_OPENMP_FOR_NORMEST)
1137+
#pragma omp parallel for schedule(guided)
1138+
#endif
11391139
for(int per=0; per<(int)pts->size(); per++){
11401140

11411141
int n = permutation[per];
@@ -1260,9 +1260,9 @@ class PCL_Normal_Estimator{
12601260
permutation[j] = temp;
12611261
}
12621262

1263-
#if defined(_OPENMP) && defined(USE_OPENMP_FOR_NORMEST)
1264-
#pragma omp parallel for schedule(guided)
1265-
#endif
1263+
#if defined(_OPENMP) && defined(USE_OPENMP_FOR_NORMEST)
1264+
#pragma omp parallel for schedule(guided)
1265+
#endif
12661266
for(int per=0; per<(int)pts->size(); per++){
12671267

12681268
int n = permutation[per];
@@ -1395,9 +1395,9 @@ class PCL_Normal_Estimator{
13951395
permutation[j] = temp;
13961396
}
13971397

1398-
#if defined(_OPENMP) && defined(USE_OPENMP_FOR_NORMEST)
1399-
#pragma omp parallel for schedule(guided)
1400-
#endif
1398+
#if defined(_OPENMP) && defined(USE_OPENMP_FOR_NORMEST)
1399+
#pragma omp parallel for schedule(guided)
1400+
#endif
14011401
for(int per=0; per<(int)pts->size(); per++){
14021402

14031403
int n = permutation[per];
@@ -1425,6 +1425,7 @@ class PCL_Normal_Estimator{
14251425
}
14261426
}
14271427
}
1428+
radius2 = srqt(radius2);
14281429
float s_radius = radius2 / small_radius_factor;
14291430

14301431
//point cloud of neighbors and kdtree creation
@@ -1546,9 +1547,9 @@ class PCL_Normal_Estimator{
15461547
permutation[j] = temp;
15471548
}
15481549

1549-
#if defined(_OPENMP) && defined(USE_OPENMP_FOR_NORMEST)
1550-
#pragma omp parallel for schedule(guided)
1551-
#endif
1550+
#if defined(_OPENMP) && defined(USE_OPENMP_FOR_NORMEST)
1551+
#pragma omp parallel for schedule(guided)
1552+
#endif
15521553
for(int per=0; per<(int)pts->size(); per++){
15531554

15541555
int n = permutation[per];
@@ -1666,9 +1667,9 @@ class PCL_Normal_Estimator{
16661667
permutation[j] = temp;
16671668
}
16681669

1669-
#if defined(_OPENMP) && defined(USE_OPENMP_FOR_NORMEST)
1670-
#pragma omp parallel for schedule(guided)
1671-
#endif
1670+
#if defined(_OPENMP) && defined(USE_OPENMP_FOR_NORMEST)
1671+
#pragma omp parallel for schedule(guided)
1672+
#endif
16721673
for(int per=0; per<(int)pts->size(); per++){
16731674

16741675
int n = permutation[per];
@@ -1695,6 +1696,7 @@ class PCL_Normal_Estimator{
16951696
}
16961697
}
16971698
}
1699+
radius2 = sqrt(radius2);
16981700

16991701
std::vector<int>* cubes = new std::vector<int>[n_cubes*n_cubes*n_cubes];
17001702
unsigned int points_size = (unsigned int) pointIdxRadiusSearch.size();

0 commit comments

Comments
 (0)