diff --git a/modules/flann/include/opencv2/flann/lsh_index.h b/modules/flann/include/opencv2/flann/lsh_index.h index 009a75095a..050a00a462 100644 --- a/modules/flann/include/opencv2/flann/lsh_index.h +++ b/modules/flann/include/opencv2/flann/lsh_index.h @@ -230,7 +230,7 @@ public: private: /** Defines the comparator on score and index */ - typedef std::pair ScoreIndexPair; + typedef std::pair ScoreIndexPair; struct SortScoreIndexPairOnSecond { bool operator()(const ScoreIndexPair& left, const ScoreIndexPair& right) const @@ -271,7 +271,7 @@ private: static std::vector score_index_heap; if (do_k) { - unsigned int worst_score = std::numeric_limits::max(); + DistanceType worst_score = std::numeric_limits::max(); typename std::vector >::const_iterator table = tables_.begin(); typename std::vector >::const_iterator table_end = tables_.end(); for (; table != table_end; ++table) { diff --git a/modules/flann/include/opencv2/flann/lsh_table.h b/modules/flann/include/opencv2/flann/lsh_table.h index 66c2cf79fd..39339b1939 100644 --- a/modules/flann/include/opencv2/flann/lsh_table.h +++ b/modules/flann/include/opencv2/flann/lsh_table.h @@ -38,6 +38,7 @@ //! @cond IGNORED #include +#include #include #include #include @@ -52,7 +53,6 @@ #else #include #endif -#include #include #include "dynamic_bitset.h" @@ -205,7 +205,7 @@ public: void add(Matrix dataset) { #if USE_UNORDERED_MAP - buckets_space_.rehash((buckets_space_.size() + dataset.rows) * 1.2); + buckets_space_.rehash(std::llround((buckets_space_.size() + dataset.rows) * 1.2)); #endif // Add the features to the table for (unsigned int i = 0; i < dataset.rows; ++i) add(i, dataset[i]); diff --git a/modules/objdetect/src/chessboard.cpp b/modules/objdetect/src/chessboard.cpp index fe9341ccd1..22520c6fe7 100644 --- a/modules/objdetect/src/chessboard.cpp +++ b/modules/objdetect/src/chessboard.cpp @@ -332,7 +332,7 @@ inline float calcSubpixel(const float &x_l,const float &x,const float &x_r) const float l1 = float(std::log(x+1e-6)); const float l2 = float(std::log(x_r+1e-6)); float delta = l2-l1-l1+l0; - if(!delta) // this happens if all values are identical + if(delta == 0.0f) // this happens if all values are identical return 0; delta = (l0-l2)/(delta+delta); return delta;