source compatibility with master

This commit is contained in:
Anatoly Baksheev 2014-02-15 23:40:09 +04:00
parent 56754e907d
commit 03bd82796d
2 changed files with 17 additions and 4 deletions

View File

@ -291,7 +291,11 @@ void cv::viz::writeTrajectory(InputArray _traj, const String& files_format, int
{ {
if (_traj.kind() == _InputArray::STD_VECTOR_MAT) if (_traj.kind() == _InputArray::STD_VECTOR_MAT)
{ {
#if CV_MAJOR_VERSION < 3
std::vector<Mat>& v = *(std::vector<Mat>*)_traj.obj; std::vector<Mat>& v = *(std::vector<Mat>*)_traj.obj;
#else
std::vector<Mat>& v = *(std::vector<Mat>*)_traj.getObj();
#endif
for(size_t i = 0, index = max(0, start); i < v.size(); ++i, ++index) for(size_t i = 0, index = max(0, start); i < v.size(); ++i, ++index)
{ {
@ -317,6 +321,7 @@ void cv::viz::writeTrajectory(InputArray _traj, const String& files_format, int
if (traj.depth() == CV_64F) if (traj.depth() == CV_64F)
for(size_t i = 0, index = max(0, start); i < traj.total(); ++i, ++index) for(size_t i = 0, index = max(0, start); i < traj.total(); ++i, ++index)
writePose(cv::format(files_format.c_str(), index), traj.at<Affine3d>((int)i), tag); writePose(cv::format(files_format.c_str(), index), traj.at<Affine3d>((int)i), tag);
return;
} }
CV_Assert(!"Unsupported array kind"); CV_Assert(!"Unsupported array kind");

View File

@ -54,12 +54,20 @@
#ifndef __OPENCV_TEST_PRECOMP_HPP__ #ifndef __OPENCV_TEST_PRECOMP_HPP__
#define __OPENCV_TEST_PRECOMP_HPP__ #define __OPENCV_TEST_PRECOMP_HPP__
#include "opencv2/ts/ts.hpp" #include <opencv2/core/version.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/viz/vizcore.hpp> #include <opencv2/viz/vizcore.hpp>
namespace cv
{
Mat imread(const String& filename, int flags = 1);
}
#if CV_MAJOR_VERSION < 3
#include "opencv2/ts/ts.hpp"
#else
#include "opencv2/ts.hpp"
#endif
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <string> #include <string>