Skip to content

Commit

Permalink
Merge branch 'opencv:master' into stackblur
Browse files Browse the repository at this point in the history
  • Loading branch information
zihaomu committed Aug 30, 2021
2 parents 38925f6 + 4c05a69 commit 8a44d4c
Show file tree
Hide file tree
Showing 215 changed files with 15,594 additions and 3,837 deletions.
6 changes: 4 additions & 2 deletions 3rdparty/readme.txt
Expand Up @@ -31,7 +31,7 @@ libpng Portable Network Graphics library.
libtiff Tag Image File Format (TIFF) Software
Copyright (c) 1988-1997 Sam Leffler
Copyright (c) 1991-1997 Silicon Graphics, Inc.
See libtiff home page http://www.remotesensing.org/libtiff/
See libtiff home page http://www.libtiff.org/
for details and links to the source code

WITH_TIFF CMake option must be ON to add libtiff & zlib support to imgcodecs.
Expand All @@ -51,7 +51,9 @@ jasper JasPer is a collection of software
Copyright (c) 1999-2000 The University of British Columbia
Copyright (c) 2001-2003 Michael David Adams

The JasPer license can be found in libjasper.
See JasPer official GitHub repository
https://github.com/jasper-software/jasper.git
for details and links to source code
------------------------------------------------------------------------------------
openexr OpenEXR is a high dynamic-range (HDR) image file format developed
by Industrial Light & Magic for use in computer imaging applications.
Expand Down
5 changes: 3 additions & 2 deletions CMakeLists.txt
Expand Up @@ -513,6 +513,7 @@ OCV_OPTION(ENABLE_CONFIG_VERIFICATION "Fail build if actual configuration doesn'
OCV_OPTION(OPENCV_ENABLE_MEMALIGN "Enable posix_memalign or memalign usage" ON)
OCV_OPTION(OPENCV_DISABLE_FILESYSTEM_SUPPORT "Disable filesystem support" OFF)
OCV_OPTION(OPENCV_DISABLE_THREAD_SUPPORT "Build the library without multi-threaded code." OFF)
OCV_OPTION(OPENCV_SEMIHOSTING "Build the library for semihosting target (Arm). See https://developer.arm.com/documentation/100863/latest." OFF)

OCV_OPTION(ENABLE_PYLINT "Add target with Pylint checks" (BUILD_DOCS OR BUILD_EXAMPLES) IF (NOT CMAKE_CROSSCOMPILING AND NOT APPLE_FRAMEWORK) )
OCV_OPTION(ENABLE_FLAKE8 "Add target with Python flake8 checker" (BUILD_DOCS OR BUILD_EXAMPLES) IF (NOT CMAKE_CROSSCOMPILING AND NOT APPLE_FRAMEWORK) )
Expand Down Expand Up @@ -913,7 +914,7 @@ add_subdirectory(include)
ocv_add_modules_compiler_options()

# OpenCV modules
add_subdirectory(modules)
ocv_register_modules()

# Generate targets for documentation
add_subdirectory(doc)
Expand Down Expand Up @@ -1243,7 +1244,7 @@ endif(WIN32)

# ========================== GUI ==========================
status("")
status(" GUI: ")
status(" GUI: " "${OPENCV_HIGHGUI_BUILTIN_BACKEND}")

if(WITH_QT OR HAVE_QT)
if(HAVE_QT5)
Expand Down
2 changes: 2 additions & 0 deletions apps/model-diagnostics/model_diagnostics.cpp
Expand Up @@ -4,6 +4,7 @@
**************************************************/
#include <opencv2/dnn.hpp>
#include <opencv2/core/utils/filesystem.hpp>
#include <opencv2/dnn/utils/debug_utils.hpp>

#include <iostream>

Expand Down Expand Up @@ -57,6 +58,7 @@ int main( int argc, const char** argv )
CV_Assert(!model.empty());

enableModelDiagnostics(true);
skipModelImport(true);
redirectError(diagnosticsErrorCallback, NULL);

Net ocvNet = readNet(model, config, frameworkId);
Expand Down
2 changes: 1 addition & 1 deletion cmake/OpenCVDetectCUDA.cmake
Expand Up @@ -112,7 +112,7 @@ if(CUDA_FOUND)
if(CUDA_GENERATION)
if(NOT ";${_generations};" MATCHES ";${CUDA_GENERATION};")
string(REPLACE ";" ", " _generations "${_generations}")
message(FATAL_ERROR "ERROR: ${_generations} Generations are suppered.")
message(FATAL_ERROR "ERROR: ${_generations} Generations are supported.")
endif()
unset(CUDA_ARCH_BIN CACHE)
unset(CUDA_ARCH_PTX CACHE)
Expand Down
60 changes: 30 additions & 30 deletions cmake/OpenCVDetectVTK.cmake
@@ -1,34 +1,34 @@
# VTK 9.0
if(NOT VTK_FOUND)
find_package(VTK 9 QUIET NAMES vtk COMPONENTS
FiltersExtraction
FiltersSources
FiltersTexture
IOExport
IOGeometry
IOPLY
InteractionStyle
RenderingCore
RenderingLOD
RenderingOpenGL2
NO_MODULE)
endif()

# VTK 6.x components
if(NOT VTK_FOUND)
find_package(VTK QUIET COMPONENTS vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
IF(VTK_FOUND)
IF(VTK_RENDERING_BACKEND) #in vtk 7, the rendering backend is exported as a var.
find_package(VTK QUIET COMPONENTS vtkRendering${VTK_RENDERING_BACKEND} vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport vtkIOGeometry NO_MODULE)
ELSE(VTK_RENDERING_BACKEND)
find_package(VTK QUIET COMPONENTS vtkRenderingOpenGL vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
ENDIF(VTK_RENDERING_BACKEND)
ENDIF(VTK_FOUND)
endif()

# VTK 5.x components
if(NOT VTK_FOUND)
find_package(VTK QUIET COMPONENTS vtkCommon NO_MODULE)
find_package(VTK QUIET NAMES vtk VTK)
if(VTK_FOUND)
if(VTK_VERSION VERSION_EQUAL "9") # VTK 9.0
find_package(VTK 9 QUIET NAMES vtk COMPONENTS
FiltersExtraction
FiltersSources
FiltersTexture
IOExport
IOGeometry
IOPLY
InteractionStyle
RenderingCore
RenderingLOD
RenderingOpenGL2
NO_MODULE)
elseif(VTK_VERSION VERSION_GREATER "5") # VTK 6.x components
find_package(VTK QUIET COMPONENTS vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
IF(VTK_FOUND)
IF(VTK_RENDERING_BACKEND) #in vtk 7, the rendering backend is exported as a var.
find_package(VTK QUIET COMPONENTS vtkRendering${VTK_RENDERING_BACKEND} vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport vtkIOGeometry NO_MODULE)
ELSE(VTK_RENDERING_BACKEND)
find_package(VTK QUIET COMPONENTS vtkRenderingOpenGL vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
ENDIF(VTK_RENDERING_BACKEND)
ENDIF(VTK_FOUND)
elseif(VTK_VERSION VERSION_EQUAL "5") # VTK 5.x components
find_package(VTK QUIET COMPONENTS vtkCommon NO_MODULE)
else()
set(VTK_FOUND FALSE)
endif()
endif()
endif()

if(NOT VTK_FOUND)
Expand Down
39 changes: 35 additions & 4 deletions cmake/OpenCVModule.cmake
Expand Up @@ -254,7 +254,7 @@ function(_glob_locations out_paths out_names)
list(LENGTH paths before)
get_filename_component(path "${path}" ABSOLUTE)
# Either module itself
if(NOT path STREQUAL CMAKE_CURRENT_SOURCE_DIR AND EXISTS "${path}/CMakeLists.txt")
if(NOT path STREQUAL "${OpenCV_SOURCE_DIR}/modules" AND EXISTS "${path}/CMakeLists.txt")
get_filename_component(name "${path}" NAME)
list(APPEND paths "${path}")
list(APPEND names "${name}")
Expand Down Expand Up @@ -296,7 +296,7 @@ macro(_add_modules_1 paths names)
list(GET ${names} ${i} __name)
#message(STATUS "First pass: ${__name} => ${__path}")
include("${__path}/cmake/init.cmake" OPTIONAL)
add_subdirectory("${__path}" "${CMAKE_CURRENT_BINARY_DIR}/.firstpass/${__name}")
add_subdirectory("${__path}" "${OpenCV_BINARY_DIR}/modules/.firstpass/${__name}")
endforeach()
endif()
endmacro()
Expand All @@ -316,7 +316,7 @@ macro(_add_modules_2)
endif()
string(REGEX REPLACE "^opencv_" "" name "${m}")
#message(STATUS "Second pass: ${name} => ${OPENCV_MODULE_${m}_LOCATION}")
add_subdirectory("${OPENCV_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${name}")
add_subdirectory("${OPENCV_MODULE_${m}_LOCATION}" "${OpenCV_BINARY_DIR}/modules/${name}")
endif()
ocv_cmake_hook(POST_MODULES_CREATE_${the_module})
endforeach()
Expand Down Expand Up @@ -369,14 +369,44 @@ macro(ocv_glob_modules main_root)
__ocv_resolve_dependencies()

# create modules
set(OPENCV_INITIAL_PASS OFF PARENT_SCOPE)
set(OPENCV_INITIAL_PASS OFF)
ocv_cmake_hook(PRE_MODULES_CREATE)
_add_modules_2(${OPENCV_MODULES_BUILD})
ocv_cmake_hook(POST_MODULES_CREATE)
endmacro()


# called by root CMakeLists.txt
macro(ocv_register_modules)
if(NOT OPENCV_MODULES_PATH)
set(OPENCV_MODULES_PATH "${OpenCV_SOURCE_DIR}/modules")
endif()

ocv_glob_modules(${OPENCV_MODULES_PATH} ${OPENCV_EXTRA_MODULES_PATH})

# build lists of modules to be documented
set(OPENCV_MODULES_MAIN "")
set(OPENCV_MODULES_EXTRA "")

foreach(mod ${OPENCV_MODULES_BUILD} ${OPENCV_MODULES_DISABLED_USER} ${OPENCV_MODULES_DISABLED_AUTO} ${OPENCV_MODULES_DISABLED_FORCE})
string(REGEX REPLACE "^opencv_" "" mod "${mod}")
if("${OPENCV_MODULE_opencv_${mod}_LOCATION}" STREQUAL "${OpenCV_SOURCE_DIR}/modules/${mod}")
list(APPEND OPENCV_MODULES_MAIN ${mod})
else()
list(APPEND OPENCV_MODULES_EXTRA ${mod})
endif()
endforeach()
ocv_list_sort(OPENCV_MODULES_MAIN)
ocv_list_sort(OPENCV_MODULES_EXTRA)
set(FIXED_ORDER_MODULES core imgproc imgcodecs videoio highgui video calib3d features2d objdetect dnn ml flann photo stitching)
list(REMOVE_ITEM OPENCV_MODULES_MAIN ${FIXED_ORDER_MODULES})
set(OPENCV_MODULES_MAIN ${FIXED_ORDER_MODULES} ${OPENCV_MODULES_MAIN})

set(OPENCV_MODULES_MAIN ${OPENCV_MODULES_MAIN} CACHE INTERNAL "List of main modules" FORCE)
set(OPENCV_MODULES_EXTRA ${OPENCV_MODULES_EXTRA} CACHE INTERNAL "List of extra modules" FORCE)
endmacro()


# disables OpenCV module with missing dependencies
function(__ocv_module_turn_off the_module)
list(REMOVE_ITEM OPENCV_MODULES_DISABLED_AUTO "${the_module}")
Expand Down Expand Up @@ -877,6 +907,7 @@ macro(ocv_create_module)
endmacro()

macro(_ocv_create_module)
add_definitions(-D__OPENCV_BUILD=1)

ocv_compiler_optimization_process_sources(OPENCV_MODULE_${the_module}_SOURCES OPENCV_MODULE_${the_module}_DEPS_EXT ${the_module})
set(__module_headers ${OPENCV_MODULE_${the_module}_HEADERS})
Expand Down
2 changes: 1 addition & 1 deletion cmake/OpenCVUtils.cmake
Expand Up @@ -1481,8 +1481,8 @@ function(ocv_target_link_libraries target)
if(NOT LINK_PENDING STREQUAL "")
__ocv_push_target_link_libraries(${LINK_MODE} ${LINK_PENDING})
set(LINK_PENDING "")
set(LINK_MODE "${dep}")
endif()
set(LINK_MODE "${dep}")
else()
if(BUILD_opencv_world)
if(OPENCV_MODULE_${dep}_IS_PART_OF_WORLD)
Expand Down
3 changes: 3 additions & 0 deletions cmake/vars/EnableModeVars.cmake
Expand Up @@ -16,3 +16,6 @@ endmacro()

variable_watch(OPENCV_DISABLE_THREAD_SUPPORT ocv_change_mode_var)
set(OPENCV_DISABLE_THREAD_SUPPORT "${OPENCV_DISABLE_THREAD_SUPPORT}")

variable_watch(OPENCV_SEMIHOSTING ocv_change_mode_var)
set(OPENCV_SEMIHOSTING "${OPENCV_SEMIHOSTING}")
10 changes: 10 additions & 0 deletions cmake/vars/OPENCV_SEMIHOSTING.cmake
@@ -0,0 +1,10 @@
set(CV_TRACE OFF)

# These third parties libraries are incompatible with the semihosting
# toolchain.
set(WITH_JPEG OFF)
set(WITH_OPENEXR OFF)
set(WITH_TIFF OFF)

# Turn off `libpng` for some linking issues.
set(WITH_PNG OFF)
@@ -1,6 +1,9 @@
Contour Features {#tutorial_js_contour_features}
================

@prev_tutorial{tutorial_js_contours_begin}
@next_tutorial{tutorial_js_contour_properties}

Goal
----

Expand Down
@@ -1,6 +1,9 @@
Contour Properties {#tutorial_js_contour_properties}
==================

@prev_tutorial{tutorial_js_contour_features}
@next_tutorial{tutorial_js_contours_more_functions}

Goal
----

Expand Down
@@ -1,6 +1,8 @@
Contours : Getting Started {#tutorial_js_contours_begin}
==========================

@next_tutorial{tutorial_js_contour_features}

Goal
----

Expand Down
@@ -1,6 +1,8 @@
Contours Hierarchy {#tutorial_js_contours_hierarchy}
==================

@prev_tutorial{tutorial_js_contours_more_functions}

Goal
----

Expand Down
@@ -1,6 +1,9 @@
Contours : More Functions {#tutorial_js_contours_more_functions}
=========================

@prev_tutorial{tutorial_js_contour_properties}
@next_tutorial{tutorial_js_contours_hierarchy}

Goal
----

Expand Down
2 changes: 1 addition & 1 deletion doc/py_tutorials/py_imgproc/py_canny/py_canny.markdown
Expand Up @@ -74,7 +74,7 @@ Canny Edge Detection in OpenCV

OpenCV puts all the above in single function, **cv.Canny()**. We will see how to use it. First
argument is our input image. Second and third arguments are our minVal and maxVal respectively.
Third argument is aperture_size. It is the size of Sobel kernel used for find image gradients. By
Fourth argument is aperture_size. It is the size of Sobel kernel used for find image gradients. By
default it is 3. Last argument is L2gradient which specifies the equation for finding gradient
magnitude. If it is True, it uses the equation mentioned above which is more accurate, otherwise it
uses this function: \f$Edge\_Gradient \; (G) = |G_x| + |G_y|\f$. By default, it is False.
Expand Down
@@ -1,6 +1,9 @@
Contour Features {#tutorial_py_contour_features}
================

@prev_tutorial{tutorial_py_contours_begin}
@next_tutorial{tutorial_py_contour_properties}

Goal
----

Expand Down Expand Up @@ -91,7 +94,7 @@ convexity defects, which are the local maximum deviations of hull from contours.

There is a little bit things to discuss about it its syntax:
@code{.py}
hull = cv.convexHull(points[, hull[, clockwise[, returnPoints]]
hull = cv.convexHull(points[, hull[, clockwise[, returnPoints]]])
@endcode
Arguments details:

Expand Down
@@ -1,6 +1,9 @@
Contour Properties {#tutorial_py_contour_properties}
==================

@prev_tutorial{tutorial_py_contour_features}
@next_tutorial{tutorial_py_contours_more_functions}

Here we will learn to extract some frequently used properties of objects like Solidity, Equivalent
Diameter, Mask image, Mean Intensity etc. More features can be found at [Matlab regionprops
documentation](http://www.mathworks.in/help/images/ref/regionprops.html).
Expand Down
@@ -1,6 +1,8 @@
Contours : Getting Started {#tutorial_py_contours_begin}
==========================

@next_tutorial{tutorial_py_contour_features}

Goal
----

Expand Down
@@ -1,6 +1,8 @@
Contours Hierarchy {#tutorial_py_contours_hierarchy}
==================

@prev_tutorial{tutorial_py_contours_more_functions}

Goal
----

Expand Down
@@ -1,6 +1,10 @@
Contours : More Functions {#tutorial_py_contours_more_functions}
=========================

@prev_tutorial{tutorial_py_contour_properties}
@next_tutorial{tutorial_py_contours_hierarchy}


Goal
----

Expand Down

0 comments on commit 8a44d4c

Please sign in to comment.