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


C++ Joint::getAngle方法代码示例

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


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

示例1: processFrame

void Camera::processFrame()
{
  this->capture.read(this->cameraImage);
  for (unsigned int i = 0 ; i < this->objectsToTrack.size() ; i++)
  {
    cvtColor(this->cameraImage, this->HSVImage, COLOR_BGR2HSV);
    inRange(this->HSVImage, this->objectsToTrack[i]->getHSVmin(),
            this->objectsToTrack[i]->getHSVmax(), this->thresholdImage);
    this->morphOps(this->thresholdImage);
    this->trackFilteredObject(this->objectsToTrack[i], this->thresholdImage,
                        this->HSVImage, this->cameraImage);
    if (this->head != NULL && i == this->focusObjIndex)
    {
      Joint *pan = head->getJoint(PAN);
      Joint *tilt = head->getJoint(TILT);
      float x = this->objectsToTrack[i]->getXPos();
      float y = this->objectsToTrack[i]->getYPos();
      float half_width = float(CAMERA_WIDTH) / 2.0;
      float half_height = float(CAMERA_HEIGHT) / 2.0;
      float pan_angle = ((x - half_width) / half_width)*(CAMERA_HORIZONTAL_FIELD/2.0);
      float tilt_angle = ((y - half_height) / half_height)*(CAMERA_VERTICAL_FIELD/2.0);
      this->focusPan = pan->getAngle() - pan_angle;
      this->focusTilt = tilt->getAngle() - tilt_angle;
    }
  }
  imshow("Dimitri's Vision", cameraImage);
}
开发者ID:TauraBots,项目名称:JointComm,代码行数:27,代码来源:Camera.cpp

示例2: moveHeadToFocus

void Camera::moveHeadToFocus()
{
      Joint *pan = head->getJoint(PAN);
      Joint *tilt = head->getJoint(TILT);
      float deltaPan = this->focusPan - pan->getAngle();
      float deltaTilt = this->focusTilt - tilt->getAngle();
      deltaPan /= this->focusStepDiv*3.0/5.0;
      deltaTilt /= this->focusStepDiv;
      pan->setGoalAngle(pan->getAngle() + deltaPan);
      tilt->setGoalAngle(tilt->getAngle() + deltaTilt);
}
开发者ID:TauraBots,项目名称:JointComm,代码行数:11,代码来源:Camera.cpp


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