本文整理汇总了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);
}
示例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);
}