Merge pull request #716 from asmorkalov:winrt
This commit is contained in:
commit
795a513ac4
37
3rdparty/tbb/CMakeLists.txt
vendored
37
3rdparty/tbb/CMakeLists.txt
vendored
@ -122,15 +122,32 @@ file(GLOB lib_srcs "${tbb_src_dir}/src/tbb/*.cpp")
|
||||
file(GLOB lib_hdrs "${tbb_src_dir}/src/tbb/*.h")
|
||||
list(APPEND lib_srcs "${tbb_src_dir}/src/rml/client/rml_tbb.cpp")
|
||||
|
||||
add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0 #required
|
||||
-D__TBB_BUILD=1 #required
|
||||
-D__TBB_SURVIVE_THREAD_SWITCH=0 #no cilk support
|
||||
-DUSE_PTHREAD #required for Unix
|
||||
-DTBB_USE_GCC_BUILTINS=1 #required for ARM GCC
|
||||
-DTBB_USE_DEBUG=0 #just to be sure
|
||||
-DTBB_NO_LEGACY=1 #don't need backward compatibility
|
||||
-DDO_ITT_NOTIFY=0 #it seems that we don't need these notifications
|
||||
)
|
||||
if (WIN32)
|
||||
add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0
|
||||
-D__TBB_BUILD=1
|
||||
-D_UNICODE
|
||||
-DUNICODE
|
||||
-DWINAPI_FAMILY=WINAPI_FAMILY_APP
|
||||
-DDO_ITT_NOTIFY=0
|
||||
) # defines were copied from windows.cl.inc
|
||||
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} /APPCONTAINER")
|
||||
else()
|
||||
add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0 #required
|
||||
-D__TBB_BUILD=1 #required
|
||||
-D__TBB_SURVIVE_THREAD_SWITCH=0 #no cilk support
|
||||
-DTBB_USE_DEBUG=0 #just to be sure
|
||||
-DTBB_NO_LEGACY=1 #don't need backward compatibility
|
||||
-DDO_ITT_NOTIFY=0 #it seems that we don't need these notifications
|
||||
)
|
||||
endif()
|
||||
|
||||
if (HAVE_LIBPTHREAD)
|
||||
add_definitions(-DUSE_PTHREAD) #required for Unix
|
||||
endif()
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_definitions(-DTBB_USE_GCC_BUILTINS=1) #required for ARM GCC
|
||||
endif()
|
||||
|
||||
if(ANDROID_COMPILER_IS_CLANG)
|
||||
add_definitions(-D__TBB_GCC_BUILTIN_ATOMICS_PRESENT=1)
|
||||
@ -145,7 +162,7 @@ endif()
|
||||
|
||||
set(TBB_SOURCE_FILES ${lib_srcs} ${lib_hdrs})
|
||||
|
||||
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
|
||||
if (ARM AND NOT WIN32)
|
||||
if (NOT ANDROID)
|
||||
set(TBB_SOURCE_FILES ${TBB_SOURCE_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/arm_linux_stub.cpp")
|
||||
endif()
|
||||
|
@ -118,6 +118,7 @@ OCV_OPTION(WITH_CUFFT "Include NVidia Cuda Fast Fourier Transform (FFT)
|
||||
OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_NVCUVID "Include NVidia Video Decoding library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS AND NOT APPLE) )
|
||||
OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" ON)
|
||||
OCV_OPTION(WITH_VFW "Include Video for Windows support" ON IF (WIN32))
|
||||
OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" ON IF (NOT ANDROID AND NOT IOS))
|
||||
OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
|
||||
@ -132,13 +133,15 @@ OCV_OPTION(WITH_PNG "Include PNG support" ON)
|
||||
OCV_OPTION(WITH_PVAPI "Include Prosilica GigE support" ON IF (NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_GIGEAPI "Include Smartek GigE support" ON IF (NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_QT "Build with Qt Backend support" OFF IF (NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_WIN32UI "Build with Win32 UI Backend support" ON IF (WIN32) )
|
||||
OCV_OPTION(WITH_QUICKTIME "Use QuickTime for Video I/O insted of QTKit" OFF IF APPLE )
|
||||
OCV_OPTION(WITH_TBB "Include Intel TBB support" OFF IF (NOT IOS) )
|
||||
OCV_OPTION(WITH_CSTRIPES "Include C= support" OFF IF WIN32 )
|
||||
OCV_OPTION(WITH_TIFF "Include TIFF support" ON IF (NOT IOS) )
|
||||
OCV_OPTION(WITH_UNICAP "Include Unicap support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON IF (UNIX AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_VIDEOINPUT "Build HighGUI with DirectShow support" ON IF WIN32 )
|
||||
OCV_OPTION(WITH_DSHOW "Build HighGUI with DirectShow support" ON IF (WIN32 AND NOT ARM) )
|
||||
OCV_OPTION(WITH_MSMF "Build HighGUI with Media Foundation support" OFF IF WIN32 )
|
||||
OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF (NOT ANDROID AND NOT APPLE) )
|
||||
OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_OPENCL "Include OpenCL Runtime support" ON IF (NOT ANDROID AND NOT IOS) )
|
||||
@ -169,7 +172,7 @@ OCV_OPTION(BUILD_JASPER "Build libjasper from source" WIN32 O
|
||||
OCV_OPTION(BUILD_JPEG "Build libjpeg from source" WIN32 OR ANDROID OR APPLE )
|
||||
OCV_OPTION(BUILD_PNG "Build libpng from source" WIN32 OR ANDROID OR APPLE )
|
||||
OCV_OPTION(BUILD_OPENEXR "Build openexr from source" WIN32 OR ANDROID OR APPLE )
|
||||
OCV_OPTION(BUILD_TBB "Download and build TBB from source" ANDROID IF CMAKE_COMPILER_IS_GNUCXX )
|
||||
OCV_OPTION(BUILD_TBB "Download and build TBB from source" ANDROID )
|
||||
|
||||
# OpenCV installation options
|
||||
# ===================================================
|
||||
@ -598,8 +601,8 @@ else()
|
||||
if(DEFINED WITH_QT)
|
||||
status(" QT 4.x:" NO)
|
||||
endif()
|
||||
if(WIN32)
|
||||
status(" Win32 UI:" YES)
|
||||
if(DEFINED WITH_WIN32UI)
|
||||
status(" Win32 UI:" HAVE_WIN32UI THEN YES ELSE NO)
|
||||
else()
|
||||
if(APPLE)
|
||||
if(WITH_CARBON)
|
||||
@ -656,6 +659,10 @@ endif()
|
||||
status("")
|
||||
status(" Video I/O:")
|
||||
|
||||
if (DEFINED WITH_VFW)
|
||||
status(" Video for Windows:" HAVE_VFW THEN YES ELSE NO)
|
||||
endif(DEFINED WITH_VFW)
|
||||
|
||||
if(DEFINED WITH_1394)
|
||||
status(" DC1394 1.x:" HAVE_DC1394 THEN "YES (ver ${ALIASOF_libdc1394_VERSION})" ELSE NO)
|
||||
status(" DC1394 2.x:" HAVE_DC1394_2 THEN "YES (ver ${ALIASOF_libdc1394-2_VERSION})" ELSE NO)
|
||||
@ -738,9 +745,13 @@ if(DEFINED WITH_V4L)
|
||||
ELSE "${HAVE_CAMV4L_STR}/${HAVE_CAMV4L2_STR}")
|
||||
endif(DEFINED WITH_V4L)
|
||||
|
||||
if(DEFINED WITH_VIDEOINPUT)
|
||||
status(" DirectShow:" HAVE_VIDEOINPUT THEN YES ELSE NO)
|
||||
endif(DEFINED WITH_VIDEOINPUT)
|
||||
if(DEFINED WITH_DSHOW)
|
||||
status(" DirectShow:" HAVE_DSHOW THEN YES ELSE NO)
|
||||
endif(DEFINED WITH_DSHOW)
|
||||
|
||||
if(DEFINED WITH_MSMF)
|
||||
status(" Media Foundation:" HAVE_MSMF THEN YES ELSE NO)
|
||||
endif(DEFINED WITH_MSMF)
|
||||
|
||||
if(DEFINED WITH_XIMEA)
|
||||
status(" XIMEA:" HAVE_XIMEA THEN YES ELSE NO)
|
||||
|
@ -57,7 +57,7 @@ if(CUDA_FOUND)
|
||||
elseif(CUDA_GENERATION STREQUAL "Kepler")
|
||||
set(__cuda_arch_bin "3.0")
|
||||
elseif(CUDA_GENERATION STREQUAL "Auto")
|
||||
execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" "${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectCudaArch.cu" "--run"
|
||||
execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" "${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu" "--run"
|
||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
|
||||
RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE _nvcc_out
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
@ -103,4 +103,6 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*" OR CMAKE_GENERATOR
|
||||
set(X86_64 1)
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*|amd64.*|AMD64.*")
|
||||
set(X86 1)
|
||||
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "arm.*|ARM.*")
|
||||
set(ARM 1)
|
||||
endif()
|
||||
|
@ -2,6 +2,16 @@
|
||||
# Detect 3rd-party GUI libraries
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
#--- Win32 UI ---
|
||||
ocv_clear_vars(HAVE_WIN32UI)
|
||||
if(WITH_WIN32UI)
|
||||
TRY_COMPILE(HAVE_WIN32UI
|
||||
"${OPENCV_BINARY_DIR}/CMakeFiles/CMakeTmp"
|
||||
"${OpenCV_SOURCE_DIR}/cmake/checks/win32uitest.cpp"
|
||||
CMAKE_FLAGS "\"user32.lib\" \"gdi32.lib\""
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
endif(WITH_WIN32UI)
|
||||
|
||||
# --- QT4 ---
|
||||
ocv_clear_vars(HAVE_QT)
|
||||
if(WITH_QT)
|
||||
|
@ -2,6 +2,15 @@
|
||||
# Detect 3rd-party video IO libraries
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
ocv_clear_vars(HAVE_VFW)
|
||||
if (WITH_VFW)
|
||||
TRY_COMPILE(HAVE_VFW
|
||||
"${OPENCV_BINARY_DIR}/CMakeFiles/CMakeTmp"
|
||||
"${OpenCV_SOURCE_DIR}/cmake/checks/vfwtest.cpp"
|
||||
CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=vfw32"
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
endif(WITH_VFW)
|
||||
|
||||
# --- GStreamer ---
|
||||
ocv_clear_vars(HAVE_GSTREAMER)
|
||||
if(WITH_GSTREAMER)
|
||||
@ -37,7 +46,7 @@ if(WITH_PVAPI)
|
||||
set(PVAPI_SDK_SUBDIR x86)
|
||||
elseif(X86_64)
|
||||
set(PVAPI_SDK_SUBDIR x64)
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES arm)
|
||||
elseif(ARM)
|
||||
set(PVAPI_SDK_SUBDIR arm)
|
||||
endif()
|
||||
|
||||
@ -111,7 +120,7 @@ endif(WITH_XIMEA)
|
||||
# --- FFMPEG ---
|
||||
ocv_clear_vars(HAVE_FFMPEG HAVE_FFMPEG_CODEC HAVE_FFMPEG_FORMAT HAVE_FFMPEG_UTIL HAVE_FFMPEG_SWSCALE HAVE_GENTOO_FFMPEG HAVE_FFMPEG_FFMPEG)
|
||||
if(WITH_FFMPEG)
|
||||
if(WIN32)
|
||||
if(WIN32 AND NOT ARM)
|
||||
include("${OpenCV_SOURCE_DIR}/3rdparty/ffmpeg/ffmpeg_version.cmake")
|
||||
elseif(UNIX)
|
||||
CHECK_MODULE(libavcodec HAVE_FFMPEG_CODEC)
|
||||
@ -175,11 +184,16 @@ if(WITH_FFMPEG)
|
||||
endif(APPLE)
|
||||
endif(WITH_FFMPEG)
|
||||
|
||||
# --- VideoInput ---
|
||||
if(WITH_VIDEOINPUT)
|
||||
# --- VideoInput/DirectShow ---
|
||||
if(WITH_DSHOW)
|
||||
# always have VideoInput on Windows
|
||||
set(HAVE_VIDEOINPUT 1)
|
||||
endif(WITH_VIDEOINPUT)
|
||||
set(HAVE_DSHOW 1)
|
||||
endif(WITH_DSHOW)
|
||||
|
||||
# --- VideoInput/Microsoft Media Foundation ---
|
||||
if(WITH_MSMF)
|
||||
check_include_file(Mfapi.h HAVE_MSMF)
|
||||
endif(WITH_MSMF)
|
||||
|
||||
# --- Extra HighGUI libs on Windows ---
|
||||
if(WIN32)
|
||||
|
@ -12,6 +12,7 @@ endmacro()
|
||||
ocv_legacy_option(BUILD_NEW_PYTHON_SUPPORT BUILD_opencv_python)
|
||||
ocv_legacy_option(BUILD_JAVA_SUPPORT BUILD_opencv_java)
|
||||
ocv_legacy_option(WITH_ANDROID_CAMERA BUILD_opencv_androidcamera)
|
||||
ocv_legacy_option(WITH_VIDEOINPUT WITH_DSHOW)
|
||||
|
||||
if(DEFINED OPENCV_BUILD_3RDPARTY_LIBS)
|
||||
set(BUILD_ZLIB ${OPENCV_BUILD_3RDPARTY_LIBS} CACHE BOOL "Set via depricated OPENCV_BUILD_3RDPARTY_LIBS" FORCE)
|
||||
|
10
cmake/checks/vfwtest.cpp
Normal file
10
cmake/checks/vfwtest.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
#include <windows.h>
|
||||
#include <vfw.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
AVIFileInit();
|
||||
AVIFileExit();
|
||||
return 0;
|
||||
}
|
11
cmake/checks/win32uitest.cpp
Normal file
11
cmake/checks/win32uitest.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
#include <windows.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
CreateWindow(NULL /*lpClassName*/, NULL /*lpWindowName*/, 0 /*dwStyle*/, 0 /*x*/,
|
||||
0 /*y*/, 0 /*nWidth*/, 0 /*nHeight*/, NULL /*hWndParent*/, NULL /*hMenu*/,
|
||||
NULL /*hInstance*/, NULL /*lpParam*/);
|
||||
DeleteDC(NULL);
|
||||
|
||||
return 0;
|
||||
}
|
@ -13,6 +13,9 @@
|
||||
*/
|
||||
#cmakedefine HAVE_ALLOCA_H 1
|
||||
|
||||
/* Video for Windows support */
|
||||
#cmakedefine HAVE_VFW
|
||||
|
||||
/* V4L capturing support */
|
||||
#cmakedefine HAVE_CAMV4L
|
||||
|
||||
@ -55,6 +58,9 @@
|
||||
/* GTK+ 2.0 Thread support */
|
||||
#cmakedefine HAVE_GTHREAD
|
||||
|
||||
/* Win32 UI */
|
||||
#cmakedefine HAVE_WIN32UI
|
||||
|
||||
/* GTK+ 2.x toolkit */
|
||||
#cmakedefine HAVE_GTK
|
||||
|
||||
@ -208,8 +214,11 @@
|
||||
/* AMD's Basic Linear Algebra Subprograms Library*/
|
||||
#cmakedefine HAVE_CLAMDBLAS
|
||||
|
||||
/* VideoInput library */
|
||||
#cmakedefine HAVE_VIDEOINPUT
|
||||
/* DirectShow Video Capture library */
|
||||
#cmakedefine HAVE_DSHOW
|
||||
|
||||
/* Microsoft Media Foundation Capture library */
|
||||
#cmakedefine HAVE_MSMF
|
||||
|
||||
/* XIMEA camera support */
|
||||
#cmakedefine HAVE_XIMEA
|
||||
|
@ -322,8 +322,12 @@ CV_INLINE int cvRound( double value )
|
||||
return (int)lrint(value);
|
||||
# endif
|
||||
#else
|
||||
// while this is not IEEE754-compliant rounding, it's usually a good enough approximation
|
||||
return (int)(value + (value >= 0 ? 0.5 : -0.5));
|
||||
double intpart, fractpart;
|
||||
fractpart = modf(value, &intpart);
|
||||
if ((abs(fractpart) != 0.5) || ((((int)intpart) % 2) != 0))
|
||||
return (int)(value + (value >= 0 ? 0.5 : -0.5));
|
||||
else
|
||||
return (int)intpart;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -999,25 +999,22 @@ static int normHamming(const uchar* a, int n)
|
||||
{
|
||||
int i = 0, result = 0;
|
||||
#if CV_NEON
|
||||
if (CPU_HAS_NEON_FEATURE)
|
||||
{
|
||||
uint32x4_t bits = vmovq_n_u32(0);
|
||||
for (; i <= n - 16; i += 16) {
|
||||
uint8x16_t A_vec = vld1q_u8 (a + i);
|
||||
uint8x16_t bitsSet = vcntq_u8 (A_vec);
|
||||
uint16x8_t bitSet8 = vpaddlq_u8 (bitsSet);
|
||||
uint32x4_t bitSet4 = vpaddlq_u16 (bitSet8);
|
||||
bits = vaddq_u32(bits, bitSet4);
|
||||
}
|
||||
uint64x2_t bitSet2 = vpaddlq_u32 (bits);
|
||||
result = vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),0);
|
||||
result += vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),2);
|
||||
uint32x4_t bits = vmovq_n_u32(0);
|
||||
for (; i <= n - 16; i += 16) {
|
||||
uint8x16_t A_vec = vld1q_u8 (a + i);
|
||||
uint8x16_t bitsSet = vcntq_u8 (A_vec);
|
||||
uint16x8_t bitSet8 = vpaddlq_u8 (bitsSet);
|
||||
uint32x4_t bitSet4 = vpaddlq_u16 (bitSet8);
|
||||
bits = vaddq_u32(bits, bitSet4);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
for( ; i <= n - 4; i += 4 )
|
||||
uint64x2_t bitSet2 = vpaddlq_u32 (bits);
|
||||
result = vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),0);
|
||||
result += vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),2);
|
||||
#else
|
||||
for( ; i <= n - 4; i += 4 )
|
||||
result += popCountTable[a[i]] + popCountTable[a[i+1]] +
|
||||
popCountTable[a[i+2]] + popCountTable[a[i+3]];
|
||||
#endif
|
||||
for( ; i < n; i++ )
|
||||
result += popCountTable[a[i]];
|
||||
return result;
|
||||
@ -1027,27 +1024,24 @@ int normHamming(const uchar* a, const uchar* b, int n)
|
||||
{
|
||||
int i = 0, result = 0;
|
||||
#if CV_NEON
|
||||
if (CPU_HAS_NEON_FEATURE)
|
||||
{
|
||||
uint32x4_t bits = vmovq_n_u32(0);
|
||||
for (; i <= n - 16; i += 16) {
|
||||
uint8x16_t A_vec = vld1q_u8 (a + i);
|
||||
uint8x16_t B_vec = vld1q_u8 (b + i);
|
||||
uint8x16_t AxorB = veorq_u8 (A_vec, B_vec);
|
||||
uint8x16_t bitsSet = vcntq_u8 (AxorB);
|
||||
uint16x8_t bitSet8 = vpaddlq_u8 (bitsSet);
|
||||
uint32x4_t bitSet4 = vpaddlq_u16 (bitSet8);
|
||||
bits = vaddq_u32(bits, bitSet4);
|
||||
}
|
||||
uint64x2_t bitSet2 = vpaddlq_u32 (bits);
|
||||
result = vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),0);
|
||||
result += vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),2);
|
||||
uint32x4_t bits = vmovq_n_u32(0);
|
||||
for (; i <= n - 16; i += 16) {
|
||||
uint8x16_t A_vec = vld1q_u8 (a + i);
|
||||
uint8x16_t B_vec = vld1q_u8 (b + i);
|
||||
uint8x16_t AxorB = veorq_u8 (A_vec, B_vec);
|
||||
uint8x16_t bitsSet = vcntq_u8 (AxorB);
|
||||
uint16x8_t bitSet8 = vpaddlq_u8 (bitsSet);
|
||||
uint32x4_t bitSet4 = vpaddlq_u16 (bitSet8);
|
||||
bits = vaddq_u32(bits, bitSet4);
|
||||
}
|
||||
else
|
||||
uint64x2_t bitSet2 = vpaddlq_u32 (bits);
|
||||
result = vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),0);
|
||||
result += vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),2);
|
||||
#else
|
||||
for( ; i <= n - 4; i += 4 )
|
||||
result += popCountTable[a[i] ^ b[i]] + popCountTable[a[i+1] ^ b[i+1]] +
|
||||
popCountTable[a[i+2] ^ b[i+2]] + popCountTable[a[i+3] ^ b[i+3]];
|
||||
#endif
|
||||
for( ; i <= n - 4; i += 4 )
|
||||
result += popCountTable[a[i] ^ b[i]] + popCountTable[a[i+1] ^ b[i+1]] +
|
||||
popCountTable[a[i+2] ^ b[i+2]] + popCountTable[a[i+3] ^ b[i+3]];
|
||||
for( ; i < n; i++ )
|
||||
result += popCountTable[a[i] ^ b[i]];
|
||||
return result;
|
||||
|
@ -1551,3 +1551,16 @@ TEST(Core_Add, AddToColumnWhen4Rows)
|
||||
|
||||
ASSERT_EQ(0, countNonZero(m1 - m2));
|
||||
}
|
||||
|
||||
TEST(Core_round, CvRound)
|
||||
{
|
||||
ASSERT_EQ(2, cvRound(2.0));
|
||||
ASSERT_EQ(2, cvRound(2.1));
|
||||
ASSERT_EQ(-2, cvRound(-2.1));
|
||||
ASSERT_EQ(3, cvRound(2.8));
|
||||
ASSERT_EQ(-3, cvRound(-2.8));
|
||||
ASSERT_EQ(2, cvRound(2.5));
|
||||
ASSERT_EQ(4, cvRound(3.5));
|
||||
ASSERT_EQ(-2, cvRound(-2.5));
|
||||
ASSERT_EQ(-4, cvRound(-3.5));
|
||||
}
|
@ -456,7 +456,6 @@ struct Hamming
|
||||
ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const
|
||||
{
|
||||
ResultType result = 0;
|
||||
#ifdef __GNUC__
|
||||
#ifdef __ARM_NEON__
|
||||
{
|
||||
uint32x4_t bits = vmovq_n_u32(0);
|
||||
@ -473,7 +472,7 @@ struct Hamming
|
||||
result = vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),0);
|
||||
result += vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),2);
|
||||
}
|
||||
#else
|
||||
#elif __GNUC__
|
||||
{
|
||||
//for portability just use unsigned long -- and use the __builtin_popcountll (see docs for __builtin_popcountll)
|
||||
typedef unsigned long long pop_t;
|
||||
@ -493,8 +492,8 @@ struct Hamming
|
||||
result += __builtin_popcountll(a_final ^ b_final);
|
||||
}
|
||||
}
|
||||
#endif //NEON
|
||||
#else
|
||||
#else // NO NEON and NOT GNUC
|
||||
typedef unsigned long long pop_t;
|
||||
HammingLUT lut;
|
||||
result = lut(reinterpret_cast<const unsigned char*> (a),
|
||||
reinterpret_cast<const unsigned char*> (b), size * sizeof(pop_t));
|
||||
|
@ -89,7 +89,7 @@ if(HAVE_QT)
|
||||
if(${_have_flag})
|
||||
set_source_files_properties(${_RCC_OUTFILES} PROPERTIES COMPILE_FLAGS -Wno-missing-declarations)
|
||||
endif()
|
||||
elseif(WIN32)
|
||||
elseif(HAVE_WIN32UI)
|
||||
list(APPEND highgui_srcs src/window_w32.cpp)
|
||||
elseif(HAVE_GTK)
|
||||
list(APPEND highgui_srcs src/window_gtk.cpp)
|
||||
@ -105,9 +105,21 @@ elseif(APPLE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND highgui_srcs src/cap_vfw.cpp src/cap_cmu.cpp src/cap_dshow.cpp)
|
||||
endif(WIN32)
|
||||
if(WIN32 AND NOT ARM)
|
||||
list(APPEND highgui_srcs src/cap_cmu.cpp)
|
||||
endif()
|
||||
|
||||
if (WIN32 AND HAVE_DSHOW)
|
||||
list(APPEND highgui_srcs src/cap_dshow.cpp)
|
||||
endif()
|
||||
|
||||
if (WIN32 AND HAVE_MSMF)
|
||||
list(APPEND highgui_srcs src/cap_msmf.cpp)
|
||||
endif()
|
||||
|
||||
if (WIN32 AND HAVE_VFW)
|
||||
list(APPEND highgui_srcs src/cap_vfw.cpp)
|
||||
endif()
|
||||
|
||||
if(HAVE_XINE)
|
||||
list(APPEND highgui_srcs src/cap_xine.cpp)
|
||||
|
@ -297,6 +297,7 @@ enum
|
||||
CV_CAP_UNICAP =600, // Unicap drivers
|
||||
|
||||
CV_CAP_DSHOW =700, // DirectShow (via videoInput)
|
||||
CV_CAP_MSMF =1400, // Microsoft Media Foundation (via videoInput)
|
||||
|
||||
CV_CAP_PVAPI =800, // PvAPI, Prosilica GigE SDK
|
||||
|
||||
|
@ -20,9 +20,9 @@
|
||||
defined(HAVE_GSTREAMER) || \
|
||||
defined(HAVE_QUICKTIME) || \
|
||||
defined(HAVE_AVFOUNDATION) || \
|
||||
/*defined(HAVE_OPENNI) || too specialized */ \
|
||||
defined(HAVE_FFMPEG) || \
|
||||
defined(WIN32) /* assume that we have ffmpeg */
|
||||
defined(HAVE_VFW)
|
||||
/*defined(HAVE_OPENNI) too specialized */ \
|
||||
|
||||
# define BUILD_WITH_VIDEO_INPUT_SUPPORT 1
|
||||
#else
|
||||
@ -34,7 +34,7 @@
|
||||
defined(HAVE_QUICKTIME) || \
|
||||
defined(HAVE_AVFOUNDATION) || \
|
||||
defined(HAVE_FFMPEG) || \
|
||||
defined(WIN32) /* assume that we have ffmpeg */
|
||||
defined(HAVE_VFW)
|
||||
# define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 1
|
||||
#else
|
||||
# define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 0
|
||||
|
@ -114,7 +114,7 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
|
||||
{
|
||||
int domains[] =
|
||||
{
|
||||
#ifdef HAVE_VIDEOINPUT
|
||||
#ifdef HAVE_DSHOW
|
||||
CV_CAP_DSHOW,
|
||||
#endif
|
||||
#if 1
|
||||
@ -168,7 +168,8 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
|
||||
// try every possibly installed camera API
|
||||
for (int i = 0; domains[i] >= 0; i++)
|
||||
{
|
||||
#if defined(HAVE_VIDEOINPUT) || \
|
||||
#if defined(HAVE_DSHOW) || \
|
||||
defined(HAVE_MSMF) || \
|
||||
defined(HAVE_TYZX) || \
|
||||
defined(HAVE_VFW) || \
|
||||
defined(HAVE_LIBV4L) || \
|
||||
@ -195,11 +196,18 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
|
||||
|
||||
switch (domains[i])
|
||||
{
|
||||
#ifdef HAVE_VIDEOINPUT
|
||||
#ifdef HAVE_MSMF
|
||||
case CV_CAP_MSMF:
|
||||
capture = cvCreateCameraCapture_MSMF (index);
|
||||
if (capture)
|
||||
return capture;
|
||||
break;
|
||||
#endif
|
||||
#ifdef HAVE_DSHOW
|
||||
case CV_CAP_DSHOW:
|
||||
capture = cvCreateCameraCapture_DShow (index);
|
||||
if (capture)
|
||||
return capture;
|
||||
capture = cvCreateCameraCapture_DShow (index);
|
||||
if (capture)
|
||||
return capture;
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
||||
|
||||
#include "precomp.hpp"
|
||||
|
||||
#if (defined WIN32 || defined _WIN32) && defined HAVE_VIDEOINPUT
|
||||
#if (defined WIN32 || defined _WIN32) && defined HAVE_DSHOW
|
||||
|
||||
/*
|
||||
DirectShow-based Video Capturing module is based on
|
||||
@ -3100,6 +3100,7 @@ HRESULT videoInput::routeCrossbar(ICaptureGraphBuilder2 **ppBuild, IBaseFilter *
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
/********************* Capturing video from camera via DirectShow *********************/
|
||||
|
||||
class CvCaptureCAM_DShow : public CvCapture
|
||||
|
@ -209,7 +209,7 @@ CvCapture* cvCreateFileCapture_FFMPEG_proxy(const char * filename)
|
||||
if( result->open( filename ))
|
||||
return result;
|
||||
delete result;
|
||||
#if defined WIN32 || defined _WIN32
|
||||
#ifdef HAVE_VFW
|
||||
return cvCreateFileCapture_VFW(filename);
|
||||
#else
|
||||
return 0;
|
||||
@ -263,9 +263,9 @@ CvVideoWriter* cvCreateVideoWriter_FFMPEG_proxy( const char* filename, int fourc
|
||||
if( result->open( filename, fourcc, fps, frameSize, isColor != 0 ))
|
||||
return result;
|
||||
delete result;
|
||||
#if defined WIN32 || defined _WIN32
|
||||
return cvCreateVideoWriter_VFW(filename, fourcc, fps, frameSize, isColor);
|
||||
#else
|
||||
#ifdef HAVE_VFW
|
||||
return cvCreateVideoWriter_VFW(filename, fourcc, fps, frameSize, isColor);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
2810
modules/highgui/src/cap_msmf.cpp
Normal file
2810
modules/highgui/src/cap_msmf.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@ -103,14 +103,6 @@ struct CvVideoWriter
|
||||
virtual bool writeFrame(const IplImage*) { return false; }
|
||||
};
|
||||
|
||||
#if defined WIN32 || defined _WIN32
|
||||
#define HAVE_VFW 1
|
||||
|
||||
/* uncomment to enable CMUCamera1394 fireware camera module */
|
||||
//#define HAVE_CMU1394 1
|
||||
#endif
|
||||
|
||||
|
||||
CvCapture * cvCreateCameraCapture_V4L( int index );
|
||||
CvCapture * cvCreateCameraCapture_DC1394( int index );
|
||||
CvCapture * cvCreateCameraCapture_DC1394_2( int index );
|
||||
@ -126,6 +118,7 @@ CvVideoWriter* cvCreateVideoWriter_Win32( const char* filename, int fourcc,
|
||||
CvVideoWriter* cvCreateVideoWriter_VFW( const char* filename, int fourcc,
|
||||
double fps, CvSize frameSize, int is_color );
|
||||
CvCapture* cvCreateCameraCapture_DShow( int index );
|
||||
CvCapture* cvCreateCameraCapture_MSMF( int index );
|
||||
CvCapture* cvCreateCameraCapture_OpenNI( int index );
|
||||
CvCapture* cvCreateFileCapture_OpenNI( const char* filename );
|
||||
CvCapture* cvCreateCameraCapture_Android( int index );
|
||||
|
@ -57,7 +57,7 @@ CV_IMPL void cvSetWindowProperty(const char* name, int prop_id, double prop_valu
|
||||
|
||||
#if defined (HAVE_QT)
|
||||
cvSetModeWindow_QT(name,prop_value);
|
||||
#elif defined WIN32 || defined _WIN32
|
||||
#elif defined(HAVE_WIN32UI)
|
||||
cvSetModeWindow_W32(name,prop_value);
|
||||
#elif defined (HAVE_GTK)
|
||||
cvSetModeWindow_GTK(name,prop_value);
|
||||
@ -96,7 +96,7 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
|
||||
|
||||
#if defined (HAVE_QT)
|
||||
return cvGetModeWindow_QT(name);
|
||||
#elif defined WIN32 || defined _WIN32
|
||||
#elif defined(HAVE_WIN32UI)
|
||||
return cvGetModeWindow_W32(name);
|
||||
#elif defined (HAVE_GTK)
|
||||
return cvGetModeWindow_GTK(name);
|
||||
@ -113,7 +113,7 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
|
||||
|
||||
#if defined (HAVE_QT)
|
||||
return cvGetPropWindow_QT(name);
|
||||
#elif defined WIN32 || defined _WIN32
|
||||
#elif defined(HAVE_WIN32UI)
|
||||
return cvGetPropWindowAutoSize_W32(name);
|
||||
#elif defined (HAVE_GTK)
|
||||
return cvGetPropWindowAutoSize_GTK(name);
|
||||
@ -126,7 +126,7 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
|
||||
|
||||
#if defined (HAVE_QT)
|
||||
return cvGetRatioWindow_QT(name);
|
||||
#elif defined WIN32 || defined _WIN32
|
||||
#elif defined(HAVE_WIN32UI)
|
||||
return cvGetRatioWindow_W32(name);
|
||||
#elif defined (HAVE_GTK)
|
||||
return cvGetRatioWindow_GTK(name);
|
||||
@ -139,7 +139,7 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
|
||||
|
||||
#if defined (HAVE_QT)
|
||||
return cvGetOpenGlProp_QT(name);
|
||||
#elif defined WIN32 || defined _WIN32
|
||||
#elif defined(HAVE_WIN32UI)
|
||||
return cvGetOpenGlProp_W32(name);
|
||||
#elif defined (HAVE_GTK)
|
||||
return cvGetOpenGlProp_GTK(name);
|
||||
@ -450,11 +450,11 @@ int cv::createButton(const string&, ButtonCallback, void*, int , bool )
|
||||
|
||||
#endif
|
||||
|
||||
#if defined WIN32 || defined _WIN32 // see window_w32.cpp
|
||||
#if defined(HAVE_WIN32UI) // see window_w32.cpp
|
||||
#elif defined (HAVE_GTK) // see window_gtk.cpp
|
||||
#elif defined (HAVE_COCOA) // see window_carbon.cpp
|
||||
#elif defined (HAVE_COCOA) // see window_carbon.cpp
|
||||
#elif defined (HAVE_CARBON)
|
||||
#elif defined (HAVE_QT) //YV see window_QT.cpp
|
||||
#elif defined (HAVE_QT) //YV see window_QT.cpp
|
||||
|
||||
#else
|
||||
|
||||
|
@ -176,7 +176,7 @@ TEST(Highgui_Video, ffmpeg_image) { CV_FFmpegReadImageTest test; test.safe_run()
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_FFMPEG) || defined(WIN32) || defined(_WIN32)
|
||||
#if defined(HAVE_FFMPEG)
|
||||
|
||||
//////////////////////////////// Parallel VideoWriters and VideoCaptures ////////////////////////////////////
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
#include "test_precomp.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
|
||||
#if defined HAVE_GTK || defined HAVE_QT || defined WIN32 || defined _WIN32 || defined HAVE_CARBON || defined HAVE_COCOA
|
||||
#if defined HAVE_GTK || defined HAVE_QT || defined HAVE_WIN32UI || defined HAVE_CARBON || defined HAVE_COCOA
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
#include <iostream>
|
||||
|
||||
#if defined(HAVE_VIDEOINPUT) || \
|
||||
#if defined(HAVE_DSHOW) || \
|
||||
defined(HAVE_TYZX) || \
|
||||
defined(HAVE_VFW) || \
|
||||
defined(HAVE_LIBV4L) || \
|
||||
@ -34,7 +34,7 @@
|
||||
defined(HAVE_OPENNI) || \
|
||||
defined(HAVE_XIMEA) || \
|
||||
defined(HAVE_AVFOUNDATION) || \
|
||||
defined(HAVE_GIGE_API) || \
|
||||
defined(HAVE_GIGE_API) || \
|
||||
(0)
|
||||
//defined(HAVE_ANDROID_NATIVE_CAMERA) || - enable after #1193
|
||||
# define BUILD_WITH_CAMERA_SUPPORT 1
|
||||
@ -47,9 +47,7 @@
|
||||
defined(HAVE_QUICKTIME) || \
|
||||
defined(HAVE_AVFOUNDATION) || \
|
||||
/*defined(HAVE_OPENNI) || too specialized */ \
|
||||
defined(HAVE_FFMPEG) || \
|
||||
defined(WIN32) /* assume that we have ffmpeg */
|
||||
|
||||
defined(HAVE_FFMPEG)
|
||||
# define BUILD_WITH_VIDEO_INPUT_SUPPORT 1
|
||||
#else
|
||||
# define BUILD_WITH_VIDEO_INPUT_SUPPORT 0
|
||||
@ -59,8 +57,7 @@
|
||||
defined(HAVE_GSTREAMER) || \
|
||||
defined(HAVE_QUICKTIME) || \
|
||||
defined(HAVE_AVFOUNDATION) || \
|
||||
defined(HAVE_FFMPEG) || \
|
||||
defined(WIN32) /* assume that we have ffmpeg */
|
||||
defined(HAVE_FFMPEG)
|
||||
# define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 1
|
||||
#else
|
||||
# define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 0
|
||||
|
@ -460,7 +460,7 @@ struct SphericalPortraitProjector : ProjectorBase
|
||||
|
||||
// Projects image onto unit sphere with origin at (0, 0, 0).
|
||||
// Poles are located NOT at (0, -1, 0) and (0, 1, 0) points, BUT at (1, 0, 0) and (-1, 0, 0) points.
|
||||
class SphericalPortraitWarper : public RotationWarperBase<SphericalPortraitProjector>
|
||||
class CV_EXPORTS SphericalPortraitWarper : public RotationWarperBase<SphericalPortraitProjector>
|
||||
{
|
||||
public:
|
||||
SphericalPortraitWarper(float scale) { projector_.scale = scale; }
|
||||
@ -476,7 +476,7 @@ struct CylindricalPortraitProjector : ProjectorBase
|
||||
};
|
||||
|
||||
|
||||
class CylindricalPortraitWarper : public RotationWarperBase<CylindricalPortraitProjector>
|
||||
class CV_EXPORTS CylindricalPortraitWarper : public RotationWarperBase<CylindricalPortraitProjector>
|
||||
{
|
||||
public:
|
||||
CylindricalPortraitWarper(float scale) { projector_.scale = scale; }
|
||||
@ -495,7 +495,7 @@ struct PlanePortraitProjector : ProjectorBase
|
||||
};
|
||||
|
||||
|
||||
class PlanePortraitWarper : public RotationWarperBase<PlanePortraitProjector>
|
||||
class CV_EXPORTS PlanePortraitWarper : public RotationWarperBase<PlanePortraitProjector>
|
||||
{
|
||||
public:
|
||||
PlanePortraitWarper(float scale) { projector_.scale = scale; }
|
||||
|
6
platforms/winrt/arm.winrt.toolchain.cmake
Normal file
6
platforms/winrt/arm.winrt.toolchain.cmake
Normal file
@ -0,0 +1,6 @@
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
set(CMAKE_SYSTEM_PROCESSOR "arm-v7a")
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH "${CMAKE_SOURCE_DIR}/platforms/winrt")
|
||||
set(CMAKE_REQUIRED_DEFINITIONS -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE)
|
||||
add_definitions(-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE)
|
6
platforms/winrt/scripts/cmake_winrt.cmd
Normal file
6
platforms/winrt/scripts/cmake_winrt.cmd
Normal file
@ -0,0 +1,6 @@
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
rem call "C:\Program Files\Microsoft Visual Studio 11.0\VC\bin\x86_arm\vcvarsx86_arm.bat"
|
||||
|
||||
cmake.exe -GNinja -DCMAKE_BUILD_TYPE=Release -DWITH_FFMPEG=OFF -DBUILD_opencv_gpu=OFF -DBUILD_opencv_python=OFF -DCMAKE_TOOLCHAIN_FILE=..\..\winrt\arm.winrt.toolchain.cmake ..\..\..
|
Loading…
x
Reference in New Issue
Block a user