From d2665b655eb4b2ce8ce80041684e4ce6fa926f0c Mon Sep 17 00:00:00 2001 From: edgarriba Date: Wed, 6 Aug 2014 08:41:14 +0200 Subject: [PATCH] Fixed warnings --- .../calib3d/real_time_pose_estimation/src/CsvReader.cpp | 2 +- .../calib3d/real_time_pose_estimation/src/CsvWriter.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvReader.cpp b/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvReader.cpp index d97afdb..6b876ff 100644 --- a/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvReader.cpp +++ b/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvReader.cpp @@ -11,7 +11,7 @@ CsvReader::CsvReader(const std::string &path, const char &separator){ void CsvReader::readPLY(std::vector &list_vertex, std::vector > &list_triangles) { std::string line, tmp_str, n; - int num_vertex, num_triangles; + int num_vertex = 0, num_triangles = 0; int count = 0; bool end_header = false; bool end_vertex = false; diff --git a/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.cpp b/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.cpp index 4671fd0..0178f4d 100644 --- a/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.cpp +++ b/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.cpp @@ -29,7 +29,7 @@ void CsvWriter::writeXYZ(const std::vector &list_points3d) void CsvWriter::writeUVXYZ(const std::vector &list_points3d, const std::vector &list_points2d, const cv::Mat &descriptors) { std::string u, v, x, y, z, descriptor_str; - for(int i = 0; i < list_points3d.size(); ++i) + for(unsigned int i = 0; i < list_points3d.size(); ++i) { u = FloatToString(list_points2d[i].x); v = FloatToString(list_points2d[i].y); @@ -41,8 +41,7 @@ void CsvWriter::writeUVXYZ(const std::vector &list_points3d, const for(int j = 0; j < 32; ++j) { - std::cout << descriptors.at(i,j) << std::endl; - descriptor_str = FloatToString(descriptors.at(i,j)); + descriptor_str = FloatToString((float)descriptors.at(i,j)); _file << _separator << descriptor_str; } _file << std::endl; -- 2.7.4