Skip to content

Commit b8cadee

Browse files
feat: inverse the normals that have z component under -0.8
1 parent 07eccda commit b8cadee

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/diffCheck/geometry/DFPointCloud.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,14 @@ namespace diffCheck::geometry
155155
DIFFCHECK_INFO("Default estimation of normals with knn = 30");
156156
}
157157
for (auto &normal : O3DPointCloud->normals_)
158+
{
159+
if(normal.z() < -0.8)
160+
{
161+
normal = -normal;
162+
}
158163
this->Normals.push_back(normal);
164+
}
165+
159166
}
160167
else
161168
{
@@ -165,7 +172,13 @@ namespace diffCheck::geometry
165172

166173
this->Normals.clear();
167174
for (int i = 0; i < cilantroPointCloud->normals.cols(); i++)
175+
{
176+
if(cilantroPointCloud->normals.col(i).z() < -0.8)
177+
{
178+
cilantroPointCloud->normals.col(i) = -cilantroPointCloud->normals.col(i);
179+
}
168180
this->Normals.push_back(cilantroPointCloud->normals.col(i).cast<double>());
181+
}
169182
DIFFCHECK_INFO(("Estimating normals with cilantro evaluator with knn = " + std::to_string(knn.value())).c_str());
170183
}
171184

0 commit comments

Comments
 (0)