Merge commit '43aec5ad^' into merge-2.4

Conflicts:
	modules/contrib/src/inputoutput.cpp
	modules/gpu/perf/perf_imgproc.cpp
	modules/gpuarithm/perf/perf_element_operations.cpp
	modules/gpuarithm/src/element_operations.cpp
	modules/ts/src/precomp.hpp
pull/1348/head
Roman Donchenko 11 years ago
commit 4d06c4c7b6
  1. 0
      3rdparty/libpng/opencv-libpng.patch
  2. 13
      cmake/OpenCVFindIPP.cmake
  3. 37
      modules/contrib/src/inputoutput.cpp
  4. 5
      modules/core/perf/perf_main.cpp
  5. 15
      modules/core/src/glob.cpp
  6. 17
      modules/core/src/system.cpp
  7. 7
      modules/core/test/test_main.cpp
  8. 4
      modules/gpuarithm/perf/perf_arithm.cpp
  9. 2
      modules/gpuarithm/src/element_operations.cpp
  10. 2
      modules/java/generator/gen_java.py
  11. 1
      modules/ts/src/precomp.hpp
  12. 8
      modules/ts/src/ts_perf.cpp

@ -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}")

@ -10,7 +10,7 @@
namespace cv
{
std::vector<String> Directory::GetListFiles( const String& path, const String & exten, bool addPath )
std::vector<String> Directory::GetListFiles( const String& path, const String & exten, bool addPath )
{
std::vector<String> 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<wchar_t> 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<char> 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<wchar_t> 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<char> 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

@ -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)

@ -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<wchar_t> 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<wchar_t> 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);

@ -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<char> 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)
{

@ -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")

@ -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
{

@ -1912,7 +1912,7 @@ void cv::gpu::bitwise_not(InputArray _src, OutputArray _dst, InputArray _mask, S
}
else
{
bitMatNot<unsigned short>(
bitMatNot<unsigned char>(
PtrStepSzb(src.rows, bcols, src.data, src.step),
PtrStepSzb(src.rows, bcols, dst.data, dst.step),
mask, stream);

@ -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);

@ -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

@ -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()

Loading…
Cancel
Save