diff --git a/3rdparty/libpng/opencv-libpng.path b/3rdparty/libpng/opencv-libpng.patch similarity index 100% rename from 3rdparty/libpng/opencv-libpng.path rename to 3rdparty/libpng/opencv-libpng.patch diff --git a/cmake/OpenCVFindIPP.cmake b/cmake/OpenCVFindIPP.cmake index 9921d2503c..9f74d941fa 100644 --- a/cmake/OpenCVFindIPP.cmake +++ b/cmake/OpenCVFindIPP.cmake @@ -136,17 +136,20 @@ endfunction() # ------------------------------------------------------------------------ # This is auxiliary function called from set_ipp_variables() -# to set IPP_LIBRARIES variable in IPP 7.x style +# to set IPP_LIBRARIES variable in IPP 7.x and 8.x style # ------------------------------------------------------------------------ function(set_ipp_new_libraries _LATEST_VERSION) set(IPP_PREFIX "ipp") if(${_LATEST_VERSION} VERSION_LESS "8.0") - set(IPP_SUFFIX "_l") # static not threaded libs suffix + set(IPP_SUFFIX "_l") # static not threaded libs suffix IPP 7.x else() - set(IPP_SUFFIX "") # static not threaded libs suffix + if(WIN32) + set(IPP_SUFFIX "mt") # static not threaded libs suffix IPP 8.x for Windows + else() + set(IPP_SUFFIX "") # static not threaded libs suffix IPP 8.x for Linux/OS X + endif() endif() - set(IPP_THRD "_t") # static threaded libs suffix set(IPPCORE "core") # core functionality set(IPPSP "s") # signal processing set(IPPIP "i") # image processing @@ -218,7 +221,7 @@ function(set_ipp_variables _LATEST_VERSION) set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/ia32 PARENT_SCOPE) endif() - # set IPP_LIBRARIES variable (7.x lib names) + # set IPP_LIBRARIES variable (7.x or 8.x lib names) set_ipp_new_libraries(${_LATEST_VERSION}) set(IPP_LIBRARIES ${IPP_LIBRARIES} PARENT_SCOPE) message(STATUS "IPP libs: ${IPP_LIBRARIES}") diff --git a/modules/contrib/src/inputoutput.cpp b/modules/contrib/src/inputoutput.cpp index d0e947b33f..310dec7894 100644 --- a/modules/contrib/src/inputoutput.cpp +++ b/modules/contrib/src/inputoutput.cpp @@ -10,7 +10,7 @@ namespace cv { - std::vector Directory::GetListFiles( const String& path, const String & exten, bool addPath ) + std::vector Directory::GetListFiles( const String& path, const String & exten, bool addPath ) { std::vector list; list.clear(); @@ -24,10 +24,9 @@ namespace cv HANDLE hFind; #ifdef HAVE_WINRT - size_t size = mbstowcs(NULL, path_f.c_str(), path_f.size()); - Ptr wpath = new wchar_t[size+1]; - wpath[size] = 0; - mbstowcs(wpath, path_f.c_str(), path_f.size()); + wchar_t wpath[MAX_PATH]; + size_t copied = mbstowcs(wpath, path_f.c_str(), MAX_PATH); + CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1)); hFind = FindFirstFileExW(wpath, FindExInfoStandard, &FindFileData, FindExSearchNameMatch, NULL, 0); #else hFind = FindFirstFileA((LPCSTR)path_f.c_str(), &FindFileData); @@ -46,12 +45,12 @@ namespace cv FindFileData.dwFileAttributes == FILE_ATTRIBUTE_SYSTEM || FindFileData.dwFileAttributes == FILE_ATTRIBUTE_READONLY) { - cv::Ptr fname; + char* fname; #ifdef HAVE_WINRT - size_t asize = wcstombs(NULL, FindFileData.cFileName, 0); - fname = new char[asize+1]; - fname[asize] = 0; - wcstombs(fname, FindFileData.cFileName, asize); + char fname_tmp[MAX_PATH] = {0}; + size_t copied = wcstombs(fname_tmp, FindFileData.cFileName, MAX_PATH); + CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1)); + fname = fname_tmp; #else fname = FindFileData.cFileName; #endif @@ -108,10 +107,10 @@ namespace cv HANDLE hFind; #ifdef HAVE_WINRT - size_t size = mbstowcs(NULL, path_f.c_str(), path_f.size()); - Ptr wpath = new wchar_t[size+1]; - wpath[size] = 0; - mbstowcs(wpath, path_f.c_str(), path_f.size()); + wchar_t wpath [MAX_PATH]; + size_t copied = mbstowcs(wpath, path_f.c_str(), path_f.size()); + CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1)); + hFind = FindFirstFileExW(wpath, FindExInfoStandard, &FindFileData, FindExSearchNameMatch, NULL, 0); #else hFind = FindFirstFileA((LPCSTR)path_f.c_str(), &FindFileData); @@ -134,12 +133,12 @@ namespace cv strcmp(FindFileData.cFileName, "..") != 0) #endif { - cv::Ptr fname; + char* fname; #ifdef HAVE_WINRT - size_t asize = wcstombs(NULL, FindFileData.cFileName, 0); - fname = new char[asize+1]; - fname[asize] = 0; - wcstombs(fname, FindFileData.cFileName, asize); + char fname_tmp[MAX_PATH]; + size_t copied = wcstombs(fname, FindFileData.cFileName, MAX_PATH); + CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1)); + fname = fname_tmp; #else fname = FindFileData.cFileName; #endif diff --git a/modules/core/perf/perf_main.cpp b/modules/core/perf/perf_main.cpp index 79c28a645c..7c899c2446 100644 --- a/modules/core/perf/perf_main.cpp +++ b/modules/core/perf/perf_main.cpp @@ -1,3 +1,8 @@ #include "perf_precomp.hpp" +#ifdef _MSC_VER +# if _MSC_VER >= 1700 +# pragma warning(disable:4447) // Disable warning 'main' signature found without threading model +# endif +#endif CV_PERF_TEST_MAIN(core) diff --git a/modules/core/src/glob.cpp b/modules/core/src/glob.cpp index e39cba0163..208b4e05cf 100644 --- a/modules/core/src/glob.cpp +++ b/modules/core/src/glob.cpp @@ -79,10 +79,9 @@ namespace dir->ent.d_name = 0; #ifdef HAVE_WINRT cv::String full_path = cv::String(path) + "\\*"; - size_t size = mbstowcs(NULL, full_path.c_str(), full_path.size()); - cv::Ptr wfull_path = new wchar_t[size+1]; - wfull_path[size] = 0; - mbstowcs(wfull_path, full_path.c_str(), full_path.size()); + wchar_t wfull_path[MAX_PATH]; + size_t copied = mbstowcs(wfull_path, full_path.c_str(), MAX_PATH); + CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1)); dir->handle = ::FindFirstFileExW(wfull_path, FindExInfoStandard, &dir->data, FindExSearchNameMatch, NULL, 0); #else @@ -106,6 +105,7 @@ namespace return 0; } size_t asize = wcstombs(NULL, dir->data.cFileName, 0); + CV_Assert((asize != 0) && (asize != (size_t)-1)); char* aname = new char[asize+1]; aname[asize] = 0; wcstombs(aname, dir->data.cFileName, asize); @@ -146,10 +146,9 @@ static bool isDir(const cv::String& path, DIR* dir) { WIN32_FILE_ATTRIBUTE_DATA all_attrs; #ifdef HAVE_WINRT - size_t size = mbstowcs(NULL, path.c_str(), path.size()); - cv::Ptr wpath = new wchar_t[size+1]; - wpath[size] = 0; - mbstowcs(wpath, path.c_str(), path.size()); + wchar_t wpath[MAX_PATH]; + size_t copied = mbstowcs(wpath, path.c_str(), MAX_PATH); + CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1)); ::GetFileAttributesExW(wpath, GetFileExInfoStandard, &all_attrs); #else ::GetFileAttributesExA(path.c_str(), GetFileExInfoStandard, &all_attrs); diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp index 543353b641..738e863d76 100644 --- a/modules/core/src/system.cpp +++ b/modules/core/src/system.cpp @@ -42,6 +42,12 @@ #include "precomp.hpp" +#ifdef _MSC_VER +# if _MSC_VER >= 1700 +# pragma warning(disable:4447) // Disable warning 'main' signature found without threading model +# endif +#endif + #if defined WIN32 || defined _WIN32 || defined WINCE #ifndef _WIN32_WINNT // This is needed for the declaration of TryEnterCriticalSection in winbase.h with Visual Studio 2005 (and older?) #define _WIN32_WINNT 0x0400 // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx @@ -423,15 +429,14 @@ String tempfile( const char* suffix ) temp_file = temp_dir + std::wstring(L"\\") + temp_file; DeleteFileW(temp_file.c_str()); - size_t asize = wcstombs(NULL, temp_file.c_str(), 0); - Ptr aname = new char[asize+1]; - aname[asize] = 0; - wcstombs(aname, temp_file.c_str(), asize); + char aname[MAX_PATH]; + size_t copied = wcstombs(aname, temp_file.c_str(), MAX_PATH); + CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1)); fname = std::string(aname); RoUninitialize(); #else - char temp_dir2[MAX_PATH + 1] = { 0 }; - char temp_file[MAX_PATH + 1] = { 0 }; + char temp_dir2[MAX_PATH] = { 0 }; + char temp_file[MAX_PATH] = { 0 }; if (temp_dir == 0 || temp_dir[0] == 0) { diff --git a/modules/core/test/test_main.cpp b/modules/core/test/test_main.cpp index 3294fab2b0..d5400e20fd 100644 --- a/modules/core/test/test_main.cpp +++ b/modules/core/test/test_main.cpp @@ -1,7 +1,10 @@ -#ifdef HAVE_WINRT - #pragma warning(disable:4447) // Disable warning 'main' signature found without threading model +#ifdef _MSC_VER +# if _MSC_VER >= 1700 +# pragma warning(disable:4447) // Disable warning 'main' signature found without threading model +# endif #endif + #include "test_precomp.hpp" CV_TEST_MAIN("cv") diff --git a/modules/gpuarithm/perf/perf_arithm.cpp b/modules/gpuarithm/perf/perf_arithm.cpp index dfeafa0fa4..b18c8a8c0e 100644 --- a/modules/gpuarithm/perf/perf_arithm.cpp +++ b/modules/gpuarithm/perf/perf_arithm.cpp @@ -84,7 +84,7 @@ PERF_TEST_P(Sz_Type_Flags, GEMM, TEST_CYCLE() cv::gpu::gemm(d_src1, d_src2, 1.0, d_src3, 1.0, dst, flags); - GPU_SANITY_CHECK(dst, 1e-6); + GPU_SANITY_CHECK(dst, 1e-6, ERROR_RELATIVE); } else { @@ -234,7 +234,7 @@ PERF_TEST_P(Sz_KernelSz_Ccorr, Convolve, TEST_CYCLE() convolution->convolve(d_image, d_templ, dst, ccorr); - GPU_SANITY_CHECK(dst); + GPU_SANITY_CHECK(dst, 1e-6, ERROR_RELATIVE); } else { diff --git a/modules/gpuarithm/src/element_operations.cpp b/modules/gpuarithm/src/element_operations.cpp index 3ec4f84f66..20473de381 100644 --- a/modules/gpuarithm/src/element_operations.cpp +++ b/modules/gpuarithm/src/element_operations.cpp @@ -1912,7 +1912,7 @@ void cv::gpu::bitwise_not(InputArray _src, OutputArray _dst, InputArray _mask, S } else { - bitMatNot( + bitMatNot( PtrStepSzb(src.rows, bcols, src.data, src.step), PtrStepSzb(src.rows, bcols, dst.data, dst.step), mask, stream); diff --git a/modules/java/generator/gen_java.py b/modules/java/generator/gen_java.py index cf9295533b..ef056a7c86 100755 --- a/modules/java/generator/gen_java.py +++ b/modules/java/generator/gen_java.py @@ -542,7 +542,7 @@ JNIEXPORT jstring JNICALL Java_org_opencv_highgui_VideoCapture_getSupportedPrevi { static const char method_name[] = "highgui::VideoCapture_getSupportedPreviewSizes_10()"; try { - LOGD(%s, method_name); + LOGD("%s", method_name); VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL union {double prop; const char* name;} u; u.prop = me->get(CAP_PROP_ANDROID_PREVIEW_SIZES_STRING); diff --git a/modules/ts/src/precomp.hpp b/modules/ts/src/precomp.hpp index d719472d02..fbb13ec4c8 100644 --- a/modules/ts/src/precomp.hpp +++ b/modules/ts/src/precomp.hpp @@ -1,6 +1,7 @@ #include "opencv2/core/utility.hpp" #include "opencv2/core/private.hpp" #include "opencv2/ts.hpp" +#include "cvconfig.h" #ifdef GTEST_LINKED_AS_SHARED_LIBRARY #error ts module should not have GTEST_LINKED_AS_SHARED_LIBRARY defined diff --git a/modules/ts/src/ts_perf.cpp b/modules/ts/src/ts_perf.cpp index f0fdf268e0..e3ae8735d0 100644 --- a/modules/ts/src/ts_perf.cpp +++ b/modules/ts/src/ts_perf.cpp @@ -740,6 +740,14 @@ void TestBase::RecordRunParameters() { ::testing::Test::RecordProperty("cv_implementation", param_impl); ::testing::Test::RecordProperty("cv_num_threads", param_threads); + +#ifdef HAVE_CUDA + if (param_impl == "cuda") + { + cv::gpu::DeviceInfo info(param_cuda_device); + ::testing::Test::RecordProperty("cv_cuda_gpu", info.name()); + } +#endif } std::string TestBase::getSelectedImpl()