当前位置: 首页>>代码示例>>C++>>正文


C++ Pose3D::invert方法代码示例

本文整理汇总了C++中Pose3D::invert方法的典型用法代码示例。如果您正苦于以下问题:C++ Pose3D::invert方法的具体用法?C++ Pose3D::invert怎么用?C++ Pose3D::invert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pose3D的用法示例。


在下文中一共展示了Pose3D::invert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: calculateYImageCoordinate

void CameraControlEngine::calculateYImageCoordinate(const Vector3<>& hip2Target,
    const Pose3D& transformMatrix, const Pose3D& transformMatrixOther,
    float& yImage, float& yImageOther)
{
  const Pose3D transformMatrixInv = transformMatrix.invert();
  const Pose3D transformMatrixOtherInv = transformMatrixOther.invert();
  // We don't want points to be behind the camera. Since we only need the y image coordinate,
  // we pretend lies directly in front of the camera.
  const float absInPlane = sqrt(sqr(hip2Target.x) + sqr(hip2Target.y));
  const Vector3<> fakeTarget(absInPlane * cos(theFilteredJointData.angles[JointData::HeadYaw]),
                             absInPlane * sin(theFilteredJointData.angles[JointData::HeadYaw]),
                             hip2Target.z);
  const Vector3<> fakeTargetCamera = transformMatrixInv * fakeTarget;
  const Vector3<> fakeTargetCameraOther = transformMatrixOtherInv * fakeTarget;
  yImage = -fakeTargetCamera.z * theCameraInfo.focalLength / fakeTargetCamera.x;
  yImageOther = -fakeTargetCameraOther.z * theCameraInfo.focalLength / fakeTargetCameraOther.x;
}
开发者ID:LukeLu1263,项目名称:WrightOcean2012,代码行数:17,代码来源:CameraControlEngine.cpp

示例2: imageToRobotWithCameraRotation

bool Transformation::imageToRobotWithCameraRotation(const Vector2<int>& pointInImage,
    const CameraMatrix& cameraMatrix, const CameraInfo& cameraInfo,
    Vector2<>& relativePosition)
{
  const bool ret = imageToRobot(pointInImage, cameraMatrix, cameraInfo, relativePosition);
  if(ret)
  {
    Pose3D cameraRotatedMatrix;
    cameraRotatedMatrix.rotateZ(cameraMatrix.rotation.getZAngle());
    const Vector3<> point3D = cameraRotatedMatrix.invert() * Vector3<>(relativePosition.x, relativePosition.y, 0.f);
    relativePosition.x = point3D.x;
    relativePosition.y = point3D.y;
  }
  return ret;
}
开发者ID:BADBDY23,项目名称:BHumanCodeRelease,代码行数:15,代码来源:Transformation.cpp


注:本文中的Pose3D::invert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。