worked on signal-strength-estimation
add this information to grid nodes evaluate this information new test-cases
This commit is contained in:
@@ -159,12 +159,12 @@ public:
|
||||
template <typename T> bool isDoor( T& nSrc, std::vector<T*> neighbors ) {
|
||||
|
||||
MiniMat2 m;
|
||||
Point3 center = nSrc;
|
||||
Point3 center = nSrc.inCentimeter();
|
||||
|
||||
// calculate the centroid of the nSrc's nearest-neighbors
|
||||
Point3 centroid(0,0,0);
|
||||
for (const T* n : neighbors) {
|
||||
centroid = centroid + (Point3)*n;
|
||||
centroid = centroid + n->inCentimeter();
|
||||
}
|
||||
centroid /= neighbors.size();
|
||||
|
||||
@@ -174,7 +174,7 @@ public:
|
||||
// build covariance of the nearest-neighbors
|
||||
int used = 0;
|
||||
for (const T* n : neighbors) {
|
||||
Point3 d = (Point3)*n - center;
|
||||
Point3 d = n->inCentimeter() - center;
|
||||
if (d.length() > 100) {continue;} // radius search
|
||||
m.addSquared(d.x, d.y);
|
||||
++used;
|
||||
|
||||
Reference in New Issue
Block a user