Skip to content

Commit bf9dd72

Browse files
committed
remove warnings
1 parent 36636e5 commit bf9dd72

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed

modules/ccalib/samples/multi_cameras_calibration.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ static void help()
3434

3535
int main(int argc, char** argv)
3636
{
37-
float patternWidth, patternHeight;
38-
int nCamera, nMiniMatches, cameraType;
37+
float patternWidth = 0.0f, patternHeight = 0.0f;
38+
int nCamera = 0, nMiniMatches = 0, cameraType = 0;
3939
const char* outputFilename = "multi-camera-results.xml";
4040
const char* inputFilename = 0;
41-
int showFeatureExtraction, verbose;
41+
int showFeatureExtraction = 0, verbose = 0;
4242
if (argc < 2)
4343
{
4444
help();

modules/ccalib/samples/omni_calibration.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,9 @@ static bool readStringList( const string& filename, vector<string>& l )
9494
return true;
9595
}
9696

97-
static void saveCameraParams( const string & filename, Size imageSize, Size boardSize, double square_width,
98-
double square_height, int flags, const Mat& cameraMatrix, const Mat& distCoeffs, const double xi,
99-
const vector<Vec3d>& rvecs, const vector<Vec3d>& tvecs, vector<string> detec_list, const Mat& idx,
100-
const double rms, const vector<Mat>& imagePoints)
97+
static void saveCameraParams( const string & filename, int flags, const Mat& cameraMatrix,
98+
const Mat& distCoeffs, const double xi, const vector<Vec3d>& rvecs, const vector<Vec3d>& tvecs,
99+
vector<string> detec_list, const Mat& idx, const double rms, const vector<Mat>& imagePoints)
101100
{
102101
FileStorage fs( filename, FileStorage::WRITE );
103102

@@ -172,7 +171,7 @@ int main(int argc, char** argv)
172171
{
173172
Size boardSize, imageSize;
174173
int flags = 0;
175-
double square_width, square_height;
174+
double square_width = 0.0, square_height = 0.0;
176175
const char* outputFilename = "out_camera_params.xml";
177176
const char* inputFilename = 0;
178177
vector<Mat> objectPoints;
@@ -253,6 +252,6 @@ int main(int argc, char** argv)
253252
TermCriteria criteria(3, 200, 1e-8);
254253
rms = omnidir::calibrate(objectPoints, imagePoints, imageSize, K, xi, D, rvecs, tvecs, flags, criteria, idx);
255254
_xi = xi.at<double>(0);
256-
saveCameraParams(outputFilename, imageSize, boardSize, square_width, square_height, flags, K, D, _xi,
255+
saveCameraParams(outputFilename, flags, K, D, _xi,
257256
rvecs, tvecs, detec_list, idx, rms, imagePoints);
258257
}

modules/ccalib/samples/omni_stereo_calibration.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ int main(int argc, char** argv)
216216
{
217217
Size boardSize, imageSize1, imageSize2;
218218
int flags = 0;
219-
double square_width, square_height;
219+
double square_width = 0.0, square_height = 0.0;
220220
const char* outputFilename = "out_camera_params_stereo.xml";
221221
const char* inputFilename1 = 0;
222222
const char* inputFilename2 = 0;

modules/ccalib/samples/random_pattern_calibration.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ static void saveCameraParams(const string& filename, Size imageSize, float patte
9292

9393
int main(int argc, char** argv)
9494
{
95-
const char* inputFilename;
95+
const char* inputFilename = 0;
9696
const char* outputFilename = "out_camera_params.xml";
9797
vector<string> imglist;
9898
vector<Mat> vecImg;
9999
int flags = 0;
100-
float patternWidth, patternHeight;
101-
int nMiniMatches;
100+
float patternWidth = 0.0f, patternHeight = 0.0f;
101+
int nMiniMatches = 0;
102102
if(argc < 2)
103103
{
104104
help();
@@ -120,7 +120,7 @@ int main(int argc, char** argv)
120120
}
121121
else if (strcmp(s, "-mm") == 0)
122122
{
123-
if (sscanf(argv[++i], "%d", &nMiniMatches) != 1 || nMiniMatches < 5)
123+
if (sscanf(argv[++i], "%d", &nMiniMatches) != 1 || nMiniMatches < 15)
124124
return fprintf( stderr, "Invalid number of minimal matches or number is too small"), -1;
125125
}
126126
else if( strcmp( s, "-fp" ) == 0 )

modules/ccalib/samples/random_pattern_generator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ int main(int argc, char** argv)
2222
{
2323
const char* filename = 0;
2424
Mat pattern;
25-
int width, height;
25+
int width = 0, height = 0;
2626
if(argc < 2)
2727
{
2828
help();

0 commit comments

Comments
 (0)