26 #ifndef OPENCV_CORE_QUATERNION_HPP
27 #define OPENCV_CORE_QUATERNION_HPP
29 #include <opencv2/core.hpp>
30 #include <opencv2/core/utils/logger.hpp>
132 template <
typename _Tp>
class Quat;
209 template <
typename _Tp>
213 using value_type = _Tp;
333 template <
typename T>
362 template <
typename T>
403 template <
typename T>
441 template <
typename T>
478 template <
typename T>
513 template <
typename T>
560 template <
typename T>
592 template <
typename T>
620 template <
typename T>
648 template <
typename T>
676 template <
typename T>
704 template <
typename T>
731 template <
typename T>
758 template <
typename T>
786 template <
typename T>
814 template <
typename T>
841 template <
typename T>
867 template <
typename T>
893 template <
typename T>
1143 bool directChange=
true);
1449 template <
typename T>
1464 template <
typename T>
1479 template <
typename T>
1494 template <
typename T>
1519 template <
typename T>
1544 template <
typename T>
1547 template <
typename S>
1622 template <
typename T>
1625 template <
typename T>
1628 template <
typename T>
1631 template <
typename T>
1634 template <
typename T>
1637 template <
typename T>
1640 template <
typename T>
1643 template <
typename T>
1646 template <
typename T>
1649 template <
typename T>
1652 template <
typename T>
1655 template <
typename T>
1658 template <
typename T>
1661 template <
typename T>
1664 template <
typename T>
1667 template <
typename T>
1670 template <
typename T>
1673 template <
typename T>
1676 template <
typename S>
1679 template <
typename T>
1682 template <
typename T>
1685 template <
typename S>
1694 #include "opencv2/core/quaternion.inl.hpp"
Template class for small matrices whose type and size are known at compilation time.
Definition: matx.hpp:100
Definition: quaternion.hpp:56
EulerAnglesType
Enum of Euler angles type.
Definition: quaternion.hpp:99
@ INT_XYZ
Intrinsic rotations with the Euler angles type X-Y-Z.
Definition: quaternion.hpp:100
@ EXT_YXZ
Extrinsic rotations with the Euler angles type Y-X-Z.
Definition: quaternion.hpp:115
@ INT_XZY
Intrinsic rotations with the Euler angles type X-Z-Y.
Definition: quaternion.hpp:101
@ EXT_YZX
Extrinsic rotations with the Euler angles type Y-Z-X.
Definition: quaternion.hpp:116
@ INT_XZX
Intrinsic rotations with the Euler angles type X-Z-X.
Definition: quaternion.hpp:107
@ INT_ZYZ
Intrinsic rotations with the Euler angles type Z-Y-Z.
Definition: quaternion.hpp:111
@ EXT_ZXY
Extrinsic rotations with the Euler angles type Z-X-Y.
Definition: quaternion.hpp:117
@ INT_YZY
Intrinsic rotations with the Euler angles type Y-Z-Y.
Definition: quaternion.hpp:109
@ INT_YXZ
Intrinsic rotations with the Euler angles type Y-X-Z.
Definition: quaternion.hpp:102
@ INT_XYX
Intrinsic rotations with the Euler angles type X-Y-X.
Definition: quaternion.hpp:106
@ EXT_YXY
Extrinsic rotations with the Euler angles type Y-X-Y.
Definition: quaternion.hpp:121
@ INT_ZXY
Intrinsic rotations with the Euler angles type Z-X-Y.
Definition: quaternion.hpp:104
@ EXT_ZXZ
Extrinsic rotations with the Euler angles type Z-X-Z.
Definition: quaternion.hpp:123
@ EXT_ZYX
Extrinsic rotations with the Euler angles type Z-Y-X.
Definition: quaternion.hpp:118
@ EXT_YZY
Extrinsic rotations with the Euler angles type Y-Z-Y.
Definition: quaternion.hpp:122
@ EXT_ZYZ
Extrinsic rotations with the Euler angles type Z-Y-Z.
Definition: quaternion.hpp:124
@ INT_ZXZ
Intrinsic rotations with the Euler angles type Z-X-Z.
Definition: quaternion.hpp:110
@ EXT_XZX
Extrinsic rotations with the Euler angles type X-Z-X.
Definition: quaternion.hpp:120
@ EXT_XYZ
Extrinsic rotations with the Euler angles type X-Y-Z.
Definition: quaternion.hpp:113
@ INT_ZYX
Intrinsic rotations with the Euler angles type Z-Y-X.
Definition: quaternion.hpp:105
@ INT_YZX
Intrinsic rotations with the Euler angles type Y-Z-X.
Definition: quaternion.hpp:103
@ EULER_ANGLES_MAX_VALUE
Definition: quaternion.hpp:126
@ EXT_XYX
Extrinsic rotations with the Euler angles type X-Y-X.
Definition: quaternion.hpp:119
@ EXT_XZY
Extrinsic rotations with the Euler angles type X-Z-Y.
Definition: quaternion.hpp:114
@ INT_YXY
Intrinsic rotations with the Euler angles type Y-X-Y.
Definition: quaternion.hpp:108
Definition: quaternion.hpp:211
friend Quat< T > asinh(const Quat< T > &q)
return arcsinh value of quaternion q, arcsinh could be calculated as:
_Tp dot(Quat< _Tp > q) const
return the dot between quaternion and this quaternion.
Quat< _Tp > operator*(const Quat< _Tp > &) const
Multiplication operator of two quaternions q and p. Multiplies values on either side of the operator.
static Quat< _Tp > lerp(const Quat< _Tp > &q0, const Quat &q1, const _Tp t)
To calculate the interpolation from to by Linear Interpolation(Nlerp) For two quaternions,...
friend Quat< T > crossProduct(const Quat< T > &p, const Quat< T > &q)
return the crossProduct between and .
static constexpr _Tp CV_QUAT_EPS
Definition: quaternion.hpp:215
friend Quat< T > sinh(const Quat< T > &q)
return sinh value of quaternion q, sinh could be calculated as:
Quat< _Tp > asinh() const
return arcsinh value of this quaternion, arcsinh could be calculated as:
friend Quat< T > atan(const Quat< T > &q)
return arctan value of quaternion q, arctan could be calculated as:
bool operator==(const Quat< _Tp > &) const
return true if two quaternions p and q are nearly equal, i.e. when the absolute value of each and i...
Quat< _Tp > cos() const
return cos value of this quaternion, cos could be calculated as:
Quat< _Tp > & operator*=(const Quat< _Tp > &)
Multiplication assignment operator of two quaternions q and p. It multiplies right operand with the l...
friend Quat< T > acosh(const Quat< T > &q)
return arccosh value of quaternion q, arccosh could be calculated as:
Quat< _Tp > power(const Quat< _Tp > &q, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
return the value of power function with quaternion .
_Tp getAngle(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
get the angle of quaternion, it returns the rotation angle.
Quat< _Tp > & operator+=(const Quat< _Tp > &)
Addition assignment operator of two quaternions p and q. It adds right operand to the left operand an...
static Quat< _Tp > createFromEulerAngles(const Vec< _Tp, 3 > &angles, QuatEnum::EulerAnglesType eulerAnglesType)
from Euler angles
Matx< _Tp, 3, 3 > toRotMat3x3(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
transform a quaternion to a 3x3 rotation matrix.
Quat< _Tp > inv(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
return which is an inverse of satisfying .
Quat< _Tp > acos() const
return arccos value of this quaternion, arccos could be calculated as:
static Quat< _Tp > createFromRotMat(InputArray R)
from a 3x3 rotation matrix.
friend Quat< T > sin(const Quat< T > &q)
return tanh value of quaternion q, sin could be calculated as:
Quat< _Tp > sinh() const
return sinh value of this quaternion, sinh could be calculated as: where
friend Quat< T > cos(const Quat< T > &q)
return sin value of quaternion q, cos could be calculated as:
static Quat< _Tp > slerp(const Quat< _Tp > &q0, const Quat &q1, const _Tp t, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT, bool directChange=true)
To calculate the interpolation between and by Spherical Linear Interpolation(Slerp),...
bool isNormal(_Tp eps=CV_QUAT_EPS) const
return true if this quaternion is a unit quaternion.
Quat< _Tp > acosh() const
return arccosh value of this quaternion, arccosh could be calculated as:
_Tp z
Definition: quaternion.hpp:1618
Quat< _Tp > operator-() const
Return opposite quaternion which satisfies .
friend Quat< T > asin(const Quat< T > &q)
return arcsin value of quaternion q, arcsin could be calculated as:
_Tp & operator[](std::size_t n)
Quat< _Tp > tanh() const
return tanh value of this quaternion, tanh could be calculated as:
_Tp y
Definition: quaternion.hpp:1618
Matx< _Tp, 4, 4 > toRotMat4x4(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
transform a quaternion to a 4x4 rotation matrix.
friend Quat< T > cosh(const Quat< T > &q)
return cosh value of quaternion q, cosh could be calculated as:
Quat< _Tp > log(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
return the value of logarithm function.
static Quat< _Tp > interPoint(const Quat< _Tp > &q0, const Quat< _Tp > &q1, const Quat< _Tp > &q2, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT)
This is the part calculation of squad. To calculate the intermedia quaternion between each three qua...
Quat< _Tp > sin() const
return sin value of this quaternion, sin could be calculated as:
static Quat< _Tp > createFromZRot(const _Tp theta)
get a quaternion from a rotation about the Z-axis by .
Quat< _Tp > normalize() const
return a normalized .
friend Quat< T > exp(const Quat< T > &q)
return the value of exponential value.
Quat< _Tp > & operator*=(const _Tp s)
Multiplication assignment operator of a quaternions and a scalar. It multiplies right operand with th...
friend Quat< T > sqrt(const Quat< T > &q, QuatAssumeType assumeUnit)
return .
Quat< _Tp > asin() const
return arcsin value of this quaternion, arcsin could be calculated as:
Quat< _Tp > & operator/=(const Quat< _Tp > &)
Division assignment operator of two quaternions p and q; It divides left operand with the right opera...
static Quat< _Tp > spline(const Quat< _Tp > &q0, const Quat< _Tp > &q1, const Quat< _Tp > &q2, const Quat< _Tp > &q3, const _Tp t, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT)
to calculate a quaternion which is the result of a continuous spline curve constructed by squad at t...
Quat< _Tp > sqrt(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
return .
friend Quat< T > power(const Quat< T > &p, const Quat< T > &q, QuatAssumeType assumeUnit)
return the value of power function with quaternion .
Quat< _Tp > conjugate() const
return the conjugate of this quaternion.
Vec< _Tp, 4 > toVec() const
transform the this quaternion to a Vec<T, 4>.
friend Quat< T > inv(const Quat< T > &q, QuatAssumeType assumeUnit)
return which is an inverse of which satisfies .
_Tp x
Definition: quaternion.hpp:1618
Quat< _Tp > operator+(const Quat< _Tp > &) const
Addition operator of two quaternions p and q. It returns a new quaternion that each value is the sum ...
Quat< _Tp > & operator/=(const _Tp s)
Division assignment operator of a quaternions and a scalar. It divides left operand with the right op...
Vec< _Tp, 3 > toEulerAngles(QuatEnum::EulerAnglesType eulerAnglesType)
Transform a quaternion q to Euler angles.
Quat< _Tp > operator/(const _Tp s) const
Division operator of a quaternions and a scalar. It divides left operand with the right operand and a...
static Quat< _Tp > nlerp(const Quat< _Tp > &q0, const Quat &q1, const _Tp t, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT)
To calculate the interpolation from to by Normalized Linear Interpolation(Nlerp)....
friend Quat< T > tan(const Quat< T > &q)
return tan value of quaternion q, tan could be calculated as:
static Quat< _Tp > createFromAngleAxis(const _Tp angle, const Vec< _Tp, 3 > &axis)
from an angle, axis. Axis will be normalized in this function. And it generates
friend Quat< T > log(const Quat< T > &q, QuatAssumeType assumeUnit)
return the value of logarithm function.
_Tp norm() const
return the norm of quaternion.
friend Quat< T > power(const Quat< T > &q, const T x, QuatAssumeType assumeUnit)
return the value of power function with index .
Quat< _Tp > cosh() const
return cosh value of this quaternion, cosh could be calculated as:
void assertNormal(_Tp eps=CV_QUAT_EPS) const
to throw an error if this quaternion is not a unit quaternion.
Quat(_Tp w, _Tp x, _Tp y, _Tp z)
from four numbers.
Quat< _Tp > & operator-=(const Quat< _Tp > &)
Subtraction assignment operator of two quaternions p and q. It subtracts right operand from the left ...
Quat< _Tp > atan() const
return arctan value of this quaternion, arctan could be calculated as:
Quat< _Tp > exp() const
return the value of exponential value.
Quat(const Vec< _Tp, 4 > &coeff)
From Vec4d or Vec4f.
Quat< _Tp > operator/(const Quat< _Tp > &) const
Division operator of two quaternions p and q. Divides left hand operand by right hand operand.
Quat< _Tp > atanh() const
return arctanh value of this quaternion, arctanh could be calculated as:
static constexpr _Tp CV_QUAT_CONVERT_THRESHOLD
Definition: quaternion.hpp:216
static Quat< _Tp > createFromYRot(const _Tp theta)
get a quaternion from a rotation about the Y-axis by .
const _Tp & operator[](std::size_t n) const
Quat< _Tp > tan() const
return tan value of this quaternion, tan could be calculated as:
friend Quat< T > tanh(const Quat< T > &q)
return tanh value of quaternion q, tanh could be calculated as:
static Quat< _Tp > createFromRvec(InputArray rvec)
from a rotation vector has the form , where represents rotation angle and represents normalized ro...
Vec< _Tp, 3 > toRotVec(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
transform this quaternion to a Rotation vector.
Vec< _Tp, 3 > getAxis(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
get the axis of quaternion, it returns a vector of length 3.
_Tp at(size_t index) const
a way to get element.
static Quat< _Tp > squad(const Quat< _Tp > &q0, const Quat< _Tp > &s0, const Quat< _Tp > &s1, const Quat< _Tp > &q1, const _Tp t, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT, bool directChange=true)
To calculate the interpolation between , , , by Spherical and quadrangle(Squad). This could be defin...
Quat< _Tp > power(const _Tp x, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
return the value of power function with index .
_Tp w
Definition: quaternion.hpp:1618
friend Quat< T > atanh(const Quat< T > &q)
return arctanh value of quaternion q, arctanh could be calculated as:
Quat< _Tp > crossProduct(const Quat< _Tp > &q) const
return the crossProduct between and .
static Quat< _Tp > createFromXRot(const _Tp theta)
get a quaternion from a rotation about the X-axis by .
friend Quat< T > acos(const Quat< T > &q)
return arccos value of quaternion q, arccos could be calculated as:
Quat< _Tp > operator-(const Quat< _Tp > &) const
Subtraction operator of two quaternions p and q. It returns a new quaternion that each value is the s...
InputArrayOfArrays InputArrayOfArrays InputOutputArray InputOutputArray InputOutputArray InputOutputArray Size InputOutputArray InputOutputArray T
Definition: calib3d.hpp:1867
InputArrayOfArrays InputArrayOfArrays InputOutputArray InputOutputArray InputOutputArray InputOutputArray Size InputOutputArray R
Definition: calib3d.hpp:1867
CV__DEBUG_NS_END typedef const _InputArray & InputArray
Definition: mat.hpp:442
const CvArr * angle
Definition: core_c.h:1194
int index
Definition: core_c.h:634
const CvArr CvArr * x
Definition: core_c.h:1195
Quat< T > asinh(const Quat< T > &q)
Quat< T > tanh(const Quat< T > &q)
Quat< T > acosh(const Quat< T > &q)
Quat< T > acos(const Quat< T > &q)
Quat< T > tan(const Quat< T > &q)
Quat< T > sin(const Quat< T > &q)
Quat< T > crossProduct(const Quat< T > &p, const Quat< T > &q)
Quat< T > atan(const Quat< T > &q)
Quat< T > asin(const Quat< T > &q)
Quat< T > sinh(const Quat< T > &q)
Quat< S > sqrt(const Quat< S > &q, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT)
QuatAssumeType
Unit quaternion flag.
Definition: quaternion.hpp:39
Quat< T > cosh(const Quat< T > &q)
Quat< T > atanh(const Quat< T > &q)
Quat< T > cos(const Quat< T > &q)
std::ostream & operator<<(std::ostream &, const DualQuat< _Tp > &)
@ QUAT_ASSUME_NOT_UNIT
Definition: quaternion.hpp:46
@ QUAT_ASSUME_UNIT
Definition: quaternion.hpp:52
void int double double theta
Definition: imgproc_c.h:926
int CvMemStorage int double eps
Definition: imgproc_c.h:493
"black box" representation of the file storage associated with a file on disk.
Definition: calib3d.hpp:441
DualQuat< T > operator+(const T a, const DualQuat< T > &q)
Definition: dualquaternion.inl.hpp:243
DualQuat< T > power(const DualQuat< T > &dq, const T t, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT)
Definition: dualquaternion.inl.hpp:358
DualQuat< T > inv(const DualQuat< T > &dq, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT)
Definition: dualquaternion.inl.hpp:187
DualQuat< T > operator*(const T a, const DualQuat< T > &q)
Definition: dualquaternion.inl.hpp:274
DualQuat< T > log(const DualQuat< T > &dq, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT)
Definition: dualquaternion.inl.hpp:344
DualQuat< T > operator-(const DualQuat< T > &q, const T a)
Definition: dualquaternion.inl.hpp:255
DualQuat< T > exp(const DualQuat< T > &dq)
Definition: dualquaternion.inl.hpp:312