Skip to content

Commit

Permalink
Merge pull request opencv#18335 from chargerKong:master
Browse files Browse the repository at this point in the history
Ordinary quaternion

* version 1.0

* add assumeUnit;
add UnitTest;
check boundary value;
fix the func using method: func(obj);
fix 4x4;
add rodrigues vector transformation;
fix mat to quat;

* fix blank and tab

* fix blank and tab
modify test;cpp to hpp

* mainly improve comment;
add rvec2Quat;fix toRodrigues;
fix throw to CV_Error

* fix bug of quatd * int;
combine hpp and cpp;
fix << overload error in win system;
modify include in test file;

* move implementation to quaternion.ini.hpp;
change some constructor to createFrom* function;
change Rodrigues vector to rotation vector;
change the matexpr to mat of 3x3 return type;
improve comments;

* try fix log function error in win

* add enums for assumeUnit;
improve docs;
add using std::cos funcs

* remove using std::* from header;
add std::* in affine.hpp,warpers_inl.hpp;

* quat: coding style

* quat: AssumeType => QuatAssumeType
  • Loading branch information
chargerKong authored and Sajjad Ali committed Mar 27, 2023
1 parent 74ea527 commit 30c3abb
Show file tree
Hide file tree
Showing 5 changed files with 2,302 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/core/include/opencv2/core/affine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ typename cv::Affine3<T>::Vec3 cv::Affine3<T>::rvec() const
double s = std::sqrt((rx*rx + ry*ry + rz*rz)*0.25);
double c = (R.val[0] + R.val[4] + R.val[8] - 1) * 0.5;
c = c > 1.0 ? 1.0 : c < -1.0 ? -1.0 : c;
double theta = acos(c);
double theta = std::acos(c);

if( s < 1e-5 )
{
Expand Down

0 comments on commit 30c3abb

Please sign in to comment.