From e8c27766a757511b9a78056a14f50fea6a5a7712 Mon Sep 17 00:00:00 2001 From: cignoni Date: Sat, 30 Jan 2016 23:08:17 +0000 Subject: [PATCH] Added two methods for point cloud smoothing of quality (median and average) --- vcg/complex/algorithms/smooth.h | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/vcg/complex/algorithms/smooth.h b/vcg/complex/algorithms/smooth.h index 7e559a06..1e5a2382 100644 --- a/vcg/complex/algorithms/smooth.h +++ b/vcg/complex/algorithms/smooth.h @@ -628,6 +628,50 @@ public: int cnt; }; +static void PointCloudQualityAverage(MeshType &m, int neighbourSize=8, int iter=1) +{ + tri::RequireCompactness(m); + VertexConstDataWrapper ww(m); + KdTree kt(ww); + typename KdTree::PriorityQueue pq; + for(int k=0;k newQVec(m.vn); + for(int i=0;i ww(m); + KdTree kt(ww); + typename KdTree::PriorityQueue pq; + std::vector newQVec(m.vn); + for(int i=0;i qVec(pq.getNofElements()); + for(int j=0;j