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 May 23, 2019
2 parents 2080e06 + 1810702 commit 166ecae
Show file tree
Hide file tree
Showing 33 changed files with 5,687 additions and 2,433 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BL
OCV_OPTION(WITH_NVCUVID "Include NVidia Video Decoding library support" WITH_CUDA
VISIBLE_IF WITH_CUDA
VERIFY HAVE_NVCUVID)
OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" (NOT CV_DISABLE_OPTIMIZATION)
VISIBLE_IF NOT WINRT AND NOT CMAKE_CROSSCOMPILING
OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" (NOT CV_DISABLE_OPTIMIZATION AND NOT CMAKE_CROSSCOMPILING)
VISIBLE_IF NOT WINRT
VERIFY HAVE_EIGEN)
OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" (NOT ANDROID)
VISIBLE_IF NOT IOS AND NOT WINRT
Expand Down
4 changes: 2 additions & 2 deletions apps/traincascade/haarfeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ void CvHaarEvaluator::generateFeatures()
{
features.push_back( Feature( offset, false,
x, y, dx*3, dy, -1,
x+dx, y, dx , dy, +3 ) );
x+dx, y, dx , dy, +2 ) );
}
// haar_y3
if ( (x+dx <= winSize.width) && (y+dy*3 <= winSize.height) )
{
features.push_back( Feature( offset, false,
x, y, dx, dy*3, -1,
x, y+dy, dx, dy, +3 ) );
x, y+dy, dx, dy, +2 ) );
}
if( mode != CvHaarFeatureParams::BASIC )
{
Expand Down
38 changes: 22 additions & 16 deletions cmake/OpenCVFindLAPACK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,33 @@ macro(ocv_lapack_check)
else()
# adding proxy opencv_lapack.h header
set(CBLAS_H_PROXY_PATH ${CMAKE_BINARY_DIR}/opencv_lapack.h)
if((APPLE OR OPENCV_SKIP_LAPACK_EXTERN_C) AND NOT OPENCV_FORCE_LAPACK_EXTERN_C)
set(_lapack_include_str_extern_C "")
set(_lapack_include_str_extern_C_end "")
else()
set(_lapack_include_str_extern_C "extern \"C\" {\n")
set(_lapack_include_str_extern_C_end "}\n")

set(_lapack_add_extern_c NOT (APPLE OR OPENCV_SKIP_LAPACK_EXTERN_C) OR OPENCV_FORCE_LAPACK_EXTERN_C)

set(_lapack_content "// This file is auto-generated\n")
if(${_lapack_add_extern_c})
list(APPEND _lapack_content "extern \"C\" {")
endif()
set(_lapack_include_str "${_lapack_include_str_extern_C}\#include \"${OPENCV_CBLAS_H_PATH_${_lapack_impl}}\"")
if(NOT "${OPENCV_CBLAS_H_PATH_${_lapack_impl}}" STREQUAL "${OPENCV_LAPACKE_H_PATH_${_lapack_impl}}")
set(_lapack_include_str "${_lapack_include_str}\n#include \"${OPENCV_LAPACKE_H_PATH_${_lapack_impl}}\"")
if(NOT OPENCV_SKIP_LAPACK_MSVC_FIX)
list(APPEND _lapack_content "
#ifdef _MSC_VER
#include <complex.h>
#define lapack_complex_float _Fcomplex
#define lapack_complex_double _Dcomplex
#endif
")
endif()
set(_lapack_include_str "${_lapack_include_str}\n${_lapack_include_str_extern_C_end}")
# update file contents (if required)
set(__content_str "")
if(EXISTS "${CBLAS_H_PROXY_PATH}")
file(READ "${CBLAS_H_PROXY_PATH}" __content_str)
list(APPEND _lapack_content "#include \"${OPENCV_CBLAS_H_PATH_${_lapack_impl}}\"")
if(NOT "${OPENCV_CBLAS_H_PATH_${_lapack_impl}}" STREQUAL "${OPENCV_LAPACKE_H_PATH_${_lapack_impl}}")
list(APPEND _lapack_content "#include \"${OPENCV_LAPACKE_H_PATH_${_lapack_impl}}\"")
endif()
if(NOT " ${__content_str}" STREQUAL " ${_lapack_include_str}")
file(WRITE "${CBLAS_H_PROXY_PATH}" "${_lapack_include_str}")
if(${_lapack_add_extern_c})
list(APPEND _lapack_content "}")
endif()

string(REPLACE ";" "\n" _lapack_content "${_lapack_content}")
ocv_update_file("${CBLAS_H_PROXY_PATH}" "${_lapack_content}")

try_compile(__VALID_LAPACK
"${OpenCV_BINARY_DIR}"
"${OpenCV_SOURCE_DIR}/cmake/checks/lapack_check.cpp"
Expand Down
2 changes: 1 addition & 1 deletion cmake/OpenCVFindLibsGUI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if(WITH_GTK AND NOT HAVE_QT)
if(WITH_OPENGL AND NOT HAVE_GTK3)
ocv_check_modules(GTKGLEXT gtkglext-1.0)
if(HAVE_GTKGLEXT)
ocv_append_build_options(GTKGLEXT GTHREAD)
ocv_append_build_options(HIGHGUI GTKGLEXT)
endif()
endif()
endif()
Expand Down
70 changes: 59 additions & 11 deletions cmake/OpenCVFindLibsPerf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,67 @@ To eliminate this warning remove WITH_CUDA=ON CMake configuration option.
endif(WITH_CUDA)

# --- Eigen ---
if(WITH_EIGEN)
find_path(EIGEN_INCLUDE_PATH "Eigen/Core"
PATHS /usr/local /opt /usr $ENV{EIGEN_ROOT}/include ENV ProgramFiles ENV ProgramW6432
PATH_SUFFIXES include/eigen3 include/eigen2 Eigen/include/eigen3 Eigen/include/eigen2
DOC "The path to Eigen3/Eigen2 headers"
CMAKE_FIND_ROOT_PATH_BOTH)
if(WITH_EIGEN AND NOT HAVE_EIGEN)
find_package(Eigen3 QUIET)

if(EIGEN_INCLUDE_PATH)
ocv_include_directories(${EIGEN_INCLUDE_PATH})
ocv_parse_header("${EIGEN_INCLUDE_PATH}/Eigen/src/Core/util/Macros.h" EIGEN_VERSION_LINES EIGEN_WORLD_VERSION EIGEN_MAJOR_VERSION EIGEN_MINOR_VERSION)
set(HAVE_EIGEN 1)
if(Eigen3_FOUND)
if(TARGET Eigen3::Eigen)
# Use Eigen3 imported target if possible
list(APPEND OPENCV_LINKER_LIBS Eigen3::Eigen)
set(HAVE_EIGEN 1)
else()
if(DEFINED EIGEN3_INCLUDE_DIRS)
set(EIGEN_INCLUDE_PATH ${EIGEN3_INCLUDE_DIRS})
set(HAVE_EIGEN 1)
elseif(DEFINED EIGEN3_INCLUDE_DIR)
set(EIGEN_INCLUDE_PATH ${EIGEN3_INCLUDE_DIR})
set(HAVE_EIGEN 1)
endif()
endif()
if(HAVE_EIGEN)
if(DEFINED EIGEN3_WORLD_VERSION) # CMake module
set(EIGEN_WORLD_VERSION ${EIGEN3_WORLD_VERSION})
set(EIGEN_MAJOR_VERSION ${EIGEN3_MAJOR_VERSION})
set(EIGEN_MINOR_VERSION ${EIGEN3_MINOR_VERSION})
else() # Eigen config file
set(EIGEN_WORLD_VERSION ${EIGEN3_VERSION_MAJOR})
set(EIGEN_MAJOR_VERSION ${EIGEN3_VERSION_MINOR})
set(EIGEN_MINOR_VERSION ${EIGEN3_VERSION_PATCH})
endif()
endif()
endif()

if(NOT HAVE_EIGEN)
if(NOT EIGEN_INCLUDE_PATH OR NOT EXISTS "${EIGEN_INCLUDE_PATH}")
set(__find_paths "")
set(__find_path_extra_options "")
if(NOT CMAKE_CROSSCOMPILING)
list(APPEND __find_paths /opt)
endif()
if(DEFINED ENV{EIGEN_ROOT})
set(__find_paths "$ENV{EIGEN_ROOT}/include")
list(APPEND __find_path_extra_options NO_DEFAULT_PATH)
else()
set(__find_paths ENV ProgramFiles ENV ProgramW6432)
endif()
find_path(EIGEN_INCLUDE_PATH "Eigen/Core"
PATHS ${__find_paths}
PATH_SUFFIXES include/eigen3 include/eigen2 Eigen/include/eigen3 Eigen/include/eigen2
DOC "The path to Eigen3/Eigen2 headers"
${__find_path_extra_options}
)
endif()
if(EIGEN_INCLUDE_PATH AND EXISTS "${EIGEN_INCLUDE_PATH}")
ocv_parse_header("${EIGEN_INCLUDE_PATH}/Eigen/src/Core/util/Macros.h" EIGEN_VERSION_LINES EIGEN_WORLD_VERSION EIGEN_MAJOR_VERSION EIGEN_MINOR_VERSION)
set(HAVE_EIGEN 1)
endif()
endif()
endif(WITH_EIGEN)
endif()
if(HAVE_EIGEN)
if(EIGEN_INCLUDE_PATH AND EXISTS "${EIGEN_INCLUDE_PATH}")
ocv_include_directories(SYSTEM ${EIGEN_INCLUDE_PATH})
endif()
endif()

# --- Clp ---
# Ubuntu: sudo apt-get install coinor-libclp-dev coinor-libcoinutils-dev
Expand Down
16 changes: 15 additions & 1 deletion doc/opencv.bib
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,21 @@ @article{Chaumette06
hal_id = {inria-00350283},
hal_version = {v1},
}

@article{Collins14
year = {2014},
issn = {0920-5691},
journal = {International Journal of Computer Vision},
volume = {109},
number = {3},
doi = {10.1007/s11263-014-0725-5},
title = {Infinitesimal Plane-Based Pose Estimation},
url = {http://dx.doi.org/10.1007/s11263-014-0725-5},
publisher = {Springer US},
keywords = {Plane; Pose; SfM; PnP; Homography},
author = {Collins, Toby and Bartoli, Adrien},
pages = {252-286},
language = {English}
}
@article{Daniilidis98,
author = {Konstantinos Daniilidis},
title = {Hand-Eye Calibration Using Dual Quaternions},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ train_data, and next 250 samples as test_data. So let's prepare them first.
@code{.py}
import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt

img = cv.imread('digits.png')
gray = cv.cvtColor(img,cv.COLOR_BGR2GRAY)
Expand Down Expand Up @@ -89,7 +88,6 @@ alphabets directly.
@code{.py}
import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt

# Load the data, converters convert the letter to a number
data= np.loadtxt('letter-recognition.data', dtype= 'float32', delimiter = ',',
Expand Down
Loading

0 comments on commit 166ecae

Please sign in to comment.