![]() |
OpenCV
Open Source Computer Vision
|
#include <opencv2/core/quaternion.hpp>
Public Member Functions | |
Quat () | |
Quat (const Vec< _Tp, 4 > &coeff) | |
From Vec4d or Vec4f. More... | |
Quat (_Tp w, _Tp x, _Tp y, _Tp z) | |
from four numbers. More... | |
Quat< _Tp > | acos () const |
return arccos value of this quaternion, arccos could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where | |
Quat< _Tp > | acosh () const |
return arccosh value of this quaternion, arccosh could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() . More... | |
Quat< _Tp > | asin () const |
return arcsin value of this quaternion, arcsin could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where | |
Quat< _Tp > | asinh () const |
return arcsinh value of this quaternion, arcsinh could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() . More... | |
void | assertNormal (_Tp eps=CV_QUAT_EPS) const |
to throw an error if this quaternion is not a unit quaternion. More... | |
_Tp | at (size_t index) const |
a way to get element. More... | |
Quat< _Tp > | atan () const |
return arctan value of this quaternion, arctan could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where | |
Quat< _Tp > | atanh () const |
return arctanh value of this quaternion, arctanh could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() . More... | |
Quat< _Tp > | conjugate () const |
return the conjugate of this quaternion.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
Quat< _Tp > | cos () const |
return cos value of this quaternion, cos could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where | |
Quat< _Tp > | cosh () const |
return cosh value of this quaternion, cosh could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where | |
Quat< _Tp > | crossProduct (const Quat< _Tp > &q) const |
return the crossProduct between ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
_Tp | dot (Quat< _Tp > q) const |
return the dot between quaternion ![]() | |
Quat< _Tp > | exp () const |
return the value of exponential value.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where | |
_Tp | getAngle (QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const |
get the angle of quaternion, it returns the rotation angle. More... | |
Vec< _Tp, 3 > | getAxis (QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const |
get the axis of quaternion, it returns a vector of length 3. More... | |
Quat< _Tp > | inv (QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const |
return ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
bool | isNormal (_Tp eps=CV_QUAT_EPS) const |
return true if this quaternion is a unit quaternion. More... | |
Quat< _Tp > | log (QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const |
return the value of logarithm function.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() . where | |
_Tp | norm () const |
return the norm of quaternion.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
Quat< _Tp > | normalize () const |
return a normalized ![]()
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where | |
Quat< _Tp > | operator* (const Quat< _Tp > &) const |
Multiplication operator of two quaternions q and p. Multiplies values on either side of the operator. More... | |
Quat< _Tp > & | operator*= (const Quat< _Tp > &) |
Multiplication assignment operator of two quaternions q and p. It multiplies right operand with the left operand and assign the result to left operand. More... | |
Quat< _Tp > & | operator*= (const _Tp s) |
Multiplication assignment operator of a quaternions and a scalar. It multiplies right operand with the left operand and assign the result to left operand. More... | |
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 of ![]() ![]() ![]() ![]() | |
Quat< _Tp > & | operator+= (const Quat< _Tp > &) |
Addition assignment operator of two quaternions p and q. It adds right operand to the left operand and assign the result to left operand. More... | |
Quat< _Tp > | operator- () const |
Return opposite quaternion ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
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 sum of ![]() ![]() ![]() ![]() ![]() | |
Quat< _Tp > & | operator-= (const Quat< _Tp > &) |
Subtraction assignment operator of two quaternions p and q. It subtracts right operand from the left operand and assign the result to left operand. More... | |
Quat< _Tp > | operator/ (const _Tp s) const |
Division operator of a quaternions and a scalar. It divides left operand with the right operand and assign the result to left operand. More... | |
Quat< _Tp > | operator/ (const Quat< _Tp > &) const |
Division operator of two quaternions p and q. Divides left hand operand by right hand operand. More... | |
Quat< _Tp > & | operator/= (const _Tp s) |
Division assignment operator of a quaternions and a scalar. It divides left operand with the right operand and assign the result to left operand. More... | |
Quat< _Tp > & | operator/= (const Quat< _Tp > &) |
Division assignment operator of two quaternions p and q; It divides left operand with the right operand and assign the result to left operand. More... | |
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 ![]() ![]() ![]() ![]() | |
_Tp & | operator[] (std::size_t n) |
const _Tp & | operator[] (std::size_t n) const |
Quat< _Tp > | power (const _Tp x, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const |
return the value of power function with index ![]()
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
Quat< _Tp > | power (const Quat< _Tp > &q, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const |
return the value of power function with quaternion ![]()
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
Quat< _Tp > | sin () const |
return sin value of this quaternion, sin could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where | |
Quat< _Tp > | sinh () const |
return sinh value of this quaternion, sinh could be calculated as: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
Quat< _Tp > | sqrt (QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const |
return ![]() ![]() | |
Quat< _Tp > | tan () const |
return tan value of this quaternion, tan could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
Quat< _Tp > | tanh () const |
return tanh value of this quaternion, tanh could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
Matx< _Tp, 3, 3 > | toRotMat3x3 (QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const |
transform a quaternion to a 3x3 rotation matrix. More... | |
Matx< _Tp, 4, 4 > | toRotMat4x4 (QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const |
transform a quaternion to a 4x4 rotation matrix. More... | |
Vec< _Tp, 3 > | toRotVec (QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const |
transform this quaternion to a Rotation vector. More... | |
Vec< _Tp, 4 > | toVec () const |
transform the this quaternion to a Vec<T, 4>. More... | |
Static Public Member Functions | |
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
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where | |
static Quat< _Tp > | createFromRotMat (InputArray R) |
from a 3x3 rotation matrix. More... | |
static Quat< _Tp > | createFromRvec (InputArray rvec) |
from a rotation vector ![]() ![]() ![]() ![]() ![]() ![]() | |
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 ![]() ![]()
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() . More... | |
static Quat< _Tp > | lerp (const Quat< _Tp > &q0, const Quat &q1, const _Tp t) |
To calculate the interpolation from ![]() ![]() ![]() ![]()
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Obviously, the lerp will interpolate along a straight line if we think of | |
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 ![]() ![]() ![]() ![]()
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() The interpolation will always choose the shortest path but the constant speed is not guaranteed. More... | |
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 ![]() ![]() ![]() ![]()
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() resulting from the both of their norm is unit. More... | |
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 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
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 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() . More... | |
Public Attributes | |
_Tp | w |
_Tp | x |
_Tp | y |
_Tp | z |
Static Public Attributes | |
static constexpr _Tp | CV_QUAT_EPS = (_Tp)1.e-6 |
Friends | |
template<typename T > | |
Quat< T > | acos (const Quat< T > &q) |
return arccos value of quaternion q, arccos could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where | |
template<typename T > | |
Quat< T > | acosh (const Quat< T > &q) |
return arccosh value of quaternion q, arccosh could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() . More... | |
template<typename T > | |
Quat< T > | asin (const Quat< T > &q) |
return arcsin value of quaternion q, arcsin could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where | |
template<typename T > | |
Quat< T > | asinh (const Quat< T > &q) |
return arcsinh value of quaternion q, arcsinh could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() . More... | |
template<typename T > | |
Quat< T > | atan (const Quat< T > &q) |
return arctan value of quaternion q, arctan could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where | |
template<typename T > | |
Quat< T > | atanh (const Quat< T > &q) |
return arctanh value of quaternion q, arctanh could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() . More... | |
template<typename T > | |
Quat< T > | cos (const Quat< T > &q) |
return sin value of quaternion q, cos could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where | |
template<typename T > | |
Quat< T > | cosh (const Quat< T > &q) |
return cosh value of quaternion q, cosh could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where | |
template<typename T > | |
Quat< T > | crossProduct (const Quat< T > &p, const Quat< T > &q) |
return the crossProduct between ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
template<typename T > | |
Quat< T > | cv::operator* (const T s, const Quat< T > &) |
Multiplication operator of a scalar and a quaternions. It multiplies right operand with the left operand and assign the result to left operand. More... | |
template<typename T > | |
Quat< T > | cv::operator* (const Quat< T > &, const T s) |
Multiplication operator of a quaternion and a scalar. It multiplies right operand with the left operand and assign the result to left operand. More... | |
template<typename T > | |
Quat< T > | cv::operator+ (const T s, const Quat< T > &) |
Addition operator of a quaternions and a scalar. Adds right hand operand from left hand operand. More... | |
template<typename T > | |
Quat< T > | cv::operator+ (const Quat< T > &, const T s) |
Addition operator of a quaternions and a scalar. Adds right hand operand from left hand operand. More... | |
template<typename T > | |
Quat< T > | cv::operator- (const T s, const Quat< T > &) |
Subtraction operator of a scalar and a quaternions. Subtracts right hand operand from left hand operand. More... | |
template<typename T > | |
Quat< T > | cv::operator- (const Quat< T > &, const T s) |
Subtraction operator of a quaternions and a scalar. Subtracts right hand operand from left hand operand. More... | |
template<typename S > | |
std::ostream & | cv::operator<< (std::ostream &, const Quat< S > &) |
template<typename T > | |
Quat< T > | exp (const Quat< T > &q) |
return the value of exponential value.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where | |
template<typename T > | |
Quat< T > | inv (const Quat< T > &q, QuatAssumeType assumeUnit) |
return ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
template<typename T > | |
Quat< T > | log (const Quat< T > &q, QuatAssumeType assumeUnit) |
return the value of logarithm function.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where | |
template<typename T > | |
Quat< T > | power (const Quat< T > &q, const T x, QuatAssumeType assumeUnit) |
return the value of power function with index ![]()
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
template<typename T > | |
Quat< T > | power (const Quat< T > &p, const Quat< T > &q, QuatAssumeType assumeUnit) |
return the value of power function with quaternion ![]()
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
template<typename T > | |
Quat< T > | sin (const Quat< T > &q) |
return tanh value of quaternion q, sin could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where | |
template<typename T > | |
Quat< T > | sinh (const Quat< T > &q) |
return sinh value of quaternion q, sinh could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() where | |
template<typename T > | |
Quat< T > | sqrt (const Quat< T > &q, QuatAssumeType assumeUnit) |
return ![]() ![]() | |
template<typename T > | |
Quat< T > | tan (const Quat< T > &q) |
return tan value of quaternion q, tan could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
template<typename T > | |
Quat< T > | tanh (const Quat< T > &q) |
return tanh value of quaternion q, tanh could be calculated as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
Quaternion is a number system that extends the complex numbers. It can be expressed as a rotation in three-dimensional space. A quaternion is generally represented in the form:
where
A unit quaternion is usually represents rotation, which has the form:
To create a quaternion representing the rotation around the axis
You can simply use four same type number to create a quaternion
Or use a Vec4d or Vec4f vector.
If you already have a 3x3 rotation matrix R, then you can use
If you already have a rotation vector rvec which has the form of angle * axis
, then you can use
To extract the rotation matrix from quaternion, see toRotMat3x3()
To extract the Vec4d or Vec4f, see toVec()
To extract the rotation vector, see toRotVec()
If there are two quaternions
spline can smoothly connect rotations of multiple quaternions
Three ways to get an element in Quaternion
From Vec4d or Vec4f.
return arccos value of this quaternion, arccos could be calculated as:
where
For example
return arccosh value of this quaternion, arccosh could be calculated as:
.
For example
return arcsin value of this quaternion, arcsin could be calculated as:
where
For example
return arcsinh value of this quaternion, arcsinh could be calculated as:
.
For example
void cv::Quat< _Tp >::assertNormal | ( | _Tp | eps = CV_QUAT_EPS | ) | const |
to throw an error if this quaternion is not a unit quaternion.
eps | tolerance scope of normalization. |
_Tp cv::Quat< _Tp >::at | ( | size_t | index | ) | const |
a way to get element.
index | over a range [0, 3]. |
A quaternion q
q.at(0) is equivalent to q.w,
q.at(1) is equivalent to q.x,
q.at(2) is equivalent to q.y,
q.at(3) is equivalent to q.z.
return arctan value of this quaternion, arctan could be calculated as:
where
For example
return arctanh value of this quaternion, arctanh could be calculated as:
.
For example
return the conjugate of this quaternion.
return cos value of this quaternion, cos could be calculated as:
where
For example
return cosh value of this quaternion, cosh could be calculated as:
where
For example
|
static |
from an angle, axis. Axis will be normalized in this function. And it generates
where
|
static |
from a 3x3 rotation matrix.
|
static |
from a rotation vector
Angle and axis could be easily derived as:
Then a quaternion can be calculated by
where
return the dot between quaternion
dot(p, q) is a good metric of how close the quaternions are. Indeed, consider the unit quaternion difference
q | the other quaternion. |
For example
_Tp cv::Quat< _Tp >::getAngle | ( | QuatAssumeType | assumeUnit = QUAT_ASSUME_NOT_UNIT | ) | const |
get the angle of quaternion, it returns the rotation angle.
assumeUnit | if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
For example
Vec<_Tp, 3> cv::Quat< _Tp >::getAxis | ( | QuatAssumeType | assumeUnit = QUAT_ASSUME_NOT_UNIT | ) | const |
get the axis of quaternion, it returns a vector of length 3.
assumeUnit | if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations. |
the unit axis
where
For example
|
static |
This is the part calculation of squad. To calculate the intermedia quaternion
.
q0 | the first quaternion. |
q1 | the second quaternion. |
q2 | the third quaternion. |
assumeUnit | if QUAT_ASSUME_UNIT, all input quaternions assume to be unit quaternion. Otherwise, all input quaternions will be normalized inside the function. |
Quat<_Tp> cv::Quat< _Tp >::inv | ( | QuatAssumeType | assumeUnit = QUAT_ASSUME_NOT_UNIT | ) | const |
return
assumeUnit | if QUAT_ASSUME_UNIT, quaternion q assume to be a unit quaternion and this function will save some computations. |
For example
bool cv::Quat< _Tp >::isNormal | ( | _Tp | eps = CV_QUAT_EPS | ) | const |
return true if this quaternion is a unit quaternion.
eps | tolerance scope of normalization. The eps could be defined as |
where
And this function will consider it is normalized when the dotValue over a range
|
static |
To calculate the interpolation from
Obviously, the lerp will interpolate along a straight line if we think of
q0 | a quaternion used in linear interpolation. |
q1 | a quaternion used in linear interpolation. |
t | percent of vector ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Quat<_Tp> cv::Quat< _Tp >::log | ( | QuatAssumeType | assumeUnit = QUAT_ASSUME_NOT_UNIT | ) | const |
return the value of logarithm function.
. where
assumeUnit | if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations. |
For example
|
static |
To calculate the interpolation from
The interpolation will always choose the shortest path but the constant speed is not guaranteed.
q0 | a quaternion used in normalized linear interpolation. |
q1 | a quaternion used in normalized linear interpolation. |
t | percent of vector ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
assumeUnit | if QUAT_ASSUME_UNIT, all input quaternions assume to be unit quaternion. Otherwise, all inputs quaternion will be normalized inside the function. |
_Tp cv::Quat< _Tp >::norm | ( | ) | const |
return the norm of quaternion.
return a normalized
where
Multiplication assignment operator of two quaternions q and p. It multiplies right operand with the left operand and assign the result to left operand.
Rule of quaternion multiplication:
where
For example
Multiplication assignment operator of a quaternions and a scalar. It multiplies right operand with the left operand and assign the result to left operand.
Rule of quaternion multiplication with a scalar:
For example
Return opposite quaternion
For example
Division operator of a quaternions and a scalar. It divides left operand with the right operand and assign the result to left operand.
Rule of quaternion division with a scalar:
For example
Division assignment operator of a quaternions and a scalar. It divides left operand with the right operand and assign the result to left operand.
Rule of quaternion division with a scalar:
For example
Division assignment operator of two quaternions p and q; It divides left operand with the right operand and assign the result to left operand.
Rule of quaternion division with a quaternion:
For example
return true if two quaternions p and q are nearly equal, i.e. when the absolute value of each
_Tp& cv::Quat< _Tp >::operator[] | ( | std::size_t | n | ) |
const _Tp& cv::Quat< _Tp >::operator[] | ( | std::size_t | n | ) | const |
Quat<_Tp> cv::Quat< _Tp >::power | ( | const _Tp | x, |
QuatAssumeType | assumeUnit = QUAT_ASSUME_NOT_UNIT |
||
) | const |
return the value of power function with index
x | index of exponentiation. |
assumeUnit | if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations. |
For example
Quat<_Tp> cv::Quat< _Tp >::power | ( | const Quat< _Tp > & | q, |
QuatAssumeType | assumeUnit = QUAT_ASSUME_NOT_UNIT |
||
) | const |
return the value of power function with quaternion
q | index quaternion of power function. |
assumeUnit | if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations. |
For example
return sin value of this quaternion, sin could be calculated as:
where
For example
return sinh value of this quaternion, sinh could be calculated as:
For example
|
static |
To calculate the interpolation between
where
resulting from the both of their norm is unit.
q0 | a quaternion used in Slerp. |
q1 | a quaternion used in Slerp. |
t | percent of angle between ![]() ![]() ![]() ![]() |
assumeUnit | if QUAT_ASSUME_UNIT, all input quaternions assume to be unit quaternions. Otherwise, all input quaternions will be normalized inside the function. |
directChange | if QUAT_ASSUME_UNIT, the interpolation will choose the nearest path. |
|
static |
to calculate a quaternion which is the result of a
q0 | the first input quaternion to ensure ![]() ![]() |
q1 | the second input quaternion. |
q2 | the third input quaternion. |
q3 | the fourth input quaternion the same use of ![]() ![]() |
t | ratio over a range [0, 1]. |
assumeUnit | if QUAT_ASSUME_UNIT, ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
For example:
If there are three double quaternions
Interpolation between
Interpolation between
Quat<_Tp> cv::Quat< _Tp >::sqrt | ( | QuatAssumeType | assumeUnit = QUAT_ASSUME_NOT_UNIT | ) | const |
return
assumeUnit | if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations. |
For example
|
static |
To calculate the interpolation between
where
.
The Squad expression is analogous to the
q0 | the first quaternion. |
s0 | the second quaternion. |
s1 | the third quaternion. |
q1 | thr fourth quaternion. |
t | interpolation parameter of quadratic and linear interpolation over a range ![]() ![]() ![]() ![]() ![]() |
assumeUnit | if QUAT_ASSUME_UNIT, all input quaternions assume to be unit quaternion. Otherwise, all input quaternions will be normalized inside the function. |
directChange | if QUAT_ASSUME_UNIT, squad will find the nearest path to interpolate. |
return tan value of this quaternion, tan could be calculated as:
For example
Matx<_Tp, 3, 3> cv::Quat< _Tp >::toRotMat3x3 | ( | QuatAssumeType | assumeUnit = QUAT_ASSUME_NOT_UNIT | ) | const |
transform a quaternion to a 3x3 rotation matrix.
assumeUnit | if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations. Otherwise, this function will normalized this quaternion at first then to do the transformation. |
For example
Matx<_Tp, 4, 4> cv::Quat< _Tp >::toRotMat4x4 | ( | QuatAssumeType | assumeUnit = QUAT_ASSUME_NOT_UNIT | ) | const |
transform a quaternion to a 4x4 rotation matrix.
assumeUnit | if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations. Otherwise, this function will normalized this quaternion at first then to do the transformation. |
The operations is similar as toRotMat3x3 except that the points matrix should have the form
Vec<_Tp, 3> cv::Quat< _Tp >::toRotVec | ( | QuatAssumeType | assumeUnit = QUAT_ASSUME_NOT_UNIT | ) | const |
transform this quaternion to a Rotation vector.
assumeUnit | if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations. Rotation vector rVec is defined as:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
For example
|
friend |
return the crossProduct between
For example
|
friend |
Multiplication operator of a scalar and a quaternions. It multiplies right operand with the left operand and assign the result to left operand.
Rule of quaternion multiplication with a scalar:
For example
|
friend |
Multiplication operator of a quaternion and a scalar. It multiplies right operand with the left operand and assign the result to left operand.
Rule of quaternion multiplication with a scalar:
For example
|
friend |
Addition operator of a quaternions and a scalar. Adds right hand operand from left hand operand.
For example
|
friend |
Addition operator of a quaternions and a scalar. Adds right hand operand from left hand operand.
For example
|
friend |
Subtraction operator of a scalar and a quaternions. Subtracts right hand operand from left hand operand.
For example
|
friend |
Subtraction operator of a quaternions and a scalar. Subtracts right hand operand from left hand operand.
For example
|
friend |
|
friend |
return
q | a quaternion. |
assumeUnit | if QUAT_ASSUME_UNIT, quaternion q assume to be a unit quaternion and this function will save some computations. |
For example
|
friend |
|
friend |
return the value of power function with index
q | a quaternion. |
x | index of exponentiation. |
assumeUnit | if QUAT_ASSUME_UNIT, quaternion q assume to be a unit quaternion and this function will save some computations. |
For example
|
friend |
return the value of power function with quaternion
p | base quaternion of power function. |
q | index quaternion of power function. |
assumeUnit | if QUAT_ASSUME_UNIT, quaternion ![]() |
For example
|
friend |
return
q | a quaternion. |
assumeUnit | if QUAT_ASSUME_UNIT, quaternion q assume to be a unit quaternion and this function will save some computations. |
For example
|
static |
_Tp cv::Quat< _Tp >::w |
_Tp cv::Quat< _Tp >::x |
_Tp cv::Quat< _Tp >::y |
_Tp cv::Quat< _Tp >::z |