mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 05:29:54 +08:00
fixed -Wshadow and other warnings, added rvec test
This commit is contained in:
parent
f62ffa2aea
commit
4c66b87698
@ -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<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);
|
||||
}
|
||||
}
|
||||
|
@ -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); }
|
||||
|
@ -54,14 +54,6 @@
|
||||
#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>
|
||||
@ -70,7 +62,6 @@
|
||||
#include <vtkSmartPointer.h>
|
||||
#include <vtkDataSet.h>
|
||||
#include <vtkPolygon.h>
|
||||
//#include <vtkPointPicker.h>
|
||||
#include <vtkUnstructuredGrid.h>
|
||||
#include <vtkDiskSource.h>
|
||||
#include <vtkPlaneSource.h>
|
||||
@ -120,11 +111,6 @@
|
||||
#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>
|
||||
|
@ -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<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();
|
||||
|
||||
@ -77,7 +79,7 @@ cv::viz::Viz3d::VizImpl::VizImpl(const String &name)
|
||||
style_->UseTimersOn();
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
interactor_ = vtkSmartPointer <vtkRenderWindowInteractor>::Take(vtkRenderWindowInteractorFixNew());
|
||||
interactor_ = vtkSmartPointer<vtkRenderWindowInteractor>::Take(vtkRenderWindowInteractorFixNew());
|
||||
|
||||
window_->AlphaBitPlanesOff();
|
||||
window_->PointSmoothingOff();
|
||||
|
Loading…
Reference in New Issue
Block a user