本文整理汇总了C++中VertexPointXYZ::estimate方法的典型用法代码示例。如果您正苦于以下问题:C++ VertexPointXYZ::estimate方法的具体用法?C++ VertexPointXYZ::estimate怎么用?C++ VertexPointXYZ::estimate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VertexPointXYZ
的用法示例。
在下文中一共展示了VertexPointXYZ::estimate方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
HyperGraphElementAction* EdgeProjectDisparityDrawAction::operator()(HyperGraph::HyperGraphElement* element,
HyperGraphElementAction::Parameters* params_ ){
if (typeid(*element).name()!=_typeName)
return 0;
refreshPropertyPtrs(params_);
if (! _previousParams)
return this;
if (_show && !_show->value())
return this;
EdgeSE3PointXYZDisparity* e = static_cast<EdgeSE3PointXYZDisparity*>(element);
VertexSE3* fromEdge = static_cast<VertexSE3*>(e->vertices()[0]);
VertexPointXYZ* toEdge = static_cast<VertexPointXYZ*>(e->vertices()[1]);
if (! fromEdge || ! toEdge)
return this;
Eigen::Isometry3d fromTransform=fromEdge->estimate() * e->cameraParameter()->offset();
glColor3f(LANDMARK_EDGE_COLOR);
glPushAttrib(GL_ENABLE_BIT);
glDisable(GL_LIGHTING);
glBegin(GL_LINES);
glVertex3f((float)fromTransform.translation().x(),(float)fromTransform.translation().y(),(float)fromTransform.translation().z());
glVertex3f((float)toEdge->estimate().x(),(float)toEdge->estimate().y(),(float)toEdge->estimate().z());
glEnd();
glPopAttrib();
return this;
}
示例2: operator
HyperGraphElementAction* VertexPointXYZDrawAction::operator()(HyperGraph::HyperGraphElement* element,
HyperGraphElementAction::Parameters* params ){
if (typeid(*element).name()!=_typeName)
return 0;
refreshPropertyPtrs(params);
if (! _previousParams)
return this;
if (_show && !_show->value())
return this;
VertexPointXYZ* that = static_cast<VertexPointXYZ*>(element);
glPushAttrib(GL_ENABLE_BIT | GL_POINT_BIT);
glDisable(GL_LIGHTING);
glColor3f(0.8f,0.5f,0.3f);
if (_pointSize) {
glPointSize(_pointSize->value());
}
glBegin(GL_POINTS);
glVertex3f((float)that->estimate()(0),(float)that->estimate()(1),(float)that->estimate()(2));
glEnd();
glPopAttrib();
return this;
}
示例3: operator
HyperGraphElementAction* VertexPointXYZDrawAction::operator()(HyperGraph::HyperGraphElement* element,
HyperGraphElementAction::Parameters* params ) {
if (typeid(*element).name()!=_typeName)
return 0;
initializeDrawActionsCache();
refreshPropertyPtrs(params);
if (! _previousParams)
return this;
if (_show && !_show->value())
return this;
VertexPointXYZ* that = static_cast<VertexPointXYZ*>(element);
glPushMatrix();
glPushAttrib(GL_ENABLE_BIT | GL_POINT_BIT);
glDisable(GL_LIGHTING);
glColor3f(LANDMARK_VERTEX_COLOR);
float ps = _pointSize ? _pointSize->value() : 1.f;
glTranslatef((float)that->estimate()(0),(float)that->estimate()(1),(float)that->estimate()(2));
opengl::drawPoint(ps);
glPopAttrib();
drawCache(that->cacheContainer(), params);
drawUserData(that->userData(), params);
glPopMatrix();
return this;
}
示例4: J
void EdgeSE3PointXYZ::linearizeOplus() {
//VertexSE3 *cam = static_cast<VertexSE3 *>(_vertices[0]);
VertexPointXYZ *vp = static_cast<VertexPointXYZ *>(_vertices[1]);
Eigen::Vector3d Zcam = cache->w2l() * vp->estimate();
// J(0,3) = -0.0;
J(0,4) = -2*Zcam(2);
J(0,5) = 2*Zcam(1);
J(1,3) = 2*Zcam(2);
// J(1,4) = -0.0;
J(1,5) = -2*Zcam(0);
J(2,3) = -2*Zcam(1);
J(2,4) = 2*Zcam(0);
// J(2,5) = -0.0;
J.block<3,3>(0,6) = cache->w2l().rotation();
Eigen::Matrix<double,3,9> Jhom = offsetParam->inverseOffset().rotation() * J;
_jacobianOplusXi = Jhom.block<3,6>(0,0);
_jacobianOplusXj = Jhom.block<3,3>(0,6);
}
示例5: perr
void EdgeSE3PointXYZDisparity::computeError() {
//VertexSE3 *cam = static_cast<VertexSE3*>(_vertices[0]);
VertexPointXYZ *point = static_cast<VertexPointXYZ*>(_vertices[1]);
const Vector3d& pt = point->estimate();
//Eigen::Vector4d ppt(pt(0),pt(1),pt(2),1.0);
// VertexCameraCache* vcache = (VertexCameraCache*)cam->getCache(_cacheIds[0]);
// if (! vcache){
// cerr << "fatal error in retrieving cache" << endl;
// }
// CacheCamera* vcache = cache;
// if (! vcache){
// cerr << "fatal error in retrieving cache" << endl;
// }
Eigen::Vector3d p = cache->w2i() * pt;
Eigen::Vector3d perr;
perr.head<2>() = p.head<2>()/p(2);
perr(2) = 1/p(2);
// error, which is backwards from the normal observed - calculated
// _measurement is the measured projection
_error = perr - _measurement;
}
示例6: J
void EdgeSE3PointXYZDepth::linearizeOplus() {
//VertexSE3 *cam = static_cast<VertexSE3 *>(_vertices[0]);
VertexPointXYZ *vp = static_cast<VertexPointXYZ *>(_vertices[1]);
const Eigen::Vector3d& pt = vp->estimate();
Eigen::Vector3d Zcam = cache->w2lMatrix() * pt;
// J(0,3) = -0.0;
J(0,4) = -2*Zcam(2);
J(0,5) = 2*Zcam(1);
J(1,3) = 2*Zcam(2);
// J(1,4) = -0.0;
J(1,5) = -2*Zcam(0);
J(2,3) = -2*Zcam(1);
J(2,4) = 2*Zcam(0);
// J(2,5) = -0.0;
J.block<3,3>(0,6) = cache->w2lMatrix().rotation();
Eigen::Matrix<double,3,9> Jprime = params->Kcam_inverseOffsetR() * J;
Eigen::Vector3d Zprime = cache->w2i() * pt;
Eigen::Matrix<double, 3, 9> Jhom;
Jhom.block<2,9>(0,0) = 1/(Zprime(2)*Zprime(2)) * (Jprime.block<2,9>(0,0)*Zprime(2) - Zprime.head<2>() * Jprime.block<1,9>(2,0));
Jhom.block<1,9>(2,0) = Jprime.block<1,9>(2,0);
_jacobianOplusXi = Jhom.block<3,6>(0,0);
_jacobianOplusXj = Jhom.block<3,3>(0,6);
}
示例7: J
void EdgeSE3PointXYZDisparity::linearizeOplus() {
//VertexSE3 *cam = static_cast<VertexSE3 *>(_vertices[0]);
VertexPointXYZ *vp = static_cast<VertexPointXYZ *>(_vertices[1]);
// VertexCameraCache* vcache = (VertexCameraCache*)cam->getCache(_cacheIds[0]);
// if (! vcache){
// cerr << "fatal error in retrieving cache" << endl;
// }
// CacheCamera* vcache = cache;
// if (! vcache){
// cerr << "fatal error in retrieving cache" << endl;
// }
const Eigen::Vector3d& pt = vp->estimate();
Eigen::Vector3d Zcam = cache->w2l() * vp->estimate();
// J(0,3) = -0.0;
J(0,4) = -2*Zcam(2);
J(0,5) = 2*Zcam(1);
J(1,3) = 2*Zcam(2);
// J(1,4) = -0.0;
J(1,5) = -2*Zcam(0);
J(2,3) = -2*Zcam(1);
J(2,4) = 2*Zcam(0);
// J(2,5) = -0.0;
J.block<3,3>(0,6) = cache->w2l().rotation();
//Eigen::Matrix<double,3,9> Jprime = vcache->params->Kcam_inverseOffsetR * J;
Eigen::Matrix<double,3,9> Jprime = params->Kcam_inverseOffsetR() * J;
Eigen::Matrix<double, 3, 9> Jhom;
Eigen::Vector3d Zprime = cache->w2i() * pt;
Jhom.block<2,9>(0,0) = 1/(Zprime(2)*Zprime(2)) * (Jprime.block<2,9>(0,0)*Zprime(2) - Zprime.head<2>() * Jprime.block<1,9>(2,0));
Jhom.block<1,9>(2,0) = - 1/(Zprime(2)*Zprime(2)) * Jprime.block<1,9>(2,0);
_jacobianOplusXi = Jhom.block<3,6>(0,0);
_jacobianOplusXj = Jhom.block<3,3>(0,6);
}
示例8: T
void EdgeProjectXYZ2UVQ::linearizeOplus()
{
VertexSE3Expmap * vj = static_cast<VertexSE3Expmap *>(_vertices[1]);
SE3Quat T(vj->estimate());
VertexPointXYZ* vi = static_cast<VertexPointXYZ*>(_vertices[0]);
Vector3d xyz = vi->estimate();
Vector3d xyz_trans = T.map(xyz);
const double & x = xyz_trans[0];
const double & y = xyz_trans[1];
const double & z = xyz_trans[2];
double z_sq = z*z;
const double & Fx = vj->_focal_length(0);
const double & Fy = vj->_focal_length(1);
double dq_dz = -Fx/z_sq;
double x_Fx_by_zsq = x*Fx/z_sq;
double y_Fy_by_zsq = y*Fy/z_sq;
Matrix3d R = T.rotation().toRotationMatrix();
_jacobianOplusXi.row(0) = -Fx/z*R.row(0) + x_Fx_by_zsq*R.row(2);
_jacobianOplusXi.row(1) = -Fy/z*R.row(1) + y_Fy_by_zsq*R.row(2);
_jacobianOplusXi.row(2) = -dq_dz*R.row(2);
_jacobianOplusXj(0,0) = x*y/z_sq *Fx;
_jacobianOplusXj(0,1) = -(1+(x*x/z_sq)) *Fx;
_jacobianOplusXj(0,2) = y/z *Fx;
_jacobianOplusXj(0,3) = -1./z *Fx;
_jacobianOplusXj(0,4) = 0;
_jacobianOplusXj(0,5) = x/z_sq *Fx;
_jacobianOplusXj(1,0) = (1+y*y/z_sq) *Fy;
_jacobianOplusXj(1,1) = -x*y/z_sq *Fy;
_jacobianOplusXj(1,2) = -x/z *Fy;
_jacobianOplusXj(1,3) = 0;
_jacobianOplusXj(1,4) = -1./z *Fy;
_jacobianOplusXj(1,5) = y/z_sq *Fy;
_jacobianOplusXj(2,0) = -y*dq_dz ;
_jacobianOplusXj(2,1) = x*dq_dz;
_jacobianOplusXj(2,2) = 0;
_jacobianOplusXj(2,3) = 0;
_jacobianOplusXj(2,4) = 0;
_jacobianOplusXj(2,5) = -dq_dz ;
// std::cerr << _jacobianOplusXi << std::endl;
// std::cerr << _jacobianOplusXj << std::endl;
// BaseBinaryEdge<3, Vector3d, VertexPointXYZ, VertexSE3Expmap, false>::linearizeOplus();
// std::cerr << _jacobianOplusXi << std::endl;
// std::cerr << _jacobianOplusXj << std::endl;
}
示例9:
void EdgeSE3PointXYZ::computeError() {
// from cam to point (track)
//VertexSE3 *cam = static_cast<VertexSE3*>(_vertices[0]);
VertexPointXYZ *point = static_cast<VertexPointXYZ*>(_vertices[1]);
Eigen::Vector3d perr = cache->w2n() * point->estimate();
// error, which is backwards from the normal observed - calculated
// _measurement is the measured projection
_error = perr - _measurement;
// std::cout << _error << std::endl << std::endl;
}
示例10:
void EdgeSE3LotsOfXYZ::computeError(){
VertexSE3 * pose = static_cast<VertexSE3 *> (_vertices[0]);
for(unsigned int i=0; i<_observedPoints; i++){
VertexPointXYZ * xyz = static_cast<VertexPointXYZ *> (_vertices[1+i]);
Vector3D m = pose->estimate().inverse() * xyz->estimate();
unsigned int index = 3*i;
_error[index] = m[0] - _measurement[index];
_error[index+1] = m[1] - _measurement[index+1];
_error[index+2] = m[2] - _measurement[index+2];
}
}
示例11: perr
bool EdgeSE3PointXYZDepth::setMeasurementFromState(){
//VertexSE3 *cam = static_cast<VertexSE3*>(_vertices[0]);
VertexPointXYZ *point = static_cast<VertexPointXYZ*>(_vertices[1]);
// calculate the projection
const Eigen::Vector3d& pt = point->estimate();
Eigen::Vector3d p = cache->w2i() * pt;
Eigen::Vector3d perr;
perr.head<2>() = p.head<2>()/p(2);
perr(2) = p(2);
_measurement = perr;
return true;
}
示例12: refreshPropertyPtrs
HyperGraphElementAction* EdgeSE3PointXYZDrawAction::operator()(HyperGraph::HyperGraphElement* element,
HyperGraphElementAction::Parameters* params_){
if (typeid(*element).name()!=_typeName)
return 0;
refreshPropertyPtrs(params_);
if (! _previousParams)
return this;
if (_show && !_show->value())
return this;
EdgeSE3PointXYZ* e = static_cast<EdgeSE3PointXYZ*>(element);
VertexSE3* fromEdge = static_cast<VertexSE3*>(e->vertex(0));
VertexPointXYZ* toEdge = static_cast<VertexPointXYZ*>(e->vertex(1));
glColor3f(0.8f,0.3f,0.3f);
glPushAttrib(GL_ENABLE_BIT);
glDisable(GL_LIGHTING);
glBegin(GL_LINES);
glVertex3f((float)fromEdge->estimate().translation().x(),(float)fromEdge->estimate().translation().y(),(float)fromEdge->estimate().translation().z());
glVertex3f((float)toEdge->estimate().x(),(float)toEdge->estimate().y(),(float)toEdge->estimate().z());
glEnd();
glPopAttrib();
return this;
}