Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cpp/open3d/geometry/SurfaceReconstructionPoisson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ void Execute(const open3d::geometry::PointCloud& pcd,
float width,
float scale,
bool linear_fit,
bool use_normal_length_as_confidence,
UIntPack<FEMSigs...>) {
static const int Dim = sizeof...(FEMSigs);
typedef UIntPack<FEMSigs...> Sigs;
Expand All @@ -421,6 +422,9 @@ void Execute(const open3d::geometry::PointCloud& pcd,
int base_depth = 0;
int base_v_cycles = 1;
float confidence = 0.f;
if (use_normal_length_as_confidence) {
confidence = 1.f;
}
Comment thread
shlok-ramlab marked this conversation as resolved.
float point_weight = 2.f * DEFAULT_FEM_DEGREE;
float confidence_bias = 0.f;
float samples_per_node = 1.5f;
Expand Down Expand Up @@ -721,6 +725,7 @@ TriangleMesh::CreateFromPointCloudPoisson(const PointCloud& pcd,
float width,
float scale,
bool linear_fit,
bool use_normal_length_as_confidence,
int n_threads) {
static const BoundaryType BType = DEFAULT_FEM_BOUNDARY;
typedef IsotropicUIntPack<
Expand All @@ -746,7 +751,7 @@ TriangleMesh::CreateFromPointCloudPoisson(const PointCloud& pcd,
auto mesh = std::make_shared<TriangleMesh>();
std::vector<double> densities;
Execute<float>(pcd, mesh, densities, static_cast<int>(depth), width, scale,
linear_fit, FEMSigs());
linear_fit, use_normal_length_as_confidence, FEMSigs());

ThreadPool::Terminate();

Expand Down
3 changes: 3 additions & 0 deletions cpp/open3d/geometry/TriangleMesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,8 @@ class TriangleMesh : public MeshBase {
/// for reconstruction and the diameter of the samples' bounding cube.
/// \param linear_fit If true, the reconstructor use linear interpolation to
/// estimate the positions of iso-vertices.
/// \param use_normal_length_as_confidence If true, use the length (norm)
/// of normal vectors as point confidence.
/// \param n_threads Number of threads used for reconstruction. Set to -1 to
/// automatically determine it.
/// \return The estimated TriangleMesh, and per vertex density values that
Expand All @@ -555,6 +557,7 @@ class TriangleMesh : public MeshBase {
float width = 0.0f,
float scale = 1.1f,
bool linear_fit = false,
bool use_normal_length_as_confidence = false,
int n_threads = -1);

Comment thread
shlok-ramlab marked this conversation as resolved.
/// Factory function to create a tetrahedron mesh (trianglemeshfactory.cpp).
Expand Down
7 changes: 6 additions & 1 deletion cpp/pybind/geometry/trianglemesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,9 @@ void pybind_trianglemesh_definitions(py::module &m) {
"This function uses the original implementation by "
"Kazhdan. See https://github.com/mkazhdan/PoissonRecon",
"pcd"_a, "depth"_a = 8, "width"_a = 0, "scale"_a = 1.1,
"linear_fit"_a = false, "n_threads"_a = -1)
"linear_fit"_a = false,
"use_normal_length_as_confidence"_a = false,
"n_threads"_a = -1)
Comment thread
shlok-ramlab marked this conversation as resolved.
Outdated
.def_static(
"create_from_oriented_bounding_box",
&TriangleMesh::CreateFromOrientedBoundingBox,
Expand Down Expand Up @@ -692,6 +694,9 @@ void pybind_trianglemesh_definitions(py::module &m) {
{"linear_fit",
"If true, the reconstructor will use linear interpolation to "
"estimate the positions of iso-vertices."},
{"use_normal_length_as_confidence",
"If true, use the length (norm) of normal vectors as "
"point confidence"},
Comment thread
shlok-ramlab marked this conversation as resolved.
Outdated
{"n_threads",
"Number of threads used for reconstruction. Set to -1 to "
"automatically determine it."}});
Expand Down