diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake index abaae56b0186fdd5b5853ad9f803c23d06128a3b..8f13fa68f1f6e263248d3d8694fb1ce6b0e5a271 100644 --- a/cmake/OpenCVCompilerOptions.cmake +++ b/cmake/OpenCVCompilerOptions.cmake @@ -17,27 +17,6 @@ set(OPENCV_EXTRA_EXE_LINKER_FLAGS "") set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "") set(OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG "") -if(MSVC) - set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS") - # 64-bit portability warnings, in MSVC80 - if(MSVC80) - set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /Wp64") - endif() - - if(BUILD_WITH_DEBUG_INFO) - set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE} /debug") - endif() - - # Remove unreferenced functions: function level linking - set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /Gy") - if(NOT MSVC_VERSION LESS 1400) - set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /bigobj") - endif() - if(BUILD_WITH_DEBUG_INFO) - set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} /Zi") - endif() -endif() - if(CMAKE_COMPILER_IS_GNUCXX) # High level of warnings. set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -Wall") @@ -138,8 +117,27 @@ if(CMAKE_COMPILER_IS_GNUCXX) endif() if(MSVC) - # 64-bit MSVC compiler uses SSE/SSE2 by default + set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS") + # 64-bit portability warnings, in MSVC80 + if(MSVC80) + set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /Wp64") + endif() + + if(BUILD_WITH_DEBUG_INFO) + set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE} /debug") + endif() + + # Remove unreferenced functions: function level linking + set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /Gy") + if(NOT MSVC_VERSION LESS 1400) + set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /bigobj") + endif() + if(BUILD_WITH_DEBUG_INFO) + set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} /Zi") + endif() + if(NOT MSVC64) + # 64-bit MSVC compiler uses SSE/SSE2 by default if(ENABLE_SSE) set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /arch:SSE") endif() @@ -147,15 +145,23 @@ if(MSVC) set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /arch:SSE2") endif() endif() + if(ENABLE_SSE3) set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /arch:SSE3") endif() if(ENABLE_SSE4_1) set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /arch:SSE4.1") endif() + if(ENABLE_SSE OR ENABLE_SSE2 OR ENABLE_SSE3 OR ENABLE_SSE4_1) set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /Oi") endif() + + if(X86 OR X86_64) + if(CMAKE_SIZEOF_VOID_P EQUAL 4 AND ENABLE_SSE2) + set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /fp:fast")# !! important - be on the same wave with x64 compilers + endif() + endif() endif() # Extra link libs if the user selects building static libs: diff --git a/modules/core/test/test_arithm.cpp b/modules/core/test/test_arithm.cpp index 7faa919e40a4e6f4658924f6677ddc00a014ebb7..bb61405f68ffa8ef12ec07c5f4a405a2a73f51d3 100644 --- a/modules/core/test/test_arithm.cpp +++ b/modules/core/test/test_arithm.cpp @@ -1186,8 +1186,12 @@ struct CountNonZeroOp : public BaseElemWiseOp struct MeanStdDevOp : public BaseElemWiseOp { + Scalar sqmeanRef; + int cn; + MeanStdDevOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA+SUPPORT_MASK+SCALAR_OUTPUT, 1, 1, Scalar::all(0)) { + cn = 0; context = 7; }; void op(const vector& src, Mat& dst, const Mat& mask) @@ -1202,6 +1206,9 @@ struct MeanStdDevOp : public BaseElemWiseOp cvtest::multiply(temp, temp, temp); Scalar mean = cvtest::mean(src[0], mask); Scalar sqmean = cvtest::mean(temp, mask); + + sqmeanRef = sqmean; + cn = temp.channels(); for( int c = 0; c < 4; c++ ) sqmean[c] = std::sqrt(std::max(sqmean[c] - mean[c]*mean[c], 0.)); @@ -1212,7 +1219,11 @@ struct MeanStdDevOp : public BaseElemWiseOp } double getMaxErr(int) { - return 1e-6; + CV_Assert(cn > 0); + double err = sqmeanRef[0]; + for(int i = 1; i < cn; ++i) + err = std::max(err, sqmeanRef[i]); + return 3e-7 * err; } }; diff --git a/modules/nonfree/test/test_features2d.cpp b/modules/nonfree/test/test_features2d.cpp index 54d12d3f65f2bca79181408deb50fbcfe5ff2a9b..d6f5cf6e67faa1284054ea7b64c4ff252dea0135 100644 --- a/modules/nonfree/test/test_features2d.cpp +++ b/modules/nonfree/test/test_features2d.cpp @@ -302,6 +302,8 @@ protected: if( validDescriptors.size != calcDescriptors.size || validDescriptors.type() != calcDescriptors.type() ) { ts->printf(cvtest::TS::LOG, "Valid and computed descriptors matrices must have the same size and type.\n"); + ts->printf(cvtest::TS::LOG, "Valid size is (%d x %d) actual size is (%d x %d).\n", validDescriptors.rows, validDescriptors.cols, calcDescriptors.rows, calcDescriptors.cols); + ts->printf(cvtest::TS::LOG, "Valid type is %d actual type is %d.\n", validDescriptors.type(), calcDescriptors.type()); ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_TEST_DATA ); return; } @@ -997,12 +999,12 @@ TEST( Features2d_DescriptorExtractor_SURF, regression ) test.safe_run(); } -/*TEST( Features2d_DescriptorExtractor_OpponentSIFT, regression ) +TEST( Features2d_DescriptorExtractor_OpponentSIFT, regression ) { CV_DescriptorExtractorTest > test( "descriptor-opponent-sift", 0.18f, DescriptorExtractor::create("OpponentSIFT"), 8.06652f ); test.safe_run(); -}*/ +} TEST( Features2d_DescriptorExtractor_OpponentSURF, regression ) { diff --git a/modules/ts/misc/run.py b/modules/ts/misc/run.py index 2bcc085a209ccd2632b7d1c8debbc56caf65afb3..516b5ebc807c4de310eb8c3f767cabd0f5b2c77f 100644 --- a/modules/ts/misc/run.py +++ b/modules/ts/misc/run.py @@ -397,7 +397,10 @@ class RunInfo(object): def getLogName(self, app, timestamp): app = os.path.basename(app) if app.endswith(".exe"): - app = app[:-4] + if app.endswith("d.exe"): + app = app[:-5] + else: + app = app[:-4] if app.startswith(self.nameprefix): app = app[len(self.nameprefix):] @@ -531,7 +534,10 @@ class RunInfo(object): if fname == name: return t if fname.endswith(".exe") or (self.targetos == "android" and fname.endswith(".apk")): - fname = fname[:-4] + if fname.endswith("d.exe"): + fname = fname[:-5] + else: + fname = fname[:-4] if fname == name: return t if fname.startswith(self.nameprefix): @@ -747,7 +753,7 @@ if __name__ == "__main__": parser.add_option("-a", "--accuracy", dest="accuracy", help="look for accuracy tests instead of performance tests", action="store_true", default=False) parser.add_option("-l", "--longname", dest="useLongNames", action="store_true", help="generate log files with long names", default=False) parser.add_option("", "--android_test_data_path", dest="test_data_path", help="OPENCV_TEST_DATA_PATH for Android run", metavar="PATH", default="/sdcard/opencv_testdata/") - parser.add_option("", "--configuration", dest="configuration", help="force Debug or Release donfiguration", metavar="CFG", default="") + parser.add_option("", "--configuration", dest="configuration", help="force Debug or Release configuration", metavar="CFG", default="") parser.add_option("", "--serial", dest="adb_serial", help="Android: directs command to the USB device or emulator with the given serial number", metavar="serial number", default="") parser.add_option("", "--package", dest="junit_package", help="Android: run jUnit tests for specified package", metavar="package", default="") parser.add_option("", "--help-tests", dest="help", help="Show help for test executable", action="store_true", default=False)