diff --git a/modules/calib3d/test/test_affine3.cpp b/modules/calib3d/test/test_affine3.cpp index 62326e9203..cc94d99c19 100644 --- a/modules/calib3d/test/test_affine3.cpp +++ b/modules/calib3d/test/test_affine3.cpp @@ -79,3 +79,30 @@ TEST(Calib3d_Affine3f, accuracy) ASSERT_LT(cv::norm(diff, cv::NORM_INF), 1e-15); } + +TEST(Calib3d_Affine3f, accuracy_rvec) +{ + cv::RNG rng; + typedef float T; + + cv::Affine3::Vec3 w; + cv::Affine3::Mat3 u, vt, R; + + for(int i = 0; i < 100; ++i) + { + rng.fill(R, cv::RNG::UNIFORM, -10, 10, true); + cv::SVD::compute(R, w, u, vt, cv::SVD::FULL_UV + cv::SVD::MODIFY_A); + R = u * vt; + + //double s = (double)cv::getTickCount(); + cv::Affine3::Vec3 va = cv::Affine3(R).rvec(); + //std::cout << "M:" <<(cv::getTickCount() - s)*1000/cv::getTickFrequency() << std::endl; + + cv::Affine3::Vec3 vo; + //s = (double)cv::getTickCount(); + cv::Rodrigues(R, vo); + //std::cout << "O:" <<(cv::getTickCount() - s)*1000/cv::getTickFrequency() << std::endl; + + ASSERT_LT(cv::norm(va - vo), 1e-9); + } +} diff --git a/modules/viz/include/opencv2/viz/types.hpp b/modules/viz/include/opencv2/viz/types.hpp index 3cccfa06fe..682006f959 100644 --- a/modules/viz/include/opencv2/viz/types.hpp +++ b/modules/viz/include/opencv2/viz/types.hpp @@ -176,8 +176,8 @@ namespace cv /// cv::viz::Color inline cv::viz::Color::Color() : Scalar(0, 0, 0) {} -inline cv::viz::Color::Color(double gray) : Scalar(gray, gray, gray) {} -inline cv::viz::Color::Color(double blue, double green, double red) : Scalar(blue, green, red) {} +inline cv::viz::Color::Color(double _gray) : Scalar(_gray, _gray, _gray) {} +inline cv::viz::Color::Color(double _blue, double _green, double _red) : Scalar(_blue, _green, _red) {} inline cv::viz::Color::Color(const Scalar& color) : Scalar(color) {} inline cv::viz::Color cv::viz::Color::black() { return Color( 0, 0, 0); } diff --git a/modules/viz/src/precomp.hpp b/modules/viz/src/precomp.hpp index ac8c67c1bd..ab673b389c 100644 --- a/modules/viz/src/precomp.hpp +++ b/modules/viz/src/precomp.hpp @@ -54,14 +54,6 @@ #include #include -#if defined __GNUC__ -#pragma GCC system_header -#ifdef __DEPRECATED -#undef __DEPRECATED -#define __DEPRECATED_DISABLED__ -#endif -#endif - #include #include #include @@ -70,7 +62,6 @@ #include #include #include -//#include #include #include #include @@ -120,11 +111,6 @@ #include #include -#if defined __GNUC__ && defined __DEPRECATED_DISABLED__ -#define __DEPRECATED -#undef __DEPRECATED_DISABLED__ -#endif - #include #include #include diff --git a/modules/viz/src/viz3d_impl.cpp b/modules/viz/src/viz3d_impl.cpp index d868c48b0f..b1173f645d 100644 --- a/modules/viz/src/viz3d_impl.cpp +++ b/modules/viz/src/viz3d_impl.cpp @@ -48,6 +48,8 @@ #include "precomp.hpp" +vtkRenderWindowInteractor* vtkRenderWindowInteractorFixNew(); + #if 1 || !defined __APPLE__ vtkRenderWindowInteractor* vtkRenderWindowInteractorFixNew() { @@ -57,7 +59,7 @@ vtkRenderWindowInteractor* vtkRenderWindowInteractorFixNew() ///////////////////////////////////////////////////////////////////////////////////////////// cv::viz::Viz3d::VizImpl::VizImpl(const String &name) - : style_(vtkSmartPointer::New()) , widget_actor_map_(new WidgetActorMap), s_lastDone_(0.0) + : s_lastDone_(0.0), style_(vtkSmartPointer::New()), widget_actor_map_(new WidgetActorMap) { renderer_ = vtkSmartPointer::New(); @@ -77,7 +79,7 @@ cv::viz::Viz3d::VizImpl::VizImpl(const String &name) style_->UseTimersOn(); ///////////////////////////////////////////////// - interactor_ = vtkSmartPointer ::Take(vtkRenderWindowInteractorFixNew()); + interactor_ = vtkSmartPointer::Take(vtkRenderWindowInteractorFixNew()); window_->AlphaBitPlanesOff(); window_->PointSmoothingOff();