Commit bf9dd72f authored by baisheng lai's avatar baisheng lai

remove warnings

parent 36636e5f
...@@ -34,11 +34,11 @@ static void help() ...@@ -34,11 +34,11 @@ static void help()
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
float patternWidth, patternHeight; float patternWidth = 0.0f, patternHeight = 0.0f;
int nCamera, nMiniMatches, cameraType; int nCamera = 0, nMiniMatches = 0, cameraType = 0;
const char* outputFilename = "multi-camera-results.xml"; const char* outputFilename = "multi-camera-results.xml";
const char* inputFilename = 0; const char* inputFilename = 0;
int showFeatureExtraction, verbose; int showFeatureExtraction = 0, verbose = 0;
if (argc < 2) if (argc < 2)
{ {
help(); help();
......
...@@ -94,10 +94,9 @@ static bool readStringList( const string& filename, vector<string>& l ) ...@@ -94,10 +94,9 @@ static bool readStringList( const string& filename, vector<string>& l )
return true; return true;
} }
static void saveCameraParams( const string & filename, Size imageSize, Size boardSize, double square_width, static void saveCameraParams( const string & filename, int flags, const Mat& cameraMatrix,
double square_height, int flags, const Mat& cameraMatrix, const Mat& distCoeffs, const double xi, const Mat& distCoeffs, const double xi, const vector<Vec3d>& rvecs, const vector<Vec3d>& tvecs,
const vector<Vec3d>& rvecs, const vector<Vec3d>& tvecs, vector<string> detec_list, const Mat& idx, vector<string> detec_list, const Mat& idx, const double rms, const vector<Mat>& imagePoints)
const double rms, const vector<Mat>& imagePoints)
{ {
FileStorage fs( filename, FileStorage::WRITE ); FileStorage fs( filename, FileStorage::WRITE );
...@@ -172,7 +171,7 @@ int main(int argc, char** argv) ...@@ -172,7 +171,7 @@ int main(int argc, char** argv)
{ {
Size boardSize, imageSize; Size boardSize, imageSize;
int flags = 0; int flags = 0;
double square_width, square_height; double square_width = 0.0, square_height = 0.0;
const char* outputFilename = "out_camera_params.xml"; const char* outputFilename = "out_camera_params.xml";
const char* inputFilename = 0; const char* inputFilename = 0;
vector<Mat> objectPoints; vector<Mat> objectPoints;
...@@ -253,6 +252,6 @@ int main(int argc, char** argv) ...@@ -253,6 +252,6 @@ int main(int argc, char** argv)
TermCriteria criteria(3, 200, 1e-8); TermCriteria criteria(3, 200, 1e-8);
rms = omnidir::calibrate(objectPoints, imagePoints, imageSize, K, xi, D, rvecs, tvecs, flags, criteria, idx); rms = omnidir::calibrate(objectPoints, imagePoints, imageSize, K, xi, D, rvecs, tvecs, flags, criteria, idx);
_xi = xi.at<double>(0); _xi = xi.at<double>(0);
saveCameraParams(outputFilename, imageSize, boardSize, square_width, square_height, flags, K, D, _xi, saveCameraParams(outputFilename, flags, K, D, _xi,
rvecs, tvecs, detec_list, idx, rms, imagePoints); rvecs, tvecs, detec_list, idx, rms, imagePoints);
} }
...@@ -216,7 +216,7 @@ int main(int argc, char** argv) ...@@ -216,7 +216,7 @@ int main(int argc, char** argv)
{ {
Size boardSize, imageSize1, imageSize2; Size boardSize, imageSize1, imageSize2;
int flags = 0; int flags = 0;
double square_width, square_height; double square_width = 0.0, square_height = 0.0;
const char* outputFilename = "out_camera_params_stereo.xml"; const char* outputFilename = "out_camera_params_stereo.xml";
const char* inputFilename1 = 0; const char* inputFilename1 = 0;
const char* inputFilename2 = 0; const char* inputFilename2 = 0;
......
...@@ -92,13 +92,13 @@ static void saveCameraParams(const string& filename, Size imageSize, float patte ...@@ -92,13 +92,13 @@ static void saveCameraParams(const string& filename, Size imageSize, float patte
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
const char* inputFilename; const char* inputFilename = 0;
const char* outputFilename = "out_camera_params.xml"; const char* outputFilename = "out_camera_params.xml";
vector<string> imglist; vector<string> imglist;
vector<Mat> vecImg; vector<Mat> vecImg;
int flags = 0; int flags = 0;
float patternWidth, patternHeight; float patternWidth = 0.0f, patternHeight = 0.0f;
int nMiniMatches; int nMiniMatches = 0;
if(argc < 2) if(argc < 2)
{ {
help(); help();
...@@ -120,7 +120,7 @@ int main(int argc, char** argv) ...@@ -120,7 +120,7 @@ int main(int argc, char** argv)
} }
else if (strcmp(s, "-mm") == 0) else if (strcmp(s, "-mm") == 0)
{ {
if (sscanf(argv[++i], "%d", &nMiniMatches) != 1 || nMiniMatches < 5) if (sscanf(argv[++i], "%d", &nMiniMatches) != 1 || nMiniMatches < 15)
return fprintf( stderr, "Invalid number of minimal matches or number is too small"), -1; return fprintf( stderr, "Invalid number of minimal matches or number is too small"), -1;
} }
else if( strcmp( s, "-fp" ) == 0 ) else if( strcmp( s, "-fp" ) == 0 )
......
...@@ -22,7 +22,7 @@ int main(int argc, char** argv) ...@@ -22,7 +22,7 @@ int main(int argc, char** argv)
{ {
const char* filename = 0; const char* filename = 0;
Mat pattern; Mat pattern;
int width, height; int width = 0, height = 0;
if(argc < 2) if(argc < 2)
{ {
help(); help();
......
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