Skip to content

Commit 9fd5e99

Browse files
committed
Merge pull request #1363 from sovrasov:fix_gcc7_warnings
2 parents 97ea5bf + b4c67e8 commit 9fd5e99

File tree

5 files changed

+21
-72
lines changed

5 files changed

+21
-72
lines changed

modules/ccalib/src/multicalib.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -749,12 +749,12 @@ void MultiCameraCalibration::writeParameters(const std::string& filename)
749749

750750
for (int camIdx = 0; camIdx < _nCamera; ++camIdx)
751751
{
752-
char num[10];
753-
sprintf(num, "%d", camIdx);
754-
std::string cameraMatrix = "camera_matrix_" + std::string(num);
755-
std::string cameraPose = "camera_pose_" + std::string(num);
756-
std::string cameraDistortion = "camera_distortion_" + std::string(num);
757-
std::string cameraXi = "xi_" + std::string(num);
752+
std::stringstream tmpStr;
753+
tmpStr << camIdx;
754+
std::string cameraMatrix = "camera_matrix_" + tmpStr.str();
755+
std::string cameraPose = "camera_pose_" + tmpStr.str();
756+
std::string cameraDistortion = "camera_distortion_" + tmpStr.str();
757+
std::string cameraXi = "xi_" + tmpStr.str();
758758

759759
fs << cameraMatrix << _cameraMatrix[camIdx];
760760
fs << cameraDistortion << _distortCoeffs[camIdx];
@@ -770,11 +770,11 @@ void MultiCameraCalibration::writeParameters(const std::string& filename)
770770

771771
for (int photoIdx = _nCamera; photoIdx < (int)_vertexList.size(); ++photoIdx)
772772
{
773-
char timestamp[100];
774-
sprintf(timestamp, "%d", _vertexList[photoIdx].timestamp);
775-
std::string photoTimestamp = "pose_timestamp_" + std::string(timestamp);
773+
std::stringstream tmpStr;
774+
tmpStr << _vertexList[photoIdx].timestamp;
775+
std::string photoTimestamp = "pose_timestamp_" + tmpStr.str();
776776

777777
fs << photoTimestamp << _vertexList[photoIdx].pose;
778778
}
779779
}
780-
}} // namespace multicalib, cv
780+
}} // namespace multicalib, cv

modules/line_descriptor/include/opencv2/line_descriptor/descriptor.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,12 @@ class CV_EXPORTS BinaryDescriptor : public Algorithm
401401
unsigned int octaveCount;
402402
//the decriptor of line
403403
std::vector<float> descriptor;
404+
405+
OctaveSingleLine() : startPointX(0), startPointY(0), endPointX(0), endPointY(0),
406+
sPointInOctaveX(0), sPointInOctaveY(0), ePointInOctaveX(0), ePointInOctaveY(0),
407+
direction(0), salience(0), lineLength(0), numOfPixels(0), octaveCount(0),
408+
descriptor(std::vector<float>())
409+
{}
404410
};
405411

406412
struct Pixel

modules/stereo/include/opencv2/stereo/matching.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@
4444
* The interface contains the main methods for computing the matching between the left and right images *
4545
* *
4646
\******************************************************************************************************************/
47-
#include <stdint.h>
48-
4947
#ifndef _OPENCV_MATCHING_HPP_
5048
#define _OPENCV_MATCHING_HPP_
51-
#ifdef __cplusplus
49+
50+
#include <stdint.h>
51+
#include "opencv2/core.hpp"
5252

5353
namespace cv
5454
{
@@ -423,7 +423,6 @@ namespace cv
423423
//preprocessing the cost volume in order to get it ready for aggregation
424424
void costGathering(const Mat &hammingDistanceCost, Mat &cost)
425425
{
426-
CV_Assert(hammingDistanceCost.rows == hammingDistanceCost.rows);
427426
CV_Assert(hammingDistanceCost.type() == CV_16S);
428427
CV_Assert(cost.type() == CV_16S);
429428
int maxDisp = maxDisparity;
@@ -620,5 +619,4 @@ namespace cv
620619
}
621620
}
622621
#endif
623-
#endif
624622
/*End of file*/

modules/stereo/test/test_block_matching.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void CV_BlockMatchingTest::run(int )
9797
ts->set_failed_test_info(cvtest::TS::FAIL_INVALID_TEST_DATA);
9898
return;
9999
}
100-
if(image1.rows != image2.rows || image1.cols != image2.cols || gt.cols != gt.cols || gt.rows != gt.rows)
100+
if(image1.rows != image2.rows || image1.cols != image2.cols || gt.cols != image1.cols || gt.rows != image1.rows)
101101
{
102102
ts->printf(cvtest::TS::LOG, "Wrong input / output dimension \n");
103103
ts->set_failed_test_info(cvtest::TS::FAIL_INVALID_TEST_DATA);
@@ -181,7 +181,7 @@ void CV_SGBlockMatchingTest::run(int )
181181
ts->set_failed_test_info(cvtest::TS::FAIL_INVALID_TEST_DATA);
182182
return;
183183
}
184-
if(image1.rows != image2.rows || image1.cols != image2.cols || gt.cols != gt.cols || gt.rows != gt.rows)
184+
if(image1.rows != image2.rows || image1.cols != image2.cols || gt.cols != image1.cols || gt.rows != image1.rows)
185185
{
186186
ts->printf(cvtest::TS::LOG, "Wrong input / output dimension \n");
187187
ts->set_failed_test_info(cvtest::TS::FAIL_INVALID_TEST_DATA);

modules/xfeatures2d/src/harris_lapace_detector.cpp

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class Pyramid
2121
{
2222
public:
2323
std::vector<Mat> layers;
24-
Octave();
2524
Octave(std::vector<Mat> layers);
2625
virtual ~Octave();
2726
std::vector<Mat> getLayers();
@@ -33,10 +32,8 @@ class Pyramid
3332
public:
3433
std::vector<Mat> layers;
3534

36-
DOGOctave();
3735
DOGOctave(std::vector<Mat> layers);
3836
virtual ~DOGOctave();
39-
std::vector<Mat> getLayers();
4037
Mat getLayerAt(int i);
4138
};
4239

@@ -53,30 +50,21 @@ class Pyramid
5350
float sigma0;
5451
int omin;
5552
float step;
56-
Params();
5753
Params(int octavesN, int layersN, float sigma0, int omin);
5854
void clear();
5955
};
6056
Params params;
6157

62-
Pyramid();
6358
Pyramid(const Mat& img, int octavesN, int layersN = 2, float sigma0 = 1, int omin = 0,
6459
bool DOG = false);
6560
Mat getLayer(int octave, int layer);
6661
Mat getDOGLayer(int octave, int layer);
67-
float getSigma(int octave, int layer);
6862
float getSigma(int layer);
6963

7064
virtual ~Pyramid();
71-
Params getParams();
7265
void clear();
73-
bool empty();
7466
};
7567

76-
Pyramid::Pyramid()
77-
{
78-
}
79-
8068
/**
8169
* Pyramid class constructor
8270
* octavesN_: number of octaves
@@ -234,15 +222,6 @@ Mat Pyramid::getDOGLayer(int octave, int layer)
234222
return DOG_octaves[octave].getLayerAt(layer);
235223
}
236224

237-
/**
238-
* Return sigma value of indicated octave and layer
239-
*/
240-
float Pyramid::getSigma(int octave, int layer)
241-
{
242-
243-
return powf(2.0f, float(octave)) * powf(params.step, float(layer)) * params.sigma0;
244-
}
245-
246225
/**
247226
* Return sigma value of indicated layer
248227
* sigma value of layer is the same at each octave
@@ -271,19 +250,6 @@ void Pyramid::clear()
271250
params.clear();
272251
}
273252

274-
/**
275-
* Empty Pyramid
276-
* @return
277-
*/
278-
bool Pyramid::empty()
279-
{
280-
return octaves.empty();
281-
}
282-
283-
Pyramid::Params::Params()
284-
{
285-
}
286-
287253
/**
288254
* Params for Pyramid class
289255
*
@@ -295,14 +261,6 @@ Pyramid::Params::Params(int octavesN_, int layersN_, float sigma0_, int omin_) :
295261
step = powf(2, 1.0f / layersN);
296262
}
297263

298-
/**
299-
* Returns Pyramid's params
300-
*/
301-
Pyramid::Params Pyramid::getParams()
302-
{
303-
return params;
304-
}
305-
306264
/**
307265
* Set to zero all params
308266
*/
@@ -328,10 +286,6 @@ std::vector<Mat> Pyramid::Octave::getLayers()
328286
return layers;
329287
}
330288

331-
Pyramid::Octave::Octave()
332-
{
333-
}
334-
335289
/**
336290
* Return the Octave's layer at index i
337291
*/
@@ -345,21 +299,12 @@ Pyramid::Octave::~Octave()
345299
{
346300
}
347301

348-
Pyramid::DOGOctave::DOGOctave()
349-
{
350-
}
351-
352302
Pyramid::DOGOctave::DOGOctave(std::vector<Mat> _layers) : layers(_layers) {}
353303

354304
Pyramid::DOGOctave::~DOGOctave()
355305
{
356306
}
357307

358-
std::vector<Mat> Pyramid::DOGOctave::getLayers()
359-
{
360-
return layers;
361-
}
362-
363308
Mat Pyramid::DOGOctave::getLayerAt(int i)
364309
{
365310
CV_Assert(i < (int) layers.size());

0 commit comments

Comments
 (0)