Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Aug 23, 2019
2 parents 576644a + 114674c commit a7b954f
Show file tree
Hide file tree
Showing 23 changed files with 286 additions and 105 deletions.
6 changes: 6 additions & 0 deletions 3rdparty/libjasper/jasper/jas_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
#if !defined(JAS_WIN_MSVC_BUILD)
/* A configure-based build is being used. */

#include <stdio.h>

// uClibc-ng workaround: https://github.com/opencv/opencv/pull/15279
#ifndef L_tmpnam
#define L_tmpnam 20
#endif


/* Extra debugging support */
Expand Down
4 changes: 3 additions & 1 deletion 3rdparty/libpng/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ if(";${CPU_BASELINE_FINAL};" MATCHES "SSE2"
endif()

if(PPC64LE OR PPC64)
if(ENABLE_VSX AND NOT PPC64)
# VSX3 features are backwards compatible
if(";${CPU_BASELINE_FINAL};" MATCHES "VSX.*"
AND NOT PPC64)
list(APPEND lib_srcs powerpc/powerpc_init.c powerpc/filter_vsx_intrinsics.c)
add_definitions(-DPNG_POWERPC_VSX_OPT=2)
else()
Expand Down
19 changes: 13 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ if(POLICY CMP0068)
cmake_policy(SET CMP0068 NEW) # CMake 3.9+: `RPATH` settings on macOS do not affect `install_name`.
endif()

if(POLICY CMP0075)
cmake_policy(SET CMP0075 NEW) # CMake 3.12+: Include file check macros honor `CMAKE_REQUIRED_LIBRARIES`
endif()


#
# Configure OpenCV CMake hooks
Expand Down Expand Up @@ -1502,19 +1506,22 @@ endif()

if(WITH_INF_ENGINE OR INF_ENGINE_TARGET)
if(INF_ENGINE_TARGET)
list(GET INF_ENGINE_TARGET 0 ie_target)
set(__msg "YES (${INF_ENGINE_RELEASE} / ${INF_ENGINE_VERSION})")
get_target_property(_lib ${INF_ENGINE_TARGET} IMPORTED_LOCATION)
get_target_property(_lib_imp_rel ${INF_ENGINE_TARGET} IMPORTED_IMPLIB_RELEASE)
get_target_property(_lib_imp_dbg ${INF_ENGINE_TARGET} IMPORTED_IMPLIB_DEBUG)
get_target_property(_lib_rel ${INF_ENGINE_TARGET} IMPORTED_LOCATION_RELEASE)
get_target_property(_lib_dbg ${INF_ENGINE_TARGET} IMPORTED_LOCATION_DEBUG)
get_target_property(_lib ${ie_target} IMPORTED_LOCATION)
get_target_property(_lib_imp_rel ${ie_target} IMPORTED_IMPLIB_RELEASE)
get_target_property(_lib_imp_dbg ${ie_target} IMPORTED_IMPLIB_DEBUG)
get_target_property(_lib_rel ${ie_target} IMPORTED_LOCATION_RELEASE)
get_target_property(_lib_dbg ${ie_target} IMPORTED_LOCATION_DEBUG)
ocv_build_features_string(_lib
IF _lib THEN "${_lib}"
IF _lib_imp_rel AND _lib_imp_dbg THEN "${_lib_imp_rel} / ${_lib_imp_dbg}"
IF _lib_rel AND _lib_dbg THEN "${_lib_rel} / ${_lib_dbg}"
IF _lib_rel THEN "${_lib_rel}"
IF _lib_dbg THEN "${_lib_dbg}"
ELSE "unknown"
)
get_target_property(_inc ${INF_ENGINE_TARGET} INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(_inc ${ie_target} INTERFACE_INCLUDE_DIRECTORIES)
status(" Inference Engine:" "${__msg}")
status(" libs:" "${_lib}")
status(" includes:" "${_inc}")
Expand Down
19 changes: 19 additions & 0 deletions cmake/OpenCVDetectCXXCompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,25 @@ if(NOT HAVE_CXX11)
endif()
endif()
endif()

if(NOT HAVE_CXX11)
message(FATAL_ERROR "OpenCV 4.x requires C++11")
endif()

if((HAVE_CXX11
AND NOT MSVC
AND NOT (X86 OR X86_64)
AND NOT OPENCV_SKIP_LIBATOMIC_COMPILER_CHECK)
OR OPENCV_FORCE_LIBATOMIC_COMPILER_CHECK
)
ocv_check_compiler_flag(CXX "" HAVE_CXX_ATOMICS_WITHOUT_LIB "${OpenCV_SOURCE_DIR}/cmake/checks/atomic_check.cpp")
if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB)
list(APPEND CMAKE_REQUIRED_LIBRARIES atomic)
ocv_check_compiler_flag(CXX "" HAVE_CXX_ATOMICS_WITH_LIB "${OpenCV_SOURCE_DIR}/cmake/checks/atomic_check.cpp")
if(HAVE_CXX_ATOMICS_WITH_LIB)
list(APPEND OPENCV_LINKER_LIBS atomic)
else()
message(FATAL_ERROR "C++11 compiler must support std::atomic")
endif()
endif()
endif()
2 changes: 1 addition & 1 deletion cmake/OpenCVDetectInferenceEngine.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ endfunction()

find_package(InferenceEngine QUIET)
if(InferenceEngine_FOUND)
set(INF_ENGINE_TARGET IE::inference_engine)
set(INF_ENGINE_TARGET ${InferenceEngine_LIBRARIES})
set(INF_ENGINE_VERSION "${InferenceEngine_VERSION}" CACHE STRING "")
message(STATUS "Detected InferenceEngine: cmake package")
endif()
Expand Down
24 changes: 23 additions & 1 deletion cmake/OpenCVUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -415,12 +415,34 @@ MACRO(ocv_check_compiler_flag LANG FLAG RESULT)
else()
set(__msg "")
endif()
if(CMAKE_REQUIRED_LIBRARIES)
set(__link_libs LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
else()
set(__link_libs)
endif()
set(__cmake_flags "")
if(CMAKE_EXE_LINKER_FLAGS) # CMP0056 do this on new CMake
list(APPEND __cmake_flags "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}")
endif()

# CMP0067 do this on new CMake
if(DEFINED CMAKE_CXX_STANDARD)
list(APPEND __cmake_flags "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}")
endif()
if(DEFINED CMAKE_CXX_STANDARD_REQUIRED)
list(APPEND __cmake_flags "-DCMAKE_CXX_STANDARD_REQUIRED=${CMAKE_CXX_STANDARD_REQUIRED}")
endif()
if(DEFINED CMAKE_CXX_EXTENSIONS)
list(APPEND __cmake_flags "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}")
endif()

MESSAGE(STATUS "Performing Test ${RESULT}${__msg}")
TRY_COMPILE(${RESULT}
"${CMAKE_BINARY_DIR}"
"${_fname}"
CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}" # CMP0056 do this on new CMake
CMAKE_FLAGS ${__cmake_flags}
COMPILE_DEFINITIONS "${FLAG}"
${__link_libs}
OUTPUT_VARIABLE OUTPUT)

if(${RESULT})
Expand Down
12 changes: 12 additions & 0 deletions cmake/checks/atomic_check.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <atomic>

static int test()
{
std::atomic<int> x;
return x;
}

int main()
{
return test();
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ goal):
img1 = cv.imread('messi5.jpg')

e1 = cv.getTickCount()
for i in xrange(5,49,2):
for i in range(5,49,2):
img1 = cv.medianBlur(img1,i)
e2 = cv.getTickCount()
t = (e2 - e1)/cv.getTickFrequency()
Expand Down
4 changes: 2 additions & 2 deletions doc/py_tutorials/py_feature2d/py_matcher/py_matcher.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ best matches. There is also **cv.drawMatchesKnn** which draws all the k best mat
will draw two match-lines for each keypoint. So we have to pass a mask if we want to selectively
draw it.

Let's see one example for each of SURF and ORB (Both use different distance measurements).
Let's see one example for each of SIFT and ORB (Both use different distance measurements).

### Brute-Force Matching with ORB Descriptors

Here, we will see a simple example on how to match features between two images. In this case, I have
a queryImage and a trainImage. We will try to find the queryImage in trainImage using feature
matching. ( The images are /samples/c/box.png and /samples/c/box_in_scene.png)
matching. ( The images are /samples/data/box.png and /samples/data/box_in_scene.png)

We are using ORB descriptors to match features. So let's start with loading images, finding
descriptors etc.
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/stitching/stitcher/stitcher.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Code
----

This tutorial code's is shown lines below. You can also download it from
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/samples/cpp/stitching.cpp).
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/stitching.cpp).

@include samples/cpp/stitching.cpp

Expand Down
Loading

0 comments on commit a7b954f

Please sign in to comment.