ASSERT_LT(cv::norm(diff, cv::NORM_INF), 1e-15);
}
+
+TEST(Calib3d_Affine3f, accuracy_rvec)
+{
+ cv::RNG rng;
+ typedef float T;
+
+ cv::Affine3<T>::Vec3 w;
+ cv::Affine3<T>::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<T>::Vec3 va = cv::Affine3<T>(R).rvec();
+ //std::cout << "M:" <<(cv::getTickCount() - s)*1000/cv::getTickFrequency() << std::endl;
+
+ cv::Affine3<T>::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);
+ }
+}
/// 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); }
#include <list>
#include <vector>
-#if defined __GNUC__
-#pragma GCC system_header
-#ifdef __DEPRECATED
-#undef __DEPRECATED
-#define __DEPRECATED_DISABLED__
-#endif
-#endif
-
#include <vtkAppendPolyData.h>
#include <vtkAssemblyPath.h>
#include <vtkCellData.h>
#include <vtkSmartPointer.h>
#include <vtkDataSet.h>
#include <vtkPolygon.h>
-//#include <vtkPointPicker.h>
#include <vtkUnstructuredGrid.h>
#include <vtkDiskSource.h>
#include <vtkPlaneSource.h>
#include <vtkAlgorithmOutput.h>
#include <vtkImageMapper.h>
-#if defined __GNUC__ && defined __DEPRECATED_DISABLED__
-#define __DEPRECATED
-#undef __DEPRECATED_DISABLED__
-#endif
-
#include <opencv2/core.hpp>
#include <opencv2/viz.hpp>
#include <opencv2/viz/widget_accessor.hpp>
#include "precomp.hpp"
+vtkRenderWindowInteractor* vtkRenderWindowInteractorFixNew();
+
#if 1 || !defined __APPLE__
vtkRenderWindowInteractor* vtkRenderWindowInteractorFixNew()
{
/////////////////////////////////////////////////////////////////////////////////////////////
cv::viz::Viz3d::VizImpl::VizImpl(const String &name)
- : style_(vtkSmartPointer<cv::viz::InteractorStyle>::New()) , widget_actor_map_(new WidgetActorMap), s_lastDone_(0.0)
+ : s_lastDone_(0.0), style_(vtkSmartPointer<cv::viz::InteractorStyle>::New()), widget_actor_map_(new WidgetActorMap)
{
renderer_ = vtkSmartPointer<vtkRenderer>::New();
style_->UseTimersOn();
/////////////////////////////////////////////////
- interactor_ = vtkSmartPointer <vtkRenderWindowInteractor>::Take(vtkRenderWindowInteractorFixNew());
+ interactor_ = vtkSmartPointer<vtkRenderWindowInteractor>::Take(vtkRenderWindowInteractorFixNew());
window_->AlphaBitPlanesOff();
window_->PointSmoothingOff();