Commit b4c67e8b authored by Vladislav Sovrasov's avatar Vladislav Sovrasov

Fix gcc7 warnings

parent 30669702
......@@ -749,12 +749,12 @@ void MultiCameraCalibration::writeParameters(const std::string& filename)
for (int camIdx = 0; camIdx < _nCamera; ++camIdx)
{
char num[10];
sprintf(num, "%d", camIdx);
std::string cameraMatrix = "camera_matrix_" + std::string(num);
std::string cameraPose = "camera_pose_" + std::string(num);
std::string cameraDistortion = "camera_distortion_" + std::string(num);
std::string cameraXi = "xi_" + std::string(num);
std::stringstream tmpStr;
tmpStr << camIdx;
std::string cameraMatrix = "camera_matrix_" + tmpStr.str();
std::string cameraPose = "camera_pose_" + tmpStr.str();
std::string cameraDistortion = "camera_distortion_" + tmpStr.str();
std::string cameraXi = "xi_" + tmpStr.str();
fs << cameraMatrix << _cameraMatrix[camIdx];
fs << cameraDistortion << _distortCoeffs[camIdx];
......@@ -770,9 +770,9 @@ void MultiCameraCalibration::writeParameters(const std::string& filename)
for (int photoIdx = _nCamera; photoIdx < (int)_vertexList.size(); ++photoIdx)
{
char timestamp[100];
sprintf(timestamp, "%d", _vertexList[photoIdx].timestamp);
std::string photoTimestamp = "pose_timestamp_" + std::string(timestamp);
std::stringstream tmpStr;
tmpStr << _vertexList[photoIdx].timestamp;
std::string photoTimestamp = "pose_timestamp_" + tmpStr.str();
fs << photoTimestamp << _vertexList[photoIdx].pose;
}
......
......@@ -401,6 +401,12 @@ class CV_EXPORTS BinaryDescriptor : public Algorithm
unsigned int octaveCount;
//the decriptor of line
std::vector<float> descriptor;
OctaveSingleLine() : startPointX(0), startPointY(0), endPointX(0), endPointY(0),
sPointInOctaveX(0), sPointInOctaveY(0), ePointInOctaveX(0), ePointInOctaveY(0),
direction(0), salience(0), lineLength(0), numOfPixels(0), octaveCount(0),
descriptor(std::vector<float>())
{}
};
struct Pixel
......
......@@ -44,11 +44,11 @@
* The interface contains the main methods for computing the matching between the left and right images *
* *
\******************************************************************************************************************/
#include <stdint.h>
#ifndef _OPENCV_MATCHING_HPP_
#define _OPENCV_MATCHING_HPP_
#ifdef __cplusplus
#include <stdint.h>
#include "opencv2/core.hpp"
namespace cv
{
......@@ -423,7 +423,6 @@ namespace cv
//preprocessing the cost volume in order to get it ready for aggregation
void costGathering(const Mat &hammingDistanceCost, Mat &cost)
{
CV_Assert(hammingDistanceCost.rows == hammingDistanceCost.rows);
CV_Assert(hammingDistanceCost.type() == CV_16S);
CV_Assert(cost.type() == CV_16S);
int maxDisp = maxDisparity;
......@@ -620,5 +619,4 @@ namespace cv
}
}
#endif
#endif
/*End of file*/
......@@ -97,7 +97,7 @@ void CV_BlockMatchingTest::run(int )
ts->set_failed_test_info(cvtest::TS::FAIL_INVALID_TEST_DATA);
return;
}
if(image1.rows != image2.rows || image1.cols != image2.cols || gt.cols != gt.cols || gt.rows != gt.rows)
if(image1.rows != image2.rows || image1.cols != image2.cols || gt.cols != image1.cols || gt.rows != image1.rows)
{
ts->printf(cvtest::TS::LOG, "Wrong input / output dimension \n");
ts->set_failed_test_info(cvtest::TS::FAIL_INVALID_TEST_DATA);
......@@ -181,7 +181,7 @@ void CV_SGBlockMatchingTest::run(int )
ts->set_failed_test_info(cvtest::TS::FAIL_INVALID_TEST_DATA);
return;
}
if(image1.rows != image2.rows || image1.cols != image2.cols || gt.cols != gt.cols || gt.rows != gt.rows)
if(image1.rows != image2.rows || image1.cols != image2.cols || gt.cols != image1.cols || gt.rows != image1.rows)
{
ts->printf(cvtest::TS::LOG, "Wrong input / output dimension \n");
ts->set_failed_test_info(cvtest::TS::FAIL_INVALID_TEST_DATA);
......
......@@ -21,7 +21,6 @@ protected:
{
public:
std::vector<Mat> layers;
Octave();
Octave(std::vector<Mat> layers);
virtual ~Octave();
std::vector<Mat> getLayers();
......@@ -33,10 +32,8 @@ protected:
public:
std::vector<Mat> layers;
DOGOctave();
DOGOctave(std::vector<Mat> layers);
virtual ~DOGOctave();
std::vector<Mat> getLayers();
Mat getLayerAt(int i);
};
......@@ -53,30 +50,21 @@ public:
float sigma0;
int omin;
float step;
Params();
Params(int octavesN, int layersN, float sigma0, int omin);
void clear();
};
Params params;
Pyramid();
Pyramid(const Mat& img, int octavesN, int layersN = 2, float sigma0 = 1, int omin = 0,
bool DOG = false);
Mat getLayer(int octave, int layer);
Mat getDOGLayer(int octave, int layer);
float getSigma(int octave, int layer);
float getSigma(int layer);
virtual ~Pyramid();
Params getParams();
void clear();
bool empty();
};
Pyramid::Pyramid()
{
}
/**
* Pyramid class constructor
* octavesN_: number of octaves
......@@ -234,15 +222,6 @@ Mat Pyramid::getDOGLayer(int octave, int layer)
return DOG_octaves[octave].getLayerAt(layer);
}
/**
* Return sigma value of indicated octave and layer
*/
float Pyramid::getSigma(int octave, int layer)
{
return powf(2.0f, float(octave)) * powf(params.step, float(layer)) * params.sigma0;
}
/**
* Return sigma value of indicated layer
* sigma value of layer is the same at each octave
......@@ -271,19 +250,6 @@ void Pyramid::clear()
params.clear();
}
/**
* Empty Pyramid
* @return
*/
bool Pyramid::empty()
{
return octaves.empty();
}
Pyramid::Params::Params()
{
}
/**
* Params for Pyramid class
*
......@@ -295,14 +261,6 @@ Pyramid::Params::Params(int octavesN_, int layersN_, float sigma0_, int omin_) :
step = powf(2, 1.0f / layersN);
}
/**
* Returns Pyramid's params
*/
Pyramid::Params Pyramid::getParams()
{
return params;
}
/**
* Set to zero all params
*/
......@@ -328,10 +286,6 @@ std::vector<Mat> Pyramid::Octave::getLayers()
return layers;
}
Pyramid::Octave::Octave()
{
}
/**
* Return the Octave's layer at index i
*/
......@@ -345,21 +299,12 @@ Pyramid::Octave::~Octave()
{
}
Pyramid::DOGOctave::DOGOctave()
{
}
Pyramid::DOGOctave::DOGOctave(std::vector<Mat> _layers) : layers(_layers) {}
Pyramid::DOGOctave::~DOGOctave()
{
}
std::vector<Mat> Pyramid::DOGOctave::getLayers()
{
return layers;
}
Mat Pyramid::DOGOctave::getLayerAt(int i)
{
CV_Assert(i < (int) layers.size());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment