26#ifndef OPENCV_CORE_QUATERNION_HPP
27#define OPENCV_CORE_QUATERNION_HPP
29#include <opencv2/core.hpp>
30#include <opencv2/core/utils/logger.hpp>
132template <
typename _Tp>
class Quat;
209template <
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>
1622template <
typename T>
1625template <
typename T>
1628template <
typename T>
1631template <
typename T>
1634template <
typename T>
1637template <
typename T>
1640template <
typename T>
1643template <
typename T>
1646template <
typename T>
1649template <
typename T>
1652template <
typename T>
1655template <
typename T>
1658template <
typename T>
1661template <
typename T>
1664template <
typename T>
1667template <
typename T>
1670template <
typename T>
1673template <
typename T>
1676template <
typename S>
1679template <
typename T>
1682template <
typename T>
1685template <
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
Quat< _Tp > cosh() const
return cosh value of this quaternion, cosh could be calculated as:
_Tp dot(Quat< _Tp > q) const
return the dot between quaternion and this quaternion.
static Quat< _Tp > createFromRvec(InputArray rvec)
from a rotation vector has the form , where represents rotation angle and represents normalized ro...
static Quat< _Tp > createFromZRot(const _Tp theta)
get a quaternion from a rotation about the Z-axis by .
friend Quat< T > cosh(const Quat< T > &q)
return cosh value of quaternion q, cosh could be calculated as:
static Quat< _Tp > createFromYRot(const _Tp theta)
get a quaternion from a rotation about the Y-axis by .
static constexpr _Tp CV_QUAT_EPS
Definition quaternion.hpp:215
Quat< _Tp > conjugate() const
return the conjugate of this quaternion.
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...
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...
friend Quat< T > tanh(const Quat< T > &q)
return tanh value of quaternion q, tanh could be calculated as:
friend Quat< T > power(const Quat< T > &q, const T x, QuatAssumeType assumeUnit)
return the value of power function with index .
Quat< _Tp > operator*(const Quat< _Tp > &) const
Multiplication operator of two quaternions q and p. Multiplies values on either side of the operator.
Quat< _Tp > asinh() const
return arcsinh value of this quaternion, arcsinh could be calculated as:
Quat< _Tp > acosh() const
return arccosh value of this quaternion, arccosh could be calculated as:
static Quat< _Tp > createFromEulerAngles(const Vec< _Tp, 3 > &angles, QuatEnum::EulerAnglesType eulerAnglesType)
from Euler angles
static Quat< _Tp > createFromXRot(const _Tp theta)
get a quaternion from a rotation about the X-axis by .
_Tp getAngle(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
get the angle of quaternion, it returns the rotation angle.
const _Tp & operator[](std::size_t n) const
Quat< _Tp > power(const Quat< _Tp > &q, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
return the value of power function with quaternion .
Vec< _Tp, 3 > getAxis(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
get the axis of quaternion, it returns a vector of length 3.
friend Quat< T > sin(const Quat< T > &q)
return tanh value of quaternion q, sin could be calculated as:
Quat< _Tp > exp() const
return the value of exponential value.
friend Quat< T > log(const Quat< T > &q, QuatAssumeType assumeUnit)
return the value of logarithm function.
static Quat< _Tp > createFromRotMat(InputArray R)
from a 3x3 rotation matrix.
Quat< _Tp > & operator/=(const Quat< _Tp > &)
Division assignment operator of two quaternions p and q; It divides left operand with the right opera...
Quat< _Tp > & operator*=(const _Tp s)
Multiplication assignment operator of a quaternions and a scalar. It multiplies right operand with th...
Matx< _Tp, 4, 4 > toRotMat4x4(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
transform a quaternion to a 4x4 rotation matrix.
Quat< _Tp > tan() const
return tan value of this quaternion, tan could be calculated as:
Quat< _Tp > sqrt(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
return .
Quat< _Tp > atan() const
return arctan value of this quaternion, arctan 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...
Quat< _Tp > & operator-=(const Quat< _Tp > &)
Subtraction assignment operator of two quaternions p and q. It subtracts right operand from the left ...
Quat< _Tp > & operator*=(const Quat< _Tp > &)
Multiplication assignment operator of two quaternions q and p. It multiplies right operand with the l...
Quat< _Tp > sinh() const
return sinh value of this quaternion, sinh could be calculated as: where
bool isNormal(_Tp eps=CV_QUAT_EPS) const
return true if this quaternion is a unit quaternion.
_Tp & operator[](std::size_t n)
Vec< _Tp, 3 > toEulerAngles(QuatEnum::EulerAnglesType eulerAnglesType)
Transform a quaternion q to Euler angles.
Vec< _Tp, 4 > toVec() const
transform the this quaternion to a Vec<T, 4>.
Quat< _Tp > crossProduct(const Quat< _Tp > &q) const
return the crossProduct between and .
Quat< _Tp > asin() const
return arcsin value of this quaternion, arcsin could be calculated as:
Quat< _Tp > & operator+=(const Quat< _Tp > &)
Addition assignment operator of two quaternions p and q. It adds right operand to the left operand an...
_Tp z
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 > normalize() const
return a normalized .
friend Quat< T > sinh(const Quat< T > &q)
return sinh value of quaternion q, sinh could be calculated as:
_Tp y
Definition quaternion.hpp:1618
Quat< _Tp > power(const _Tp x, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
return the value of power function with index .
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...
friend Quat< T > acosh(const Quat< T > &q)
return arccosh value of quaternion q, arccosh 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),...
friend Quat< T > atan(const Quat< T > &q)
return arctan value of quaternion q, arctan could be calculated as:
friend Quat< T > inv(const Quat< T > &q, QuatAssumeType assumeUnit)
return which is an inverse of which satisfies .
Quat< _Tp > acos() const
return arccos value of this quaternion, arccos could be calculated as:
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 > exp(const Quat< T > &q)
return the value of exponential value.
Quat< _Tp > cos() const
return cos value of this quaternion, cos could be calculated as:
Quat< _Tp > log(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
return the value of logarithm function.
Quat< _Tp > tanh() const
return tanh value of this quaternion, tanh could be calculated as:
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 ...
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...
_Tp x
Definition quaternion.hpp:1618
friend Quat< T > tan(const Quat< T > &q)
return tan value of quaternion q, tan could be calculated as:
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,...
_Tp norm() const
return the norm of quaternion.
void assertNormal(_Tp eps=CV_QUAT_EPS) const
to throw an error if this quaternion is not a unit quaternion.
Quat< _Tp > operator-() const
Return opposite quaternion which satisfies .
Quat(_Tp w, _Tp x, _Tp y, _Tp z)
from four numbers.
Quat< _Tp > sin() const
return sin value of this quaternion, sin could be calculated as:
friend Quat< T > asinh(const Quat< T > &q)
return arcsinh value of quaternion q, arcsinh could be calculated as:
friend Quat< T > sqrt(const Quat< T > &q, QuatAssumeType assumeUnit)
return .
Quat(const Vec< _Tp, 4 > &coeff)
From Vec4d or Vec4f.
Quat< _Tp > inv(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
return which is an inverse of satisfying .
friend Quat< T > acos(const Quat< T > &q)
return arccos value of quaternion q, arccos could be calculated as:
Matx< _Tp, 3, 3 > toRotMat3x3(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
transform a quaternion to a 3x3 rotation matrix.
Quat< _Tp > & operator/=(const _Tp s)
Division assignment operator of a quaternions and a scalar. It divides left operand with the right op...
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
friend Quat< T > crossProduct(const Quat< T > &p, const Quat< T > &q)
return the crossProduct between and .
friend Quat< T > cos(const Quat< T > &q)
return sin value of quaternion q, cos could be calculated as:
Vec< _Tp, 3 > toRotVec(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const
transform this quaternion to a Rotation vector.
_Tp at(size_t index) const
a way to get element.
friend Quat< T > asin(const Quat< T > &q)
return arcsin value of quaternion q, arcsin could be calculated as:
friend Quat< T > power(const Quat< T > &p, const Quat< T > &q, QuatAssumeType assumeUnit)
return the value of power function with quaternion .
_Tp w
Definition quaternion.hpp:1618
Quat< _Tp > operator/(const Quat< _Tp > &) const
Division operator of two quaternions p and q. Divides left hand operand by right hand operand.
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
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...
Template class for short numerical vectors, a partial case of Matx.
Definition matx.hpp:369
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
static String & operator<<(String &out, Ptr< Formatted > fmtd)
Definition core.hpp:3164
CV__DEBUG_NS_END typedef const _InputArray & InputArray
Definition mat.hpp:442
int index
Definition core_c.h:634
const CvArr * angle
Definition core_c.h:1194
CvArr double power
Definition core_c.h:1199
const CvArr CvArr * x
Definition core_c.h:1195
Quat< T > tan(const Quat< T > &q)
Quat< T > asinh(const Quat< T > &q)
Quat< T > asin(const Quat< T > &q)
Quat< T > tanh(const Quat< T > &q)
Quat< T > crossProduct(const Quat< T > &p, const Quat< T > &q)
Quat< T > acosh(const Quat< T > &q)
Quat< T > atanh(const Quat< T > &q)
Quat< T > cos(const Quat< T > &q)
Quat< T > sinh(const Quat< T > &q)
QuatAssumeType
Unit quaternion flag.
Definition quaternion.hpp:39
Quat< T > cosh(const Quat< T > &q)
Quat< T > atan(const Quat< T > &q)
Quat< T > sin(const Quat< T > &q)
Quat< T > acos(const Quat< T > &q)
@ 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 > inv(const DualQuat< T > &dq, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT)
Definition dualquaternion.inl.hpp:187
DualQuat< T > operator-(const DualQuat< T > &q, const T a)
Definition dualquaternion.inl.hpp:255
DualQuat< T > operator+(const T a, const DualQuat< T > &q)
Definition dualquaternion.inl.hpp:243
DualQuat< T > operator*(const T a, const DualQuat< T > &q)
Definition dualquaternion.inl.hpp:274