diff --git a/modules/stitching/src/motion_estimators.cpp b/modules/stitching/src/motion_estimators.cpp index 026bea6fc3..abd43b11fb 100644 --- a/modules/stitching/src/motion_estimators.cpp +++ b/modules/stitching/src/motion_estimators.cpp @@ -41,9 +41,15 @@ //M*/ #include "precomp.hpp" -#include #include "opencv2/calib3d/calib3d_c.h" +#ifdef _MSC_VER + #include + #define isnan(x) _isnan(x) +#else + #include +#endif + using namespace cv; using namespace cv::detail; @@ -253,8 +259,7 @@ bool BundleAdjusterBase::estimate(const std::vector &features, bool ok = true; for (int i = 0; i < cam_params_.rows; ++i) { - if (isnan(cam_params_.at(i,0)) || - isinf(cam_params_.at(i,0))) + if (isnan(cam_params_.at(i,0))) { ok = false; break;