fixed typo in normal, added gt point 3d
This commit is contained in:
@@ -251,9 +251,9 @@ namespace Floorplan {
|
|||||||
/** a GroundTruthPoint located somewhere on a floor */
|
/** a GroundTruthPoint located somewhere on a floor */
|
||||||
struct GroundTruthPoint {
|
struct GroundTruthPoint {
|
||||||
int id; //TODO: this value can be changed and isn't set incremental within the indoormap
|
int id; //TODO: this value can be changed and isn't set incremental within the indoormap
|
||||||
Point2 pos;
|
Point3 pos;
|
||||||
GroundTruthPoint() : id(), pos() {;}
|
GroundTruthPoint() : id(), pos() {;}
|
||||||
GroundTruthPoint(const int& id, const Point2& pos) : id(id), pos(pos) {;}
|
GroundTruthPoint(const int& id, const Point3& pos) : id(id), pos(pos) {;}
|
||||||
bool operator == (const GroundTruthPoint& o) const {return (o.id == id) && (o.pos == pos);}
|
bool operator == (const GroundTruthPoint& o) const {return (o.id == id) && (o.pos == pos);}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ namespace Floorplan {
|
|||||||
static GroundTruthPoint* parseFloorGroundTruthPoint(const XMLElem* el) {
|
static GroundTruthPoint* parseFloorGroundTruthPoint(const XMLElem* el) {
|
||||||
GroundTruthPoint* gtp = new GroundTruthPoint();
|
GroundTruthPoint* gtp = new GroundTruthPoint();
|
||||||
gtp->id = el->IntAttribute("id");
|
gtp->id = el->IntAttribute("id");
|
||||||
gtp->pos = parsePoint2(el);
|
gtp->pos = parsePoint3(el);
|
||||||
return gtp;
|
return gtp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ namespace Floorplan {
|
|||||||
elem->SetAttribute("id", gtp->id);
|
elem->SetAttribute("id", gtp->id);
|
||||||
elem->SetAttribute("x", gtp->pos.x);
|
elem->SetAttribute("x", gtp->pos.x);
|
||||||
elem->SetAttribute("y", gtp->pos.y);
|
elem->SetAttribute("y", gtp->pos.y);
|
||||||
|
elem->SetAttribute("z", gtp->pos.z);
|
||||||
gtpoints->InsertEndChild(elem);
|
gtpoints->InsertEndChild(elem);
|
||||||
}
|
}
|
||||||
floor->InsertEndChild(gtpoints);
|
floor->InsertEndChild(gtpoints);
|
||||||
|
|||||||
@@ -75,6 +75,19 @@ namespace Distribution {
|
|||||||
return NormalDistributionN(mean, cov);
|
return NormalDistributionN(mean, cov);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** return a NormalN based on given data and a given mean vector mu*/
|
||||||
|
static NormalDistributionN getNormalNFromSamplesAndMean(const Eigen::MatrixXd& data, const Eigen::VectorXd mean) {
|
||||||
|
|
||||||
|
const int numElements = data.rows();
|
||||||
|
Assert::notEqual(numElements, 1, "data is just 1 value, thats not enough for getting the distribution!");
|
||||||
|
Assert::notEqual(numElements, 0, "data is empty, thats not enough for getting the distribution!");
|
||||||
|
|
||||||
|
const Eigen::MatrixXd centered = data.rowwise() - mean.transpose();
|
||||||
|
const Eigen::MatrixXd cov = (centered.adjoint() * centered) / double(data.rows() - 1);
|
||||||
|
|
||||||
|
return NormalDistributionN(mean, cov);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user