本文整理汇总了C++中vpHomogeneousMatrix::inverse方法的典型用法代码示例。如果您正苦于以下问题:C++ vpHomogeneousMatrix::inverse方法的具体用法?C++ vpHomogeneousMatrix::inverse怎么用?C++ vpHomogeneousMatrix::inverse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vpHomogeneousMatrix
的用法示例。
在下文中一共展示了vpHomogeneousMatrix::inverse方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
vpProjectionDisplay::displayCamera(vpImage<unsigned char> &I,
const vpHomogeneousMatrix &cextMo,
const vpHomogeneousMatrix &cMo,
const vpCameraParameters &cam)
{
vpHomogeneousMatrix c1Mc ;
c1Mc = cextMo*cMo.inverse() ;
o.track(c1Mc) ;
x.track(c1Mc) ;
y.track(c1Mc) ;
z.track(c1Mc) ;
vpImagePoint ipo;
vpImagePoint ipx;
vpMeterPixelConversion::convertPoint(cam, o.p[0], o.p[1], ipo) ;
vpMeterPixelConversion::convertPoint(cam, x.p[0], x.p[1], ipx) ;
vpDisplay::displayArrow(I, ipo, ipx, vpColor::green) ;
vpMeterPixelConversion::convertPoint(cam, y.p[0], y.p[1], ipx) ;
vpDisplay::displayArrow(I, ipo, ipx, vpColor::blue) ;
vpMeterPixelConversion::convertPoint(cam, z.p[0], z.p[1], ipx) ;
vpDisplay::displayArrow(I, ipo, ipx, vpColor::red) ;
}
示例2:
void
vpProjectionDisplay::displayCamera(vpImage<unsigned char> &I,
const vpHomogeneousMatrix &cextMo,
const vpHomogeneousMatrix &cMo,
const vpCameraParameters &cam,
const unsigned int thickness)
{
vpHomogeneousMatrix c1Mc ;
c1Mc = cextMo*cMo.inverse() ;
o.track(c1Mc) ;
if(o.get_Z() < 0) // do not print camera if behind the external camera
return;
x.track(c1Mc) ;
y.track(c1Mc) ;
z.track(c1Mc) ;
vpImagePoint ipo;
vpImagePoint ipx;
vpMeterPixelConversion::convertPoint(cam, o.p[0], o.p[1], ipo) ;
vpMeterPixelConversion::convertPoint(cam, x.p[0], x.p[1], ipx) ;
vpDisplay::displayArrow(I, ipo, ipx, vpColor::green, 4+thickness, 2+thickness, thickness) ;
vpMeterPixelConversion::convertPoint(cam, y.p[0], y.p[1], ipx) ;
vpDisplay::displayArrow(I, ipo, ipx, vpColor::blue, 4+thickness, 2+thickness, thickness) ;
vpMeterPixelConversion::convertPoint(cam, z.p[0], z.p[1], ipx) ;
vpDisplay::displayArrow(I, ipo, ipx, vpColor::red, 4+thickness, 2+thickness, thickness) ;
}
示例3: e
double
vpHomography::computeDisplacement(unsigned int nbpoint,
vpPoint *c1P,
vpPoint *c2P,
vpPlane *oN,
vpHomogeneousMatrix &c2Mc1,
vpHomogeneousMatrix &c1Mo,
int userobust
)
{
vpColVector e(2) ;
double r_1 = -1 ;
vpColVector p2(3) ;
vpColVector p1(3) ;
vpColVector Hp2(3) ;
vpColVector Hp1(3) ;
vpMatrix H2(2,6) ;
vpColVector e2(2) ;
vpMatrix H1(2,6) ;
vpColVector e1(2) ;
int only_1 = 1 ;
int only_2 = 0 ;
int iter = 0 ;
unsigned int i ;
unsigned int n=0 ;
n = nbpoint ;
if ((only_1==1) || (only_2==1)) ; else n *=2 ;
vpRobust robust(n);
vpColVector res(n) ;
vpColVector w(n) ;
w =1 ;
robust.setThreshold(0.0000) ;
vpMatrix W(2*n,2*n) ;
W = 0 ;
vpColVector N1(3), N2(3) ;
double d1, d2 ;
double r =1e10 ;
iter =0 ;
while (vpMath::equal(r_1,r,threshold_displacement) == false )
{
r_1 =r ;
// compute current position
//Change frame (current)
vpHomogeneousMatrix c1Mc2, c2Mo ;
vpRotationMatrix c1Rc2, c2Rc1 ;
vpTranslationVector c1Tc2, c2Tc1 ;
c1Mc2 = c2Mc1.inverse() ;
c2Mc1.extract(c2Rc1) ;
c2Mc1.extract(c2Tc1) ;
c2Mc1.extract(c1Rc2) ;
c1Mc2.extract(c1Tc2) ;
c2Mo = c2Mc1*c1Mo ;
vpMatrix L(2,3), Lp ;
int k =0 ;
for (i=0 ; i < nbpoint ; i++)
{
getPlaneInfo(oN[i], c1Mo, N1, d1) ;
getPlaneInfo(oN[i], c2Mo, N2, d2) ;
p2[0] = c2P[i].get_x() ;
p2[1] = c2P[i].get_y() ;
p2[2] = 1.0 ;
p1[0] = c1P[i].get_x() ;
p1[1] = c1P[i].get_y() ;
p1[2] = 1.0 ;
vpMatrix H(3,3) ;
Hp2 = ((vpMatrix)c1Rc2 + ((vpMatrix)c1Tc2*N2.t())/d2)*p2 ; // p2 = Hp1
Hp1 = ((vpMatrix)c2Rc1 + ((vpMatrix)c2Tc1*N1.t())/d1)*p1 ; // p1 = Hp2
Hp2 /= Hp2[2] ; // normalisation
Hp1 /= Hp1[2] ;
// set up the interaction matrix
double x = Hp2[0] ;
double y = Hp2[1] ;
double Z1 ;
Z1 = (N1[0]*x+N1[1]*y+N1[2])/d1 ; // 1/z
//.........这里部分代码省略.........