From 52a904e17b28b59ab149f3eb57ff030468bcf1ef Mon Sep 17 00:00:00 2001 From: Jose-Luis Blanco-Claraco Date: Sun, 20 Oct 2013 17:28:45 +0200 Subject: [PATCH] Fixed MSVC 2013 build errors and workaround for an internal compiler crash. --- 3rdparty/openexr/IlmImf/ImfAcesFile.cpp | 1 + 3rdparty/openexr/IlmImf/ImfOutputFile.cpp | 1 + 3rdparty/openexr/IlmImf/ImfScanLineInputFile.cpp | 1 + 3rdparty/openexr/IlmImf/ImfTiledMisc.cpp | 1 + 3rdparty/openexr/IlmImf/ImfTiledOutputFile.cpp | 1 + 3rdparty/openexr/Imath/ImathMatrixAlgo.cpp | 1 + modules/features2d/src/features2d_init.cpp | 2 +- modules/features2d/src/orb.cpp | 13 +++++++++---- 8 files changed, 16 insertions(+), 5 deletions(-) diff --git a/3rdparty/openexr/IlmImf/ImfAcesFile.cpp b/3rdparty/openexr/IlmImf/ImfAcesFile.cpp index de4bf83..9418b9d 100644 --- a/3rdparty/openexr/IlmImf/ImfAcesFile.cpp +++ b/3rdparty/openexr/IlmImf/ImfAcesFile.cpp @@ -42,6 +42,7 @@ #include #include #include +#include // for std::max() using namespace std; using namespace Imath; diff --git a/3rdparty/openexr/IlmImf/ImfOutputFile.cpp b/3rdparty/openexr/IlmImf/ImfOutputFile.cpp index 8831ec9..e69b92b 100644 --- a/3rdparty/openexr/IlmImf/ImfOutputFile.cpp +++ b/3rdparty/openexr/IlmImf/ImfOutputFile.cpp @@ -58,6 +58,7 @@ #include #include #include +#include // for std::max() namespace Imf { diff --git a/3rdparty/openexr/IlmImf/ImfScanLineInputFile.cpp b/3rdparty/openexr/IlmImf/ImfScanLineInputFile.cpp index f7a12a3..5d8b522 100644 --- a/3rdparty/openexr/IlmImf/ImfScanLineInputFile.cpp +++ b/3rdparty/openexr/IlmImf/ImfScanLineInputFile.cpp @@ -56,6 +56,7 @@ #include #include #include +#include // for std::max() namespace Imf { diff --git a/3rdparty/openexr/IlmImf/ImfTiledMisc.cpp b/3rdparty/openexr/IlmImf/ImfTiledMisc.cpp index 57f52f1..9588e78 100644 --- a/3rdparty/openexr/IlmImf/ImfTiledMisc.cpp +++ b/3rdparty/openexr/IlmImf/ImfTiledMisc.cpp @@ -43,6 +43,7 @@ #include "Iex.h" #include #include +#include // for std::max() namespace Imf { diff --git a/3rdparty/openexr/IlmImf/ImfTiledOutputFile.cpp b/3rdparty/openexr/IlmImf/ImfTiledOutputFile.cpp index 0882106..0bc3cb3 100644 --- a/3rdparty/openexr/IlmImf/ImfTiledOutputFile.cpp +++ b/3rdparty/openexr/IlmImf/ImfTiledOutputFile.cpp @@ -63,6 +63,7 @@ #include #include #include +#include // for std::max() namespace Imf { diff --git a/3rdparty/openexr/Imath/ImathMatrixAlgo.cpp b/3rdparty/openexr/Imath/ImathMatrixAlgo.cpp index f0d2ed6..7ddc649 100644 --- a/3rdparty/openexr/Imath/ImathMatrixAlgo.cpp +++ b/3rdparty/openexr/Imath/ImathMatrixAlgo.cpp @@ -44,6 +44,7 @@ #include "ImathMatrixAlgo.h" #include +#include // for std::max() #if defined(OPENEXR_DLL) #define EXPORT_CONST __declspec(dllexport) diff --git a/modules/features2d/src/features2d_init.cpp b/modules/features2d/src/features2d_init.cpp index 780a67b..a49ea9f 100644 --- a/modules/features2d/src/features2d_init.cpp +++ b/modules/features2d/src/features2d_init.cpp @@ -176,7 +176,7 @@ CV_INIT_ALGORITHM(DenseFeatureDetector, "Feature2D.Dense", obj.info()->addParam(obj, "varyImgBoundWithScale", obj.varyImgBoundWithScale)); CV_INIT_ALGORITHM(GridAdaptedFeatureDetector, "Feature2D.Grid", - obj.info()->addParam(obj, "detector", obj.detector); + obj.info()->addParam(obj, "detector", obj.detector, false, 0, 0, "Detector algorithm."); obj.info()->addParam(obj, "maxTotalKeypoints", obj.maxTotalKeypoints); obj.info()->addParam(obj, "gridRows", obj.gridRows); obj.info()->addParam(obj, "gridCols", obj.gridCols)); diff --git a/modules/features2d/src/orb.cpp b/modules/features2d/src/orb.cpp index 7ed3ff0..5790faf 100644 --- a/modules/features2d/src/orb.cpp +++ b/modules/features2d/src/orb.cpp @@ -139,9 +139,14 @@ static void computeOrbDescriptor(const KeyPoint& kpt, int step = (int)img.step; #if 1 - #define GET_VALUE(idx) \ - center[cvRound(pattern[idx].x*b + pattern[idx].y*a)*step + \ - cvRound(pattern[idx].x*a - pattern[idx].y*b)] + float x, y; + int ix, iy; +#define GET_VALUE(idx) \ + (x = pattern[idx].x*a - pattern[idx].y*b, \ + y = pattern[idx].x*b + pattern[idx].y*a, \ + ix = cvRound(x), \ + iy = cvRound(y), \ + *(center + iy*step + ix) ) #else float x, y; int ix, iy; @@ -935,7 +940,7 @@ void ORB::operator()( InputArray _image, InputArray _mask, std::vector } } -void ORB::detectImpl( const Mat& image, std::vector& keypoints, const Mat& mask) const +void ORB::detectImpl(const Mat& image, std::vector& keypoints, const Mat& mask) const { (*this)(image, mask, keypoints, noArray(), false); } -- 2.7.4