commit
dc1eb583b4
78
.gitattributes
vendored
78
.gitattributes
vendored
@ -1,42 +1,58 @@
|
|||||||
.git* export-ignore
|
|
||||||
|
|
||||||
* text=auto whitespace=trailing-space,space-before-tab,-indent-with-non-tab,tab-in-indent,tabwidth=4
|
* text=auto whitespace=trailing-space,space-before-tab,-indent-with-non-tab,tab-in-indent,tabwidth=4
|
||||||
|
|
||||||
*.py text
|
.git* text export-ignore
|
||||||
*.cpp text
|
|
||||||
*.hpp text
|
|
||||||
*.cxx text
|
|
||||||
*.hxx text
|
|
||||||
*.mm text
|
|
||||||
*.c text
|
|
||||||
*.h text
|
|
||||||
*.i text
|
|
||||||
*.js text
|
|
||||||
*.java text
|
|
||||||
*.scala text
|
|
||||||
*.cu text
|
|
||||||
*.cl text
|
|
||||||
*.css_t text
|
|
||||||
*.qrc text
|
|
||||||
*.qss text
|
|
||||||
*.S text
|
|
||||||
*.rst text
|
|
||||||
*.tex text
|
|
||||||
*.sty text
|
|
||||||
|
|
||||||
*.aidl text
|
*.aidl text
|
||||||
*.mk text
|
*.appxmanifest text
|
||||||
|
*.bib text
|
||||||
|
*.c text
|
||||||
|
*.cl text
|
||||||
|
*.conf text
|
||||||
|
*.cpp text
|
||||||
|
*.css_t text
|
||||||
|
*.cu text
|
||||||
|
*.cxx text
|
||||||
|
*.def text
|
||||||
|
*.filelist text
|
||||||
|
*.h text
|
||||||
|
*.hpp text
|
||||||
|
*.htm text
|
||||||
|
*.html text
|
||||||
|
*.hxx text
|
||||||
|
*.i text
|
||||||
|
*.idl text
|
||||||
|
*.java text
|
||||||
|
*.js text
|
||||||
|
*.mk text
|
||||||
|
*.mm text
|
||||||
|
*.plist text
|
||||||
|
*.properties text
|
||||||
|
*.py text
|
||||||
|
*.qrc text
|
||||||
|
*.qss text
|
||||||
|
*.S text
|
||||||
|
*.sbt text
|
||||||
|
*.scala text
|
||||||
|
*.sty text
|
||||||
|
*.tex text
|
||||||
|
*.txt text
|
||||||
|
*.xaml text
|
||||||
|
|
||||||
|
# reST underlines/overlines can look like conflict markers
|
||||||
|
*.rst text conflict-marker-size=80
|
||||||
|
|
||||||
*.cmake text whitespace=tabwidth=2
|
*.cmake text whitespace=tabwidth=2
|
||||||
*.cmakein text whitespace=tabwidth=2
|
*.cmakein text whitespace=tabwidth=2
|
||||||
*.in text whitespace=tabwidth=2
|
*.in text whitespace=tabwidth=2
|
||||||
CMakeLists.txt text whitespace=tabwidth=2
|
CMakeLists.txt text whitespace=tabwidth=2
|
||||||
|
|
||||||
*.png binary
|
*.avi binary
|
||||||
*.jpeg binary
|
*.bmp binary
|
||||||
*.jpg binary
|
|
||||||
*.exr binary
|
*.exr binary
|
||||||
*.ico binary
|
*.ico binary
|
||||||
|
*.jpeg binary
|
||||||
|
*.jpg binary
|
||||||
|
*.png binary
|
||||||
|
|
||||||
*.a binary
|
*.a binary
|
||||||
*.so binary
|
*.so binary
|
||||||
@ -47,6 +63,7 @@ CMakeLists.txt text whitespace=tabwidth=2
|
|||||||
*.pbxproj binary
|
*.pbxproj binary
|
||||||
*.vec binary
|
*.vec binary
|
||||||
*.doc binary
|
*.doc binary
|
||||||
|
*.dia binary
|
||||||
|
|
||||||
*.xml -text whitespace=cr-at-eol
|
*.xml -text whitespace=cr-at-eol
|
||||||
*.yml -text whitespace=cr-at-eol
|
*.yml -text whitespace=cr-at-eol
|
||||||
@ -55,9 +72,12 @@ CMakeLists.txt text whitespace=tabwidth=2
|
|||||||
.cproject -text whitespace=cr-at-eol merge=union
|
.cproject -text whitespace=cr-at-eol merge=union
|
||||||
org.eclipse.jdt.core.prefs -text whitespace=cr-at-eol merge=union
|
org.eclipse.jdt.core.prefs -text whitespace=cr-at-eol merge=union
|
||||||
|
|
||||||
*.vcproj text eol=crlf merge=union
|
|
||||||
*.bat text eol=crlf
|
*.bat text eol=crlf
|
||||||
*.cmd text eol=crlf
|
*.cmd text eol=crlf
|
||||||
*.cmd.tmpl text eol=crlf
|
*.cmd.tmpl text eol=crlf
|
||||||
|
*.dsp text eol=crlf -whitespace
|
||||||
|
*.sln text eol=crlf -whitespace
|
||||||
|
*.vcproj text eol=crlf -whitespace merge=union
|
||||||
|
*.vcxproj text eol=crlf -whitespace merge=union
|
||||||
|
|
||||||
*.sh text eol=lf
|
*.sh text eol=lf
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,6 +2,7 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
refman.rst
|
refman.rst
|
||||||
OpenCV4Tegra/
|
OpenCV4Tegra/
|
||||||
|
tegra/
|
||||||
*.user
|
*.user
|
||||||
.sw[a-z]
|
.sw[a-z]
|
||||||
.*.swp
|
.*.swp
|
||||||
|
1
3rdparty/.gitattributes
vendored
Normal file
1
3rdparty/.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
* -whitespace
|
1
3rdparty/ffmpeg/ffmpeg_version.cmake
vendored
1
3rdparty/ffmpeg/ffmpeg_version.cmake
vendored
@ -1,4 +1,3 @@
|
|||||||
set(NEW_FFMPEG 1)
|
|
||||||
set(HAVE_FFMPEG_CODEC 1)
|
set(HAVE_FFMPEG_CODEC 1)
|
||||||
set(HAVE_FFMPEG_FORMAT 1)
|
set(HAVE_FFMPEG_FORMAT 1)
|
||||||
set(HAVE_FFMPEG_UTIL 1)
|
set(HAVE_FFMPEG_UTIL 1)
|
||||||
|
2
3rdparty/ffmpeg/readme.txt
vendored
2
3rdparty/ffmpeg/readme.txt
vendored
@ -40,5 +40,3 @@ How to update opencv_ffmpeg.dll and opencv_ffmpeg_64.dll when a new version of F
|
|||||||
|
|
||||||
8. Then, go to <opencv>\3rdparty\ffmpeg, edit make.bat
|
8. Then, go to <opencv>\3rdparty\ffmpeg, edit make.bat
|
||||||
(change paths to the actual paths to your msys32 and msys64 distributions) and then run make.bat
|
(change paths to the actual paths to your msys32 and msys64 distributions) and then run make.bat
|
||||||
|
|
||||||
|
|
||||||
|
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r2.2.0.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r2.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r2.3.3.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r2.3.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r3.0.1.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r3.0.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.0.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.3.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.1.1.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.1.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.2.0.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.3.0.so
vendored
Executable file
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.3.0.so
vendored
Executable file
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r2.2.0.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r2.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r2.3.3.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r2.3.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r3.0.1.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r3.0.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r4.0.0.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r4.0.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r4.0.3.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r4.0.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r4.1.1.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r4.1.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r4.2.0.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r4.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r4.3.0.so
vendored
Executable file
BIN
3rdparty/lib/armeabi/libnative_camera_r4.3.0.so
vendored
Executable file
Binary file not shown.
BIN
3rdparty/lib/mips/libnative_camera_r4.0.3.so
vendored
BIN
3rdparty/lib/mips/libnative_camera_r4.0.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/mips/libnative_camera_r4.1.1.so
vendored
BIN
3rdparty/lib/mips/libnative_camera_r4.1.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/mips/libnative_camera_r4.2.0.so
vendored
BIN
3rdparty/lib/mips/libnative_camera_r4.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/mips/libnative_camera_r4.3.0.so
vendored
Executable file
BIN
3rdparty/lib/mips/libnative_camera_r4.3.0.so
vendored
Executable file
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r2.3.3.so
vendored
BIN
3rdparty/lib/x86/libnative_camera_r2.3.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r3.0.1.so
vendored
BIN
3rdparty/lib/x86/libnative_camera_r3.0.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r4.0.3.so
vendored
BIN
3rdparty/lib/x86/libnative_camera_r4.0.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r4.1.1.so
vendored
BIN
3rdparty/lib/x86/libnative_camera_r4.1.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r4.2.0.so
vendored
BIN
3rdparty/lib/x86/libnative_camera_r4.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r4.3.0.so
vendored
Executable file
BIN
3rdparty/lib/x86/libnative_camera_r4.3.0.so
vendored
Executable file
Binary file not shown.
1
3rdparty/libjasper/CMakeLists.txt
vendored
1
3rdparty/libjasper/CMakeLists.txt
vendored
@ -48,4 +48,3 @@ endif()
|
|||||||
if(NOT BUILD_SHARED_LIBS)
|
if(NOT BUILD_SHARED_LIBS)
|
||||||
install(TARGETS ${JASPER_LIBRARY} ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
|
install(TARGETS ${JASPER_LIBRARY} ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
4
3rdparty/libpng/CMakeLists.txt
vendored
4
3rdparty/libpng/CMakeLists.txt
vendored
@ -29,6 +29,10 @@ if(MSVC)
|
|||||||
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||||
endif(MSVC)
|
endif(MSVC)
|
||||||
|
|
||||||
|
if (HAVE_WINRT)
|
||||||
|
add_definitions(-DHAVE_WINRT)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_library(${PNG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
|
add_library(${PNG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
|
||||||
target_link_libraries(${PNG_LIBRARY} ${ZLIB_LIBRARY})
|
target_link_libraries(${PNG_LIBRARY} ${ZLIB_LIBRARY})
|
||||||
|
|
||||||
|
22
3rdparty/libpng/opencv-libpng.patch
vendored
Normal file
22
3rdparty/libpng/opencv-libpng.patch
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
diff --git a/3rdparty/libpng/pngpriv.h b/3rdparty/libpng/pngpriv.h
|
||||||
|
index 07b2b0b..e7824b8 100644
|
||||||
|
--- a/3rdparty/libpng/pngpriv.h
|
||||||
|
+++ b/3rdparty/libpng/pngpriv.h
|
||||||
|
@@ -360,7 +360,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
|
||||||
|
|
||||||
|
/* Memory model/platform independent fns */
|
||||||
|
#ifndef PNG_ABORT
|
||||||
|
-# ifdef _WINDOWS_
|
||||||
|
+# if defined(_WINDOWS_) && !defined(HAVE_WINRT)
|
||||||
|
# define PNG_ABORT() ExitProcess(0)
|
||||||
|
# else
|
||||||
|
# define PNG_ABORT() abort()
|
||||||
|
@@ -378,7 +378,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
|
||||||
|
# define png_memcpy _fmemcpy
|
||||||
|
# define png_memset _fmemset
|
||||||
|
#else
|
||||||
|
-# ifdef _WINDOWS_ /* Favor Windows over C runtime fns */
|
||||||
|
+# if defined(_WINDOWS_) && !defined(HAVE_WINRT) /* Favor Windows over C runtime fns */
|
||||||
|
# define CVT_PTR(ptr) (ptr)
|
||||||
|
# define CVT_PTR_NOCHECK(ptr) (ptr)
|
||||||
|
# define png_strlen lstrlenA
|
4
3rdparty/libpng/pngpriv.h
vendored
4
3rdparty/libpng/pngpriv.h
vendored
@ -360,7 +360,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
|
|||||||
|
|
||||||
/* Memory model/platform independent fns */
|
/* Memory model/platform independent fns */
|
||||||
#ifndef PNG_ABORT
|
#ifndef PNG_ABORT
|
||||||
# ifdef _WINDOWS_
|
# if defined(_WINDOWS_) && !defined(HAVE_WINRT)
|
||||||
# define PNG_ABORT() ExitProcess(0)
|
# define PNG_ABORT() ExitProcess(0)
|
||||||
# else
|
# else
|
||||||
# define PNG_ABORT() abort()
|
# define PNG_ABORT() abort()
|
||||||
@ -378,7 +378,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
|
|||||||
# define png_memcpy _fmemcpy
|
# define png_memcpy _fmemcpy
|
||||||
# define png_memset _fmemset
|
# define png_memset _fmemset
|
||||||
#else
|
#else
|
||||||
# ifdef _WINDOWS_ /* Favor Windows over C runtime fns */
|
# if defined(_WINDOWS_) && !defined(HAVE_WINRT) /* Favor Windows over C runtime fns */
|
||||||
# define CVT_PTR(ptr) (ptr)
|
# define CVT_PTR(ptr) (ptr)
|
||||||
# define CVT_PTR_NOCHECK(ptr) (ptr)
|
# define CVT_PTR_NOCHECK(ptr) (ptr)
|
||||||
# define png_strlen lstrlenA
|
# define png_strlen lstrlenA
|
||||||
|
10
3rdparty/libtiff/CMakeLists.txt
vendored
10
3rdparty/libtiff/CMakeLists.txt
vendored
@ -17,7 +17,7 @@ check_include_file(string.h HAVE_STRING_H)
|
|||||||
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
|
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
|
||||||
check_include_file(unistd.h HAVE_UNISTD_H)
|
check_include_file(unistd.h HAVE_UNISTD_H)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32 AND NOT HAVE_WINRT)
|
||||||
set(USE_WIN32_FILEIO 1)
|
set(USE_WIN32_FILEIO 1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -79,14 +79,12 @@ set(lib_srcs
|
|||||||
"${CMAKE_CURRENT_BINARY_DIR}/tif_config.h"
|
"${CMAKE_CURRENT_BINARY_DIR}/tif_config.h"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(UNIX)
|
if(WIN32 AND NOT HAVE_WINRT)
|
||||||
|
list(APPEND lib_srcs tif_win32.c)
|
||||||
|
else()
|
||||||
list(APPEND lib_srcs tif_unix.c)
|
list(APPEND lib_srcs tif_unix.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
list(APPEND lib_srcs tif_win32.c)
|
|
||||||
endif(WIN32)
|
|
||||||
|
|
||||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wno-unused-but-set-variable -Wmissing-prototypes -Wmissing-declarations -Wundef -Wunused -Wsign-compare
|
ocv_warnings_disable(CMAKE_C_FLAGS -Wno-unused-but-set-variable -Wmissing-prototypes -Wmissing-declarations -Wundef -Wunused -Wsign-compare
|
||||||
-Wcast-align -Wshadow -Wno-maybe-uninitialized -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast)
|
-Wcast-align -Wshadow -Wno-maybe-uninitialized -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast)
|
||||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
|
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
|
||||||
|
1
3rdparty/libtiff/tif_config.h.cmakein
vendored
1
3rdparty/libtiff/tif_config.h.cmakein
vendored
@ -168,4 +168,3 @@
|
|||||||
|
|
||||||
/* Support Deflate compression */
|
/* Support Deflate compression */
|
||||||
#define ZIP_SUPPORT 1
|
#define ZIP_SUPPORT 1
|
||||||
|
|
||||||
|
10
3rdparty/tbb/CMakeLists.txt
vendored
10
3rdparty/tbb/CMakeLists.txt
vendored
@ -11,7 +11,7 @@ if (WIN32 AND ARM)
|
|||||||
set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130613oss_src.tgz")
|
set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130613oss_src.tgz")
|
||||||
set(tbb_md5 "108c8c1e481b0aaea61878289eb28b6a")
|
set(tbb_md5 "108c8c1e481b0aaea61878289eb28b6a")
|
||||||
set(tbb_version_file "version_string.ver")
|
set(tbb_version_file "version_string.ver")
|
||||||
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow -Wunused-parameter)
|
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
|
||||||
else()
|
else()
|
||||||
# 4.1 update 2 - works fine
|
# 4.1 update 2 - works fine
|
||||||
set(tbb_ver "tbb41_20130116oss")
|
set(tbb_ver "tbb41_20130116oss")
|
||||||
@ -230,9 +230,15 @@ endif()
|
|||||||
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations)
|
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations)
|
||||||
string(REPLACE "-Werror=non-virtual-dtor" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
string(REPLACE "-Werror=non-virtual-dtor" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
set(tbb_debug_postfix "_debug") # to fit pragmas in _windef.h inside TBB
|
||||||
|
else()
|
||||||
|
set(tbb_debug_postfix ${OPENCV_DEBUG_POSTFIX})
|
||||||
|
endif()
|
||||||
|
|
||||||
set_target_properties(tbb
|
set_target_properties(tbb
|
||||||
PROPERTIES OUTPUT_NAME tbb
|
PROPERTIES OUTPUT_NAME tbb
|
||||||
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
DEBUG_POSTFIX "${tbb_debug_postfix}"
|
||||||
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
|
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
|
||||||
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
|
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
|
||||||
)
|
)
|
||||||
|
@ -212,7 +212,7 @@ OCV_OPTION(ENABLE_SSE42 "Enable SSE4.2 instructions"
|
|||||||
OCV_OPTION(ENABLE_AVX "Enable AVX instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
|
OCV_OPTION(ENABLE_AVX "Enable AVX instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
|
||||||
OCV_OPTION(ENABLE_NOISY_WARNINGS "Show all warnings even if they are too noisy" OFF )
|
OCV_OPTION(ENABLE_NOISY_WARNINGS "Show all warnings even if they are too noisy" OFF )
|
||||||
OCV_OPTION(OPENCV_WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF )
|
OCV_OPTION(OPENCV_WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF )
|
||||||
|
OCV_OPTION(ENABLE_WINRT_MODE "Build with Windows Runtime support" OFF IF WIN32 )
|
||||||
|
|
||||||
# uncategorized options
|
# uncategorized options
|
||||||
# ===================================================
|
# ===================================================
|
||||||
@ -296,7 +296,6 @@ endif()
|
|||||||
# Path for build/platform -specific headers
|
# Path for build/platform -specific headers
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
set(OPENCV_CONFIG_FILE_INCLUDE_DIR "${CMAKE_BINARY_DIR}/" CACHE PATH "Where to create the platform-dependant cvconfig.h")
|
set(OPENCV_CONFIG_FILE_INCLUDE_DIR "${CMAKE_BINARY_DIR}/" CACHE PATH "Where to create the platform-dependant cvconfig.h")
|
||||||
add_definitions(-DHAVE_CVCONFIG_H)
|
|
||||||
ocv_include_directories(${OPENCV_CONFIG_FILE_INCLUDE_DIR})
|
ocv_include_directories(${OPENCV_CONFIG_FILE_INCLUDE_DIR})
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
@ -370,9 +369,6 @@ if(UNIX)
|
|||||||
include(CheckIncludeFile)
|
include(CheckIncludeFile)
|
||||||
|
|
||||||
if(NOT APPLE)
|
if(NOT APPLE)
|
||||||
CHECK_INCLUDE_FILE(alloca.h HAVE_ALLOCA_H)
|
|
||||||
CHECK_FUNCTION_EXISTS(alloca HAVE_ALLOCA)
|
|
||||||
CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
|
|
||||||
CHECK_INCLUDE_FILE(pthread.h HAVE_LIBPTHREAD)
|
CHECK_INCLUDE_FILE(pthread.h HAVE_LIBPTHREAD)
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m log)
|
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m log)
|
||||||
@ -382,7 +378,7 @@ if(UNIX)
|
|||||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m pthread rt)
|
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m pthread rt)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
add_definitions(-DHAVE_ALLOCA -DHAVE_ALLOCA_H -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H)
|
set(HAVE_LIBPTHREAD YES)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -501,6 +497,8 @@ include(cmake/OpenCVGenAndroidMK.cmake)
|
|||||||
# Generate OpenCVСonfig.cmake and OpenCVConfig-version.cmake for cmake projects
|
# Generate OpenCVСonfig.cmake and OpenCVConfig-version.cmake for cmake projects
|
||||||
include(cmake/OpenCVGenConfig.cmake)
|
include(cmake/OpenCVGenConfig.cmake)
|
||||||
|
|
||||||
|
# Generate Info.plist for the IOS framework
|
||||||
|
include(cmake/OpenCVGenInfoPlist.cmake)
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
# Summary:
|
# Summary:
|
||||||
@ -607,6 +605,16 @@ if(ANDROID)
|
|||||||
status(" Android examples:" BUILD_ANDROID_EXAMPLES AND CAN_BUILD_ANDROID_PROJECTS THEN YES ELSE NO)
|
status(" Android examples:" BUILD_ANDROID_EXAMPLES AND CAN_BUILD_ANDROID_PROJECTS THEN YES ELSE NO)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# ================== Windows RT features ==================
|
||||||
|
if(WIN32)
|
||||||
|
status("")
|
||||||
|
status(" Windows RT support:" HAVE_WINRT THEN YES ELSE NO)
|
||||||
|
if (ENABLE_WINRT_MODE)
|
||||||
|
status(" Windows SDK v8.0:" ${WINDOWS_SDK_PATH})
|
||||||
|
status(" Visual Studio 2012:" ${VISUAL_STUDIO_PATH})
|
||||||
|
endif()
|
||||||
|
endif(WIN32)
|
||||||
|
|
||||||
# ========================== GUI ==========================
|
# ========================== GUI ==========================
|
||||||
status("")
|
status("")
|
||||||
status(" GUI: ")
|
status(" GUI: ")
|
||||||
@ -739,8 +747,8 @@ if(DEFINED WITH_GIGEAPI)
|
|||||||
endif(DEFINED WITH_GIGEAPI)
|
endif(DEFINED WITH_GIGEAPI)
|
||||||
|
|
||||||
if(DEFINED WITH_QUICKTIME)
|
if(DEFINED WITH_QUICKTIME)
|
||||||
status(" QuickTime:" WITH_QUICKTIME THEN YES ELSE NO)
|
status(" QuickTime:" HAVE_QUICKTIME THEN YES ELSE NO)
|
||||||
status(" QTKit:" WITH_QUICKTIME THEN NO ELSE YES)
|
status(" QTKit:" HAVE_QTKIT THEN YES ELSE NO)
|
||||||
endif(DEFINED WITH_QUICKTIME)
|
endif(DEFINED WITH_QUICKTIME)
|
||||||
|
|
||||||
if(DEFINED WITH_UNICAP)
|
if(DEFINED WITH_UNICAP)
|
||||||
@ -885,4 +893,3 @@ ocv_finalize_status()
|
|||||||
if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
|
if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
message(WARNING "The source directory is the same as binary directory. \"make clean\" may damage the source tree")
|
message(WARNING "The source directory is the same as binary directory. \"make clean\" may damage the source tree")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
17
README
17
README
@ -1,17 +0,0 @@
|
|||||||
OpenCV: open source computer vision library
|
|
||||||
|
|
||||||
Homepage: http://opencv.org
|
|
||||||
Online docs: http://docs.opencv.org
|
|
||||||
Q&A forum: http://answers.opencv.org
|
|
||||||
Dev zone: http://code.opencv.org
|
|
||||||
|
|
||||||
Please read before starting work on a pull request:
|
|
||||||
http://code.opencv.org/projects/opencv/wiki/How_to_contribute
|
|
||||||
|
|
||||||
Summary of guidelines:
|
|
||||||
|
|
||||||
* One pull request per issue;
|
|
||||||
* Choose the right base branch;
|
|
||||||
* Include tests and documentation;
|
|
||||||
* Clean up "oops" commits before submitting;
|
|
||||||
* Follow the coding style guide.
|
|
23
README.md
Normal file
23
README.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
### OpenCV: Open Source Computer Vision Library
|
||||||
|
|
||||||
|
#### Resources
|
||||||
|
|
||||||
|
* Homepage: <http://opencv.org>
|
||||||
|
* Docs: <http://docs.opencv.org>
|
||||||
|
* Q&A forum: <http://answers.opencv.org>
|
||||||
|
* Issue tracking: <http://code.opencv.org>
|
||||||
|
|
||||||
|
#### Contributing
|
||||||
|
|
||||||
|
Please read before starting work on a pull request: <http://code.opencv.org/projects/opencv/wiki/How_to_contribute>
|
||||||
|
|
||||||
|
Summary of guidelines:
|
||||||
|
|
||||||
|
* One pull request per issue;
|
||||||
|
* Choose the right base branch;
|
||||||
|
* Include tests and documentation;
|
||||||
|
* Clean up "oops" commits before submitting;
|
||||||
|
* Follow the coding style guide.
|
||||||
|
|
||||||
|
[](https://www.gittip.com/OpenCV/)
|
||||||
|
[](https://www.paypal.com/cgi-bin/webscr?item_name=Donation+to+OpenCV&cmd=_donations&business=accountant%40opencv.org)
|
@ -79,4 +79,3 @@ if(ENABLE_SOLUTION_FOLDERS)
|
|||||||
set_target_properties(opencv_haartraining PROPERTIES FOLDER "applications")
|
set_target_properties(opencv_haartraining PROPERTIES FOLDER "applications")
|
||||||
set_target_properties(opencv_haartraining_engine PROPERTIES FOLDER "applications")
|
set_target_properties(opencv_haartraining_engine PROPERTIES FOLDER "applications")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -100,4 +100,3 @@ int icvGetIdxAt( CvMat* idx, int pos )
|
|||||||
void icvSave( const CvArr* ptr, const char* filename, int line );
|
void icvSave( const CvArr* ptr, const char* filename, int line );
|
||||||
|
|
||||||
#endif /* __CVCOMMON_H_ */
|
#endif /* __CVCOMMON_H_ */
|
||||||
|
|
||||||
|
@ -376,4 +376,3 @@ int main( int argc, char* argv[] )
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,4 +34,3 @@ if(ENABLE_SOLUTION_FOLDERS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS ${the_target} RUNTIME DESTINATION bin COMPONENT main)
|
install(TARGETS ${the_target} RUNTIME DESTINATION bin COMPONENT main)
|
||||||
|
|
||||||
|
@ -2,6 +2,45 @@ if(NOT MSVC)
|
|||||||
message(FATAL_ERROR "CRT options are available only for MSVC")
|
message(FATAL_ERROR "CRT options are available only for MSVC")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
#INCLUDE (CheckIncludeFiles)
|
||||||
|
|
||||||
|
set(HAVE_WINRT FALSE)
|
||||||
|
|
||||||
|
# search Windows Platform SDK
|
||||||
|
message(STATUS "Checking for Windows Platform SDK")
|
||||||
|
GET_FILENAME_COMPONENT(WINDOWS_SDK_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]" ABSOLUTE CACHE)
|
||||||
|
if (WINDOWS_SDK_PATH STREQUAL "")
|
||||||
|
set(HAVE_MSPDK FALSE)
|
||||||
|
message(STATUS "Windows Platform SDK 8.0 was not found")
|
||||||
|
else()
|
||||||
|
set(HAVE_MSPDK TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#search for Visual Studio 11.0 install directory
|
||||||
|
message(STATUS "Checking for Visual Studio 2012")
|
||||||
|
GET_FILENAME_COMPONENT(VISUAL_STUDIO_PATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir] REALPATH CACHE)
|
||||||
|
if (VISUAL_STUDIO_PATH STREQUAL "")
|
||||||
|
set(HAVE_MSVC2012 FALSE)
|
||||||
|
message(STATUS "Visual Studio 2012 was not found")
|
||||||
|
else()
|
||||||
|
set(HAVE_MSVC2012 TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
try_compile(HAVE_WINRT_SDK
|
||||||
|
"${OpenCV_BINARY_DIR}"
|
||||||
|
"${OpenCV_SOURCE_DIR}/cmake/checks/winrttest.cpp")
|
||||||
|
|
||||||
|
if (ENABLE_WINRT_MODE AND HAVE_WINRT_SDK AND HAVE_MSVC2012 AND HAVE_MSPDK)
|
||||||
|
set(HAVE_WINRT TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (HAVE_WINRT)
|
||||||
|
add_definitions(/DWINVER=0x0602 /DNTDDI_VERSION=NTDDI_WIN8 /D_WIN32_WINNT=0x0602)
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /appcontainer")
|
||||||
|
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /appcontainer")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /appcontainer")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(NOT BUILD_SHARED_LIBS AND BUILD_WITH_STATIC_CRT)
|
if(NOT BUILD_SHARED_LIBS AND BUILD_WITH_STATIC_CRT)
|
||||||
foreach(flag_var
|
foreach(flag_var
|
||||||
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
|
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
|
||||||
@ -62,4 +101,3 @@ if(NOT BUILD_WITH_DEBUG_INFO AND NOT MSVC)
|
|||||||
string(REPLACE "/Zi" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
|
string(REPLACE "/Zi" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
|
||||||
string(REPLACE "/Zi" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
|
string(REPLACE "/Zi" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -239,6 +239,10 @@ if(MSVC)
|
|||||||
set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /fp:fast") # !! important - be on the same wave with x64 compilers
|
set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /fp:fast") # !! important - be on the same wave with x64 compilers
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(OPENCV_WARNINGS_ARE_ERRORS)
|
||||||
|
set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /WX")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Extra link libs if the user selects building static libs:
|
# Extra link libs if the user selects building static libs:
|
||||||
|
@ -156,4 +156,3 @@ else()
|
|||||||
set(OpenCV_FOUND FALSE CACHE BOOL "" FORCE)
|
set(OpenCV_FOUND FALSE CACHE BOOL "" FORCE)
|
||||||
set(OPENCV_FOUND FALSE CACHE BOOL "" FORCE)
|
set(OPENCV_FOUND FALSE CACHE BOOL "" FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -96,7 +96,11 @@ if(CUDA_FOUND)
|
|||||||
if(CUDA_GENERATION STREQUAL "Fermi")
|
if(CUDA_GENERATION STREQUAL "Fermi")
|
||||||
set(__cuda_arch_bin "2.0 2.1(2.0)")
|
set(__cuda_arch_bin "2.0 2.1(2.0)")
|
||||||
elseif(CUDA_GENERATION STREQUAL "Kepler")
|
elseif(CUDA_GENERATION STREQUAL "Kepler")
|
||||||
set(__cuda_arch_bin "3.0")
|
if(${CUDA_VERSION} VERSION_LESS "5.0")
|
||||||
|
set(__cuda_arch_bin "3.0")
|
||||||
|
else()
|
||||||
|
set(__cuda_arch_bin "3.0 3.5")
|
||||||
|
endif()
|
||||||
elseif(CUDA_GENERATION STREQUAL "Auto")
|
elseif(CUDA_GENERATION STREQUAL "Auto")
|
||||||
execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" "${OpenCV_SOURCE_DIR}/cmake/checks/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/"
|
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
|
||||||
@ -110,8 +114,12 @@ if(CUDA_FOUND)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT DEFINED __cuda_arch_bin)
|
if(NOT DEFINED __cuda_arch_bin)
|
||||||
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0")
|
if(${CUDA_VERSION} VERSION_LESS "5.0")
|
||||||
set(__cuda_arch_ptx "2.0 3.0")
|
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0")
|
||||||
|
else()
|
||||||
|
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0 3.5")
|
||||||
|
endif()
|
||||||
|
set(__cuda_arch_ptx "3.0")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CUDA_ARCH_BIN ${__cuda_arch_bin} CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported")
|
set(CUDA_ARCH_BIN ${__cuda_arch_bin} CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported")
|
||||||
|
@ -108,7 +108,7 @@ if(PYTHON_EXECUTABLE)
|
|||||||
OUTPUT_QUIET
|
OUTPUT_QUIET
|
||||||
ERROR_VARIABLE SPHINX_OUTPUT
|
ERROR_VARIABLE SPHINX_OUTPUT
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
if(SPHINX_OUTPUT MATCHES "^Sphinx v([0-9][^ \n]*)")
|
if(SPHINX_OUTPUT MATCHES "Sphinx v([0-9][^ \n]*)")
|
||||||
set(SPHINX_VERSION "${CMAKE_MATCH_1}")
|
set(SPHINX_VERSION "${CMAKE_MATCH_1}")
|
||||||
set(HAVE_SPHINX 1)
|
set(HAVE_SPHINX 1)
|
||||||
message(STATUS "Found Sphinx ${SPHINX_VERSION}: ${SPHINX_BUILD}")
|
message(STATUS "Found Sphinx ${SPHINX_VERSION}: ${SPHINX_BUILD}")
|
||||||
|
@ -136,12 +136,20 @@ endfunction()
|
|||||||
|
|
||||||
# ------------------------------------------------------------------------
|
# ------------------------------------------------------------------------
|
||||||
# This is auxiliary function called from set_ipp_variables()
|
# 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)
|
function(set_ipp_new_libraries _LATEST_VERSION)
|
||||||
set(IPP_PREFIX "ipp")
|
set(IPP_PREFIX "ipp")
|
||||||
set(IPP_SUFFIX "_l") # static not threaded libs suffix
|
|
||||||
set(IPP_THRD "_t") # static threaded libs suffix
|
if(${_LATEST_VERSION} VERSION_LESS "8.0")
|
||||||
|
set(IPP_SUFFIX "_l") # static not threaded libs suffix IPP 7.x
|
||||||
|
else()
|
||||||
|
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(IPPCORE "core") # core functionality
|
set(IPPCORE "core") # core functionality
|
||||||
set(IPPSP "s") # signal processing
|
set(IPPSP "s") # signal processing
|
||||||
set(IPPIP "i") # image processing
|
set(IPPIP "i") # image processing
|
||||||
@ -199,7 +207,9 @@ function(set_ipp_variables _LATEST_VERSION)
|
|||||||
# set INCLUDE and LIB folders
|
# set INCLUDE and LIB folders
|
||||||
set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/include PARENT_SCOPE)
|
set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/include PARENT_SCOPE)
|
||||||
|
|
||||||
if (IPP_X64)
|
if (APPLE)
|
||||||
|
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib PARENT_SCOPE)
|
||||||
|
elseif (IPP_X64)
|
||||||
if(NOT EXISTS ${IPP_ROOT_DIR}/lib/intel64)
|
if(NOT EXISTS ${IPP_ROOT_DIR}/lib/intel64)
|
||||||
message(SEND_ERROR "IPP EM64T libraries not found")
|
message(SEND_ERROR "IPP EM64T libraries not found")
|
||||||
endif()
|
endif()
|
||||||
@ -211,8 +221,8 @@ function(set_ipp_variables _LATEST_VERSION)
|
|||||||
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/ia32 PARENT_SCOPE)
|
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/ia32 PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# set IPP_LIBRARIES variable (7.x lib names)
|
# set IPP_LIBRARIES variable (7.x or 8.x lib names)
|
||||||
set_ipp_new_libraries()
|
set_ipp_new_libraries(${_LATEST_VERSION})
|
||||||
set(IPP_LIBRARIES ${IPP_LIBRARIES} PARENT_SCOPE)
|
set(IPP_LIBRARIES ${IPP_LIBRARIES} PARENT_SCOPE)
|
||||||
message(STATUS "IPP libs: ${IPP_LIBRARIES}")
|
message(STATUS "IPP libs: ${IPP_LIBRARIES}")
|
||||||
|
|
||||||
|
@ -5,12 +5,11 @@
|
|||||||
#--- Win32 UI ---
|
#--- Win32 UI ---
|
||||||
ocv_clear_vars(HAVE_WIN32UI)
|
ocv_clear_vars(HAVE_WIN32UI)
|
||||||
if(WITH_WIN32UI)
|
if(WITH_WIN32UI)
|
||||||
TRY_COMPILE(HAVE_WIN32UI
|
try_compile(HAVE_WIN32UI
|
||||||
"${OPENCV_BINARY_DIR}/CMakeFiles/CMakeTmp"
|
"${OpenCV_BINARY_DIR}"
|
||||||
"${OpenCV_SOURCE_DIR}/cmake/checks/win32uitest.cpp"
|
"${OpenCV_SOURCE_DIR}/cmake/checks/win32uitest.cpp"
|
||||||
CMAKE_FLAGS "\"user32.lib\" \"gdi32.lib\""
|
CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=user32;gdi32")
|
||||||
OUTPUT_VARIABLE OUTPUT)
|
endif()
|
||||||
endif(WITH_WIN32UI)
|
|
||||||
|
|
||||||
# --- QT4 ---
|
# --- QT4 ---
|
||||||
ocv_clear_vars(HAVE_QT HAVE_QT5)
|
ocv_clear_vars(HAVE_QT HAVE_QT5)
|
||||||
@ -65,3 +64,12 @@ if(WITH_OPENGL)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif(WITH_OPENGL)
|
endif(WITH_OPENGL)
|
||||||
|
|
||||||
|
# --- Carbon & Cocoa ---
|
||||||
|
if(APPLE)
|
||||||
|
if(WITH_CARBON)
|
||||||
|
set(HAVE_CARBON YES)
|
||||||
|
elseif(NOT IOS)
|
||||||
|
set(HAVE_COCOA YES)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
@ -36,57 +36,59 @@ if(WITH_TIFF)
|
|||||||
ocv_parse_header("${TIFF_INCLUDE_DIR}/tiff.h" TIFF_VERSION_LINES TIFF_VERSION_CLASSIC TIFF_VERSION_BIG TIFF_VERSION TIFF_BIGTIFF_VERSION)
|
ocv_parse_header("${TIFF_INCLUDE_DIR}/tiff.h" TIFF_VERSION_LINES TIFF_VERSION_CLASSIC TIFF_VERSION_BIG TIFF_VERSION TIFF_BIGTIFF_VERSION)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WITH_TIFF AND NOT TIFF_FOUND)
|
if(NOT TIFF_FOUND)
|
||||||
ocv_clear_vars(TIFF_LIBRARY TIFF_LIBRARIES TIFF_INCLUDE_DIR)
|
ocv_clear_vars(TIFF_LIBRARY TIFF_LIBRARIES TIFF_INCLUDE_DIR)
|
||||||
|
|
||||||
set(TIFF_LIBRARY libtiff)
|
set(TIFF_LIBRARY libtiff)
|
||||||
set(TIFF_LIBRARIES ${TIFF_LIBRARY})
|
set(TIFF_LIBRARIES ${TIFF_LIBRARY})
|
||||||
add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/libtiff")
|
add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/libtiff")
|
||||||
set(TIFF_INCLUDE_DIR "${${TIFF_LIBRARY}_SOURCE_DIR}" "${${TIFF_LIBRARY}_BINARY_DIR}")
|
set(TIFF_INCLUDE_DIR "${${TIFF_LIBRARY}_SOURCE_DIR}" "${${TIFF_LIBRARY}_BINARY_DIR}")
|
||||||
ocv_parse_header("${${TIFF_LIBRARY}_SOURCE_DIR}/tiff.h" TIFF_VERSION_LINES TIFF_VERSION_CLASSIC TIFF_VERSION_BIG TIFF_VERSION TIFF_BIGTIFF_VERSION)
|
ocv_parse_header("${${TIFF_LIBRARY}_SOURCE_DIR}/tiff.h" TIFF_VERSION_LINES TIFF_VERSION_CLASSIC TIFF_VERSION_BIG TIFF_VERSION TIFF_BIGTIFF_VERSION)
|
||||||
endif()
|
|
||||||
|
|
||||||
if(TIFF_VERSION_CLASSIC AND NOT TIFF_VERSION)
|
|
||||||
set(TIFF_VERSION ${TIFF_VERSION_CLASSIC})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(TIFF_BIGTIFF_VERSION AND NOT TIFF_VERSION_BIG)
|
|
||||||
set(TIFF_VERSION_BIG ${TIFF_BIGTIFF_VERSION})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT TIFF_VERSION_STRING AND TIFF_INCLUDE_DIR)
|
|
||||||
list(GET TIFF_INCLUDE_DIR 0 _TIFF_INCLUDE_DIR)
|
|
||||||
if(EXISTS "${_TIFF_INCLUDE_DIR}/tiffvers.h")
|
|
||||||
file(STRINGS "${_TIFF_INCLUDE_DIR}/tiffvers.h" tiff_version_str REGEX "^#define[\t ]+TIFFLIB_VERSION_STR[\t ]+\"LIBTIFF, Version .*")
|
|
||||||
string(REGEX REPLACE "^#define[\t ]+TIFFLIB_VERSION_STR[\t ]+\"LIBTIFF, Version +([^ \\n]*).*" "\\1" TIFF_VERSION_STRING "${tiff_version_str}")
|
|
||||||
unset(tiff_version_str)
|
|
||||||
endif()
|
endif()
|
||||||
unset(_TIFF_INCLUDE_DIR)
|
|
||||||
|
if(TIFF_VERSION_CLASSIC AND NOT TIFF_VERSION)
|
||||||
|
set(TIFF_VERSION ${TIFF_VERSION_CLASSIC})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(TIFF_BIGTIFF_VERSION AND NOT TIFF_VERSION_BIG)
|
||||||
|
set(TIFF_VERSION_BIG ${TIFF_BIGTIFF_VERSION})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT TIFF_VERSION_STRING AND TIFF_INCLUDE_DIR)
|
||||||
|
list(GET TIFF_INCLUDE_DIR 0 _TIFF_INCLUDE_DIR)
|
||||||
|
if(EXISTS "${_TIFF_INCLUDE_DIR}/tiffvers.h")
|
||||||
|
file(STRINGS "${_TIFF_INCLUDE_DIR}/tiffvers.h" tiff_version_str REGEX "^#define[\t ]+TIFFLIB_VERSION_STR[\t ]+\"LIBTIFF, Version .*")
|
||||||
|
string(REGEX REPLACE "^#define[\t ]+TIFFLIB_VERSION_STR[\t ]+\"LIBTIFF, Version +([^ \\n]*).*" "\\1" TIFF_VERSION_STRING "${tiff_version_str}")
|
||||||
|
unset(tiff_version_str)
|
||||||
|
endif()
|
||||||
|
unset(_TIFF_INCLUDE_DIR)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(HAVE_TIFF YES)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# --- libjpeg (optional) ---
|
# --- libjpeg (optional) ---
|
||||||
if(WITH_JPEG AND NOT IOS)
|
if(WITH_JPEG)
|
||||||
if(BUILD_JPEG)
|
if(BUILD_JPEG)
|
||||||
ocv_clear_vars(JPEG_FOUND)
|
ocv_clear_vars(JPEG_FOUND)
|
||||||
else()
|
else()
|
||||||
include(FindJPEG)
|
include(FindJPEG)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT JPEG_FOUND)
|
||||||
|
ocv_clear_vars(JPEG_LIBRARY JPEG_LIBRARIES JPEG_INCLUDE_DIR)
|
||||||
|
|
||||||
|
set(JPEG_LIBRARY libjpeg)
|
||||||
|
set(JPEG_LIBRARIES ${JPEG_LIBRARY})
|
||||||
|
add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/libjpeg")
|
||||||
|
set(JPEG_INCLUDE_DIR "${${JPEG_LIBRARY}_SOURCE_DIR}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
ocv_parse_header("${JPEG_INCLUDE_DIR}/jpeglib.h" JPEG_VERSION_LINES JPEG_LIB_VERSION)
|
||||||
|
set(HAVE_JPEG YES)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_JPEG AND NOT JPEG_FOUND)
|
|
||||||
ocv_clear_vars(JPEG_LIBRARY JPEG_LIBRARIES JPEG_INCLUDE_DIR)
|
|
||||||
|
|
||||||
set(JPEG_LIBRARY libjpeg)
|
|
||||||
set(JPEG_LIBRARIES ${JPEG_LIBRARY})
|
|
||||||
add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/libjpeg")
|
|
||||||
set(JPEG_INCLUDE_DIR "${${JPEG_LIBRARY}_SOURCE_DIR}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
ocv_parse_header("${JPEG_INCLUDE_DIR}/jpeglib.h" JPEG_VERSION_LINES JPEG_LIB_VERSION)
|
|
||||||
|
|
||||||
|
|
||||||
# --- libjasper (optional, should be searched after libjpeg) ---
|
# --- libjasper (optional, should be searched after libjpeg) ---
|
||||||
if(WITH_JASPER)
|
if(WITH_JASPER)
|
||||||
if(BUILD_JASPER)
|
if(BUILD_JASPER)
|
||||||
@ -94,53 +96,55 @@ if(WITH_JASPER)
|
|||||||
else()
|
else()
|
||||||
include(FindJasper)
|
include(FindJasper)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WITH_JASPER AND NOT JASPER_FOUND)
|
if(NOT JASPER_FOUND)
|
||||||
ocv_clear_vars(JASPER_LIBRARY JASPER_LIBRARIES JASPER_INCLUDE_DIR)
|
ocv_clear_vars(JASPER_LIBRARY JASPER_LIBRARIES JASPER_INCLUDE_DIR)
|
||||||
|
|
||||||
set(JASPER_LIBRARY libjasper)
|
set(JASPER_LIBRARY libjasper)
|
||||||
set(JASPER_LIBRARIES ${JASPER_LIBRARY})
|
set(JASPER_LIBRARIES ${JASPER_LIBRARY})
|
||||||
add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/libjasper")
|
add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/libjasper")
|
||||||
set(JASPER_INCLUDE_DIR "${${JASPER_LIBRARY}_SOURCE_DIR}")
|
set(JASPER_INCLUDE_DIR "${${JASPER_LIBRARY}_SOURCE_DIR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT JASPER_VERSION_STRING)
|
set(HAVE_JASPER YES)
|
||||||
ocv_parse_header2(JASPER "${JASPER_INCLUDE_DIR}/jasper/jas_config.h" JAS_VERSION "")
|
|
||||||
|
if(NOT JASPER_VERSION_STRING)
|
||||||
|
ocv_parse_header2(JASPER "${JASPER_INCLUDE_DIR}/jasper/jas_config.h" JAS_VERSION "")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# --- libpng (optional, should be searched after zlib) ---
|
# --- libpng (optional, should be searched after zlib) ---
|
||||||
if(WITH_PNG AND NOT IOS)
|
if(WITH_PNG)
|
||||||
if(BUILD_PNG)
|
if(BUILD_PNG)
|
||||||
ocv_clear_vars(PNG_FOUND)
|
ocv_clear_vars(PNG_FOUND)
|
||||||
else()
|
else()
|
||||||
include(FindPNG)
|
include(FindPNG)
|
||||||
if(PNG_FOUND)
|
if(PNG_FOUND)
|
||||||
include(CheckIncludeFile)
|
include(CheckIncludeFile)
|
||||||
check_include_file("${PNG_PNG_INCLUDE_DIR}/png.h" HAVE_PNG_H)
|
|
||||||
check_include_file("${PNG_PNG_INCLUDE_DIR}/libpng/png.h" HAVE_LIBPNG_PNG_H)
|
check_include_file("${PNG_PNG_INCLUDE_DIR}/libpng/png.h" HAVE_LIBPNG_PNG_H)
|
||||||
if(HAVE_PNG_H)
|
if(HAVE_LIBPNG_PNG_H)
|
||||||
ocv_parse_header("${PNG_PNG_INCLUDE_DIR}/png.h" PNG_VERSION_LINES PNG_LIBPNG_VER_MAJOR PNG_LIBPNG_VER_MINOR PNG_LIBPNG_VER_RELEASE)
|
|
||||||
elseif(HAVE_LIBPNG_PNG_H)
|
|
||||||
ocv_parse_header("${PNG_PNG_INCLUDE_DIR}/libpng/png.h" PNG_VERSION_LINES PNG_LIBPNG_VER_MAJOR PNG_LIBPNG_VER_MINOR PNG_LIBPNG_VER_RELEASE)
|
ocv_parse_header("${PNG_PNG_INCLUDE_DIR}/libpng/png.h" PNG_VERSION_LINES PNG_LIBPNG_VER_MAJOR PNG_LIBPNG_VER_MINOR PNG_LIBPNG_VER_RELEASE)
|
||||||
|
else()
|
||||||
|
ocv_parse_header("${PNG_PNG_INCLUDE_DIR}/png.h" PNG_VERSION_LINES PNG_LIBPNG_VER_MAJOR PNG_LIBPNG_VER_MINOR PNG_LIBPNG_VER_RELEASE)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT PNG_FOUND)
|
||||||
|
ocv_clear_vars(PNG_LIBRARY PNG_LIBRARIES PNG_INCLUDE_DIR PNG_PNG_INCLUDE_DIR HAVE_LIBPNG_PNG_H PNG_DEFINITIONS)
|
||||||
|
|
||||||
|
set(PNG_LIBRARY libpng)
|
||||||
|
set(PNG_LIBRARIES ${PNG_LIBRARY})
|
||||||
|
add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/libpng")
|
||||||
|
set(PNG_INCLUDE_DIR "${${PNG_LIBRARY}_SOURCE_DIR}")
|
||||||
|
set(PNG_DEFINITIONS "")
|
||||||
|
ocv_parse_header("${PNG_INCLUDE_DIR}/png.h" PNG_VERSION_LINES PNG_LIBPNG_VER_MAJOR PNG_LIBPNG_VER_MINOR PNG_LIBPNG_VER_RELEASE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(HAVE_PNG YES)
|
||||||
|
set(PNG_VERSION "${PNG_LIBPNG_VER_MAJOR}.${PNG_LIBPNG_VER_MINOR}.${PNG_LIBPNG_VER_RELEASE}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_PNG AND NOT PNG_FOUND)
|
|
||||||
ocv_clear_vars(PNG_LIBRARY PNG_LIBRARIES PNG_INCLUDE_DIR PNG_PNG_INCLUDE_DIR HAVE_PNG_H HAVE_LIBPNG_PNG_H PNG_DEFINITIONS)
|
|
||||||
|
|
||||||
set(PNG_LIBRARY libpng)
|
|
||||||
set(PNG_LIBRARIES ${PNG_LIBRARY})
|
|
||||||
add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/libpng")
|
|
||||||
set(PNG_INCLUDE_DIR "${${PNG_LIBRARY}_SOURCE_DIR}")
|
|
||||||
set(PNG_DEFINITIONS "")
|
|
||||||
ocv_parse_header("${PNG_INCLUDE_DIR}/png.h" PNG_VERSION_LINES PNG_LIBPNG_VER_MAJOR PNG_LIBPNG_VER_MINOR PNG_LIBPNG_VER_RELEASE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(PNG_VERSION "${PNG_LIBPNG_VER_MAJOR}.${PNG_LIBPNG_VER_MINOR}.${PNG_LIBPNG_VER_RELEASE}")
|
|
||||||
|
|
||||||
# --- OpenEXR (optional) ---
|
# --- OpenEXR (optional) ---
|
||||||
if(WITH_OPENEXR)
|
if(WITH_OPENEXR)
|
||||||
if(BUILD_OPENEXR)
|
if(BUILD_OPENEXR)
|
||||||
@ -148,17 +152,24 @@ if(WITH_OPENEXR)
|
|||||||
else()
|
else()
|
||||||
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindOpenEXR.cmake")
|
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindOpenEXR.cmake")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WITH_OPENEXR AND NOT OPENEXR_FOUND)
|
if(NOT OPENEXR_FOUND)
|
||||||
ocv_clear_vars(OPENEXR_INCLUDE_PATHS OPENEXR_LIBRARIES OPENEXR_ILMIMF_LIBRARY OPENEXR_VERSION)
|
ocv_clear_vars(OPENEXR_INCLUDE_PATHS OPENEXR_LIBRARIES OPENEXR_ILMIMF_LIBRARY OPENEXR_VERSION)
|
||||||
|
|
||||||
set(OPENEXR_LIBRARIES IlmImf)
|
set(OPENEXR_LIBRARIES IlmImf)
|
||||||
set(OPENEXR_ILMIMF_LIBRARY IlmImf)
|
set(OPENEXR_ILMIMF_LIBRARY IlmImf)
|
||||||
add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/openexr")
|
add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/openexr")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(HAVE_OPENEXR YES)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#cmake 2.8.2 bug - it fails to determine zlib version
|
#cmake 2.8.2 bug - it fails to determine zlib version
|
||||||
if(ZLIB_FOUND)
|
if(ZLIB_FOUND)
|
||||||
ocv_parse_header2(ZLIB "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_VERSION)
|
ocv_parse_header2(ZLIB "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_VERSION)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# --- Apple ImageIO ---
|
||||||
|
if(WITH_IMAGEIO)
|
||||||
|
set(HAVE_IMAGEIO YES)
|
||||||
|
endif()
|
||||||
|
@ -3,13 +3,12 @@
|
|||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
ocv_clear_vars(HAVE_VFW)
|
ocv_clear_vars(HAVE_VFW)
|
||||||
if (WITH_VFW)
|
if(WITH_VFW)
|
||||||
TRY_COMPILE(HAVE_VFW
|
try_compile(HAVE_VFW
|
||||||
"${OPENCV_BINARY_DIR}/CMakeFiles/CMakeTmp"
|
"${OpenCV_BINARY_DIR}"
|
||||||
"${OpenCV_SOURCE_DIR}/cmake/checks/vfwtest.cpp"
|
"${OpenCV_SOURCE_DIR}/cmake/checks/vfwtest.cpp"
|
||||||
CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=vfw32"
|
CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=vfw32")
|
||||||
OUTPUT_VARIABLE OUTPUT)
|
endif(WITH_VFW)
|
||||||
endif(WITH_VFW)
|
|
||||||
|
|
||||||
# --- GStreamer ---
|
# --- GStreamer ---
|
||||||
ocv_clear_vars(HAVE_GSTREAMER)
|
ocv_clear_vars(HAVE_GSTREAMER)
|
||||||
@ -58,7 +57,14 @@ if(WITH_PVAPI)
|
|||||||
set(_PVAPI_LIBRARY "${_PVAPI_LIBRARY}/${CMAKE_OPENCV_GCC_VERSION_MAJOR}.${CMAKE_OPENCV_GCC_VERSION_MINOR}")
|
set(_PVAPI_LIBRARY "${_PVAPI_LIBRARY}/${CMAKE_OPENCV_GCC_VERSION_MAJOR}.${CMAKE_OPENCV_GCC_VERSION_MINOR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(PVAPI_LIBRARY "${_PVAPI_LIBRARY}/${CMAKE_STATIC_LIBRARY_PREFIX}PvAPI${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE PATH "The PvAPI library")
|
if(WIN32)
|
||||||
|
if(MINGW)
|
||||||
|
set(PVAPI_DEFINITIONS "-DPVDECL=__stdcall")
|
||||||
|
endif(MINGW)
|
||||||
|
set(PVAPI_LIBRARY "${_PVAPI_LIBRARY}/PvAPI.lib" CACHE PATH "The PvAPI library")
|
||||||
|
else(WIN32)
|
||||||
|
set(PVAPI_LIBRARY "${_PVAPI_LIBRARY}/${CMAKE_STATIC_LIBRARY_PREFIX}PvAPI${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE PATH "The PvAPI library")
|
||||||
|
endif(WIN32)
|
||||||
if(EXISTS "${PVAPI_LIBRARY}")
|
if(EXISTS "${PVAPI_LIBRARY}")
|
||||||
set(HAVE_PVAPI TRUE)
|
set(HAVE_PVAPI TRUE)
|
||||||
endif()
|
endif()
|
||||||
@ -228,3 +234,17 @@ if(WIN32)
|
|||||||
list(APPEND HIGHGUI_LIBRARIES winmm)
|
list(APPEND HIGHGUI_LIBRARIES winmm)
|
||||||
endif()
|
endif()
|
||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
|
|
||||||
|
# --- Apple AV Foundation ---
|
||||||
|
if(WITH_AVFOUNDATION)
|
||||||
|
set(HAVE_AVFOUNDATION YES)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# --- QuickTime ---
|
||||||
|
if (NOT IOS)
|
||||||
|
if(WITH_QUICKTIME)
|
||||||
|
set(HAVE_QUICKTIME YES)
|
||||||
|
elseif(APPLE)
|
||||||
|
set(HAVE_QTKIT YES)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
@ -1,13 +1,3 @@
|
|||||||
# ----------------------------------------------------------------------------
|
|
||||||
# Variables for cvconfig.h.cmake
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
set(PACKAGE "opencv")
|
|
||||||
set(PACKAGE_BUGREPORT "opencvlibrary-devel@lists.sourceforge.net")
|
|
||||||
set(PACKAGE_NAME "opencv")
|
|
||||||
set(PACKAGE_STRING "${PACKAGE} ${OPENCV_VERSION}")
|
|
||||||
set(PACKAGE_TARNAME "${PACKAGE}")
|
|
||||||
set(PACKAGE_VERSION "${OPENCV_VERSION}")
|
|
||||||
|
|
||||||
# platform-specific config file
|
# platform-specific config file
|
||||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/cvconfig.h.cmake" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h")
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/cvconfig.h.cmake" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h")
|
||||||
|
|
||||||
|
4
cmake/OpenCVGenInfoPlist.cmake
Normal file
4
cmake/OpenCVGenInfoPlist.cmake
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
if(IOS)
|
||||||
|
configure_file("${OpenCV_SOURCE_DIR}/platforms/ios/Info.plist.in"
|
||||||
|
"${CMAKE_BINARY_DIR}/ios/Info.plist")
|
||||||
|
endif()
|
@ -12,7 +12,6 @@ set(prefix "${CMAKE_INSTALL_PREFIX}")
|
|||||||
set(exec_prefix "\${prefix}")
|
set(exec_prefix "\${prefix}")
|
||||||
set(libdir "") #TODO: need link paths for OpenCV_EXTRA_COMPONENTS
|
set(libdir "") #TODO: need link paths for OpenCV_EXTRA_COMPONENTS
|
||||||
set(includedir "\${prefix}/${OPENCV_INCLUDE_INSTALL_PATH}")
|
set(includedir "\${prefix}/${OPENCV_INCLUDE_INSTALL_PATH}")
|
||||||
set(VERSION ${OPENCV_VERSION})
|
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE MATCHES "Release")
|
if(CMAKE_BUILD_TYPE MATCHES "Release")
|
||||||
set(ocv_optkind OPT)
|
set(ocv_optkind OPT)
|
||||||
|
@ -22,4 +22,3 @@ if(DEFINED OPENCV_BUILD_3RDPARTY_LIBS)
|
|||||||
set(BUILD_PNG ${OPENCV_BUILD_3RDPARTY_LIBS} CACHE BOOL "Set via depricated OPENCV_BUILD_3RDPARTY_LIBS" FORCE)
|
set(BUILD_PNG ${OPENCV_BUILD_3RDPARTY_LIBS} CACHE BOOL "Set via depricated OPENCV_BUILD_3RDPARTY_LIBS" FORCE)
|
||||||
unset(OPENCV_BUILD_3RDPARTY_LIBS CACHE)
|
unset(OPENCV_BUILD_3RDPARTY_LIBS CACHE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -470,8 +470,16 @@ endmacro()
|
|||||||
# ocv_create_module(<extra link dependencies>)
|
# ocv_create_module(<extra link dependencies>)
|
||||||
# ocv_create_module(SKIP_LINK)
|
# ocv_create_module(SKIP_LINK)
|
||||||
macro(ocv_create_module)
|
macro(ocv_create_module)
|
||||||
|
# The condition we ought to be testing here is whether ocv_add_precompiled_headers will
|
||||||
|
# be called at some point in the future. We can't look into the future, though,
|
||||||
|
# so this will have to do.
|
||||||
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/precomp.hpp")
|
||||||
|
get_native_precompiled_header(${the_module} precomp.hpp)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_library(${the_module} ${OPENCV_MODULE_TYPE} ${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES}
|
add_library(${the_module} ${OPENCV_MODULE_TYPE} ${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES}
|
||||||
"${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp")
|
"${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp"
|
||||||
|
${${the_module}_pch})
|
||||||
|
|
||||||
if(NOT "${ARGN}" STREQUAL "SKIP_LINK")
|
if(NOT "${ARGN}" STREQUAL "SKIP_LINK")
|
||||||
target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULE_${the_module}_DEPS_EXT} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN})
|
target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULE_${the_module}_DEPS_EXT} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN})
|
||||||
@ -508,7 +516,8 @@ macro(ocv_create_module)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_SHARED_LIBS)
|
if((NOT DEFINED OPENCV_MODULE_TYPE AND BUILD_SHARED_LIBS)
|
||||||
|
OR (DEFINED OPENCV_MODULE_TYPE AND OPENCV_MODULE_TYPE STREQUAL SHARED))
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set_target_properties(${the_module} PROPERTIES DEFINE_SYMBOL CVAPI_EXPORTS)
|
set_target_properties(${the_module} PROPERTIES DEFINE_SYMBOL CVAPI_EXPORTS)
|
||||||
else()
|
else()
|
||||||
@ -636,7 +645,9 @@ function(ocv_add_perf_tests)
|
|||||||
set(OPENCV_PERF_${the_module}_SOURCES ${perf_srcs} ${perf_hdrs})
|
set(OPENCV_PERF_${the_module}_SOURCES ${perf_srcs} ${perf_hdrs})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(${the_target} ${OPENCV_PERF_${the_module}_SOURCES})
|
get_native_precompiled_header(${the_target} perf_precomp.hpp)
|
||||||
|
|
||||||
|
add_executable(${the_target} ${OPENCV_PERF_${the_module}_SOURCES} ${${the_target}_pch})
|
||||||
target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${perf_deps} ${OPENCV_LINKER_LIBS})
|
target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${perf_deps} ${OPENCV_LINKER_LIBS})
|
||||||
add_dependencies(opencv_perf_tests ${the_target})
|
add_dependencies(opencv_perf_tests ${the_target})
|
||||||
|
|
||||||
@ -684,7 +695,9 @@ function(ocv_add_accuracy_tests)
|
|||||||
set(OPENCV_TEST_${the_module}_SOURCES ${test_srcs} ${test_hdrs})
|
set(OPENCV_TEST_${the_module}_SOURCES ${test_srcs} ${test_hdrs})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(${the_target} ${OPENCV_TEST_${the_module}_SOURCES})
|
get_native_precompiled_header(${the_target} test_precomp.hpp)
|
||||||
|
|
||||||
|
add_executable(${the_target} ${OPENCV_TEST_${the_module}_SOURCES} ${${the_target}_pch})
|
||||||
target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${test_deps} ${OPENCV_LINKER_LIBS})
|
target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${test_deps} ${OPENCV_LINKER_LIBS})
|
||||||
add_dependencies(opencv_tests ${the_target})
|
add_dependencies(opencv_tests ${the_target})
|
||||||
|
|
||||||
|
@ -272,12 +272,9 @@ ENDMACRO(ADD_PRECOMPILED_HEADER)
|
|||||||
MACRO(GET_NATIVE_PRECOMPILED_HEADER _targetName _input)
|
MACRO(GET_NATIVE_PRECOMPILED_HEADER _targetName _input)
|
||||||
|
|
||||||
if(CMAKE_GENERATOR MATCHES "^Visual.*$")
|
if(CMAKE_GENERATOR MATCHES "^Visual.*$")
|
||||||
SET(_dummy_str "#include \"${_input}\"\n"
|
set(_dummy_str "#include \"${_input}\"\n")
|
||||||
"// This is required to suppress LNK4221. Very annoying.\n"
|
|
||||||
"void *g_${_targetName}Dummy = 0\;\n")
|
|
||||||
|
|
||||||
# Use of cxx extension for generated files (as Qt does)
|
set(${_targetName}_pch ${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch.cpp)
|
||||||
SET(${_targetName}_pch ${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch.cxx)
|
|
||||||
if(EXISTS ${${_targetName}_pch})
|
if(EXISTS ${${_targetName}_pch})
|
||||||
# Check if contents is the same, if not rewrite
|
# Check if contents is the same, if not rewrite
|
||||||
# todo
|
# todo
|
||||||
@ -337,11 +334,7 @@ ENDMACRO(ADD_NATIVE_PRECOMPILED_HEADER)
|
|||||||
|
|
||||||
macro(ocv_add_precompiled_header_to_target the_target pch_header)
|
macro(ocv_add_precompiled_header_to_target the_target pch_header)
|
||||||
if(PCHSupport_FOUND AND ENABLE_PRECOMPILED_HEADERS AND EXISTS "${pch_header}")
|
if(PCHSupport_FOUND AND ENABLE_PRECOMPILED_HEADERS AND EXISTS "${pch_header}")
|
||||||
if(CMAKE_GENERATOR MATCHES Visual)
|
if(CMAKE_GENERATOR MATCHES "^Visual" OR CMAKE_GENERATOR MATCHES Xcode)
|
||||||
string(REGEX REPLACE "hpp$" "cpp" ${the_target}_pch "${pch_header}")
|
|
||||||
add_native_precompiled_header(${the_target} ${pch_header})
|
|
||||||
unset(${the_target}_pch)
|
|
||||||
elseif(CMAKE_GENERATOR MATCHES Xcode)
|
|
||||||
add_native_precompiled_header(${the_target} ${pch_header})
|
add_native_precompiled_header(${the_target} ${pch_header})
|
||||||
elseif(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_GENERATOR MATCHES "Makefiles|Ninja")
|
elseif(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_GENERATOR MATCHES "Makefiles|Ninja")
|
||||||
add_precompiled_header(${the_target} ${pch_header})
|
add_precompiled_header(${the_target} ${pch_header})
|
||||||
|
@ -77,7 +77,7 @@ MACRO(ocv_check_compiler_flag LANG FLAG RESULT)
|
|||||||
if(_fname)
|
if(_fname)
|
||||||
MESSAGE(STATUS "Performing Test ${RESULT}")
|
MESSAGE(STATUS "Performing Test ${RESULT}")
|
||||||
TRY_COMPILE(${RESULT}
|
TRY_COMPILE(${RESULT}
|
||||||
${CMAKE_BINARY_DIR}
|
"${CMAKE_BINARY_DIR}"
|
||||||
"${_fname}"
|
"${_fname}"
|
||||||
COMPILE_DEFINITIONS "${FLAG}"
|
COMPILE_DEFINITIONS "${FLAG}"
|
||||||
OUTPUT_VARIABLE OUTPUT)
|
OUTPUT_VARIABLE OUTPUT)
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
CreateWindow(NULL /*lpClassName*/, NULL /*lpWindowName*/, 0 /*dwStyle*/, 0 /*x*/,
|
CreateWindow(NULL /*lpClassName*/, NULL /*lpWindowName*/, 0 /*dwStyle*/, 0 /*x*/,
|
||||||
0 /*y*/, 0 /*nWidth*/, 0 /*nHeight*/, NULL /*hWndParent*/, NULL /*hMenu*/,
|
0 /*y*/, 0 /*nWidth*/, 0 /*nHeight*/, NULL /*hWndParent*/, NULL /*hMenu*/,
|
||||||
NULL /*hInstance*/, NULL /*lpParam*/);
|
NULL /*hInstance*/, NULL /*lpParam*/);
|
||||||
DeleteDC(NULL);
|
DeleteDC(NULL);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
6
cmake/checks/winrttest.cpp
Normal file
6
cmake/checks/winrttest.cpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include <wrl/client.h>
|
||||||
|
|
||||||
|
int main(int, char**)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
@ -23,5 +23,3 @@ FOREACH(file ${files})
|
|||||||
MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
|
MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
|
||||||
ENDIF(EXISTS "$ENV{DESTDIR}${file}")
|
ENDIF(EXISTS "$ENV{DESTDIR}${file}")
|
||||||
ENDFOREACH(file)
|
ENDFOREACH(file)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
|
/* OpenCV compiled as static or dynamic libs */
|
||||||
systems. This function is required for `alloca.c' support on those systems.
|
#cmakedefine BUILD_SHARED_LIBS
|
||||||
*/
|
|
||||||
#cmakedefine CRAY_STACKSEG_END
|
|
||||||
|
|
||||||
/* Define to 1 if using `alloca.c'. */
|
/* Compile for 'real' NVIDIA GPU architectures */
|
||||||
#cmakedefine C_ALLOCA
|
#define CUDA_ARCH_BIN "${OPENCV_CUDA_ARCH_BIN}"
|
||||||
|
|
||||||
/* Define to 1 if you have `alloca', as a function or macro. */
|
/* Create PTX or BIN for 1.0 compute capability */
|
||||||
#cmakedefine HAVE_ALLOCA 1
|
#cmakedefine CUDA_ARCH_BIN_OR_PTX_10
|
||||||
|
|
||||||
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
|
/* NVIDIA GPU features are used */
|
||||||
*/
|
#define CUDA_ARCH_FEATURES "${OPENCV_CUDA_ARCH_FEATURES}"
|
||||||
#cmakedefine HAVE_ALLOCA_H 1
|
|
||||||
|
|
||||||
/* Video for Windows support */
|
/* Compile for 'virtual' NVIDIA PTX architectures */
|
||||||
#cmakedefine HAVE_VFW
|
#define CUDA_ARCH_PTX "${OPENCV_CUDA_ARCH_PTX}"
|
||||||
|
|
||||||
|
/* AVFoundation video libraries */
|
||||||
|
#cmakedefine HAVE_AVFOUNDATION
|
||||||
|
|
||||||
/* V4L capturing support */
|
/* V4L capturing support */
|
||||||
#cmakedefine HAVE_CAMV4L
|
#cmakedefine HAVE_CAMV4L
|
||||||
@ -22,15 +22,30 @@
|
|||||||
/* V4L2 capturing support */
|
/* V4L2 capturing support */
|
||||||
#cmakedefine HAVE_CAMV4L2
|
#cmakedefine HAVE_CAMV4L2
|
||||||
|
|
||||||
/* V4L2 capturing support in videoio.h */
|
|
||||||
#cmakedefine HAVE_VIDEOIO
|
|
||||||
|
|
||||||
/* V4L/V4L2 capturing support via libv4l */
|
|
||||||
#cmakedefine HAVE_LIBV4L
|
|
||||||
|
|
||||||
/* Carbon windowing environment */
|
/* Carbon windowing environment */
|
||||||
#cmakedefine HAVE_CARBON
|
#cmakedefine HAVE_CARBON
|
||||||
|
|
||||||
|
/* AMD's Basic Linear Algebra Subprograms Library*/
|
||||||
|
#cmakedefine HAVE_CLAMDBLAS
|
||||||
|
|
||||||
|
/* AMD's OpenCL Fast Fourier Transform Library*/
|
||||||
|
#cmakedefine HAVE_CLAMDFFT
|
||||||
|
|
||||||
|
/* Cocoa API */
|
||||||
|
#cmakedefine HAVE_COCOA
|
||||||
|
|
||||||
|
/* C= */
|
||||||
|
#cmakedefine HAVE_CSTRIPES
|
||||||
|
|
||||||
|
/* NVidia Cuda Basic Linear Algebra Subprograms (BLAS) API*/
|
||||||
|
#cmakedefine HAVE_CUBLAS
|
||||||
|
|
||||||
|
/* NVidia Cuda Runtime API*/
|
||||||
|
#cmakedefine HAVE_CUDA
|
||||||
|
|
||||||
|
/* NVidia Cuda Fast Fourier Transform (FFT) API*/
|
||||||
|
#cmakedefine HAVE_CUFFT
|
||||||
|
|
||||||
/* IEEE1394 capturing support */
|
/* IEEE1394 capturing support */
|
||||||
#cmakedefine HAVE_DC1394
|
#cmakedefine HAVE_DC1394
|
||||||
|
|
||||||
@ -40,197 +55,111 @@
|
|||||||
/* IEEE1394 capturing support - libdc1394 v2.x */
|
/* IEEE1394 capturing support - libdc1394 v2.x */
|
||||||
#cmakedefine HAVE_DC1394_2
|
#cmakedefine HAVE_DC1394_2
|
||||||
|
|
||||||
|
/* DirectShow Video Capture library */
|
||||||
|
#cmakedefine HAVE_DSHOW
|
||||||
|
|
||||||
|
/* Eigen Matrix & Linear Algebra Library */
|
||||||
|
#cmakedefine HAVE_EIGEN
|
||||||
|
|
||||||
|
/* FFMpeg video library */
|
||||||
|
#cmakedefine HAVE_FFMPEG
|
||||||
|
|
||||||
|
/* ffmpeg's libswscale */
|
||||||
|
#cmakedefine HAVE_FFMPEG_SWSCALE
|
||||||
|
|
||||||
/* ffmpeg in Gentoo */
|
/* ffmpeg in Gentoo */
|
||||||
#cmakedefine HAVE_GENTOO_FFMPEG
|
#cmakedefine HAVE_GENTOO_FFMPEG
|
||||||
|
|
||||||
/* FFMpeg video library */
|
|
||||||
#cmakedefine HAVE_FFMPEG
|
|
||||||
|
|
||||||
/* FFMpeg version flag */
|
|
||||||
#cmakedefine NEW_FFMPEG
|
|
||||||
|
|
||||||
/* ffmpeg's libswscale */
|
|
||||||
#cmakedefine HAVE_FFMPEG_SWSCALE
|
|
||||||
|
|
||||||
/* GStreamer multimedia framework */
|
/* GStreamer multimedia framework */
|
||||||
#cmakedefine HAVE_GSTREAMER
|
#cmakedefine HAVE_GSTREAMER
|
||||||
|
|
||||||
/* GTK+ 2.0 Thread support */
|
/* GTK+ 2.0 Thread support */
|
||||||
#cmakedefine HAVE_GTHREAD
|
#cmakedefine HAVE_GTHREAD
|
||||||
|
|
||||||
|
/* Windows Runtime support */
|
||||||
|
#cmakedefine HAVE_WINRT
|
||||||
|
|
||||||
/* Win32 UI */
|
/* Win32 UI */
|
||||||
#cmakedefine HAVE_WIN32UI
|
#cmakedefine HAVE_WIN32UI
|
||||||
|
|
||||||
/* GTK+ 2.x toolkit */
|
/* GTK+ 2.x toolkit */
|
||||||
#cmakedefine HAVE_GTK
|
#cmakedefine HAVE_GTK
|
||||||
|
|
||||||
/* OpenEXR codec */
|
|
||||||
#cmakedefine HAVE_ILMIMF
|
|
||||||
|
|
||||||
/* Apple ImageIO Framework */
|
/* Apple ImageIO Framework */
|
||||||
#cmakedefine HAVE_IMAGEIO
|
#cmakedefine HAVE_IMAGEIO
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
|
||||||
#cmakedefine HAVE_INTTYPES_H 1
|
|
||||||
|
|
||||||
/* JPEG-2000 codec */
|
|
||||||
#cmakedefine HAVE_JASPER
|
|
||||||
|
|
||||||
/* IJG JPEG codec */
|
|
||||||
#cmakedefine HAVE_JPEG
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `dl' library (-ldl). */
|
|
||||||
#cmakedefine HAVE_LIBDL 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `gomp' library (-lgomp). */
|
|
||||||
#cmakedefine HAVE_LIBGOMP 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `m' library (-lm). */
|
|
||||||
#cmakedefine HAVE_LIBM 1
|
|
||||||
|
|
||||||
/* libpng/png.h needs to be included */
|
|
||||||
#cmakedefine HAVE_LIBPNG_PNG_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
|
||||||
#cmakedefine HAVE_LIBPTHREAD 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `lrint' function. */
|
|
||||||
#cmakedefine HAVE_LRINT 1
|
|
||||||
|
|
||||||
/* PNG codec */
|
|
||||||
#cmakedefine HAVE_PNG
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `png_get_valid' function. */
|
|
||||||
#cmakedefine HAVE_PNG_GET_VALID 1
|
|
||||||
|
|
||||||
/* png.h needs to be included */
|
|
||||||
#cmakedefine HAVE_PNG_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `png_set_tRNS_to_alpha' function. */
|
|
||||||
#cmakedefine HAVE_PNG_SET_TRNS_TO_ALPHA 1
|
|
||||||
|
|
||||||
/* QuickTime video libraries */
|
|
||||||
#cmakedefine HAVE_QUICKTIME
|
|
||||||
|
|
||||||
/* AVFoundation video libraries */
|
|
||||||
#cmakedefine HAVE_AVFOUNDATION
|
|
||||||
|
|
||||||
/* TIFF codec */
|
|
||||||
#cmakedefine HAVE_TIFF
|
|
||||||
|
|
||||||
/* Unicap video capture library */
|
|
||||||
#cmakedefine HAVE_UNICAP
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
|
||||||
#cmakedefine HAVE_UNISTD_H 1
|
|
||||||
|
|
||||||
/* Xine video library */
|
|
||||||
#cmakedefine HAVE_XINE
|
|
||||||
|
|
||||||
/* OpenNI library */
|
|
||||||
#cmakedefine HAVE_OPENNI
|
|
||||||
|
|
||||||
/* LZ77 compression/decompression library (used for PNG) */
|
|
||||||
#cmakedefine HAVE_ZLIB
|
|
||||||
|
|
||||||
/* Intel Integrated Performance Primitives */
|
/* Intel Integrated Performance Primitives */
|
||||||
#cmakedefine HAVE_IPP
|
#cmakedefine HAVE_IPP
|
||||||
|
|
||||||
/* OpenCV compiled as static or dynamic libs */
|
/* JPEG-2000 codec */
|
||||||
#cmakedefine BUILD_SHARED_LIBS
|
#cmakedefine HAVE_JASPER
|
||||||
|
|
||||||
/* Name of package */
|
/* IJG JPEG codec */
|
||||||
#define PACKAGE "${PACKAGE}"
|
#cmakedefine HAVE_JPEG
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
/* libpng/png.h needs to be included */
|
||||||
#define PACKAGE_BUGREPORT "${PACKAGE_BUGREPORT}"
|
#cmakedefine HAVE_LIBPNG_PNG_H
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
/* V4L/V4L2 capturing support via libv4l */
|
||||||
#define PACKAGE_NAME "${PACKAGE_NAME}"
|
#cmakedefine HAVE_LIBV4L
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#define PACKAGE_STRING "${PACKAGE_STRING}"
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#define PACKAGE_TARNAME "${PACKAGE_TARNAME}"
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#define PACKAGE_VERSION "${PACKAGE_VERSION}"
|
|
||||||
|
|
||||||
/* If using the C implementation of alloca, define if you know the
|
|
||||||
direction of stack growth for your system; otherwise it will be
|
|
||||||
automatically deduced at runtime.
|
|
||||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
|
||||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
|
||||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
|
||||||
#cmakedefine STACK_DIRECTION
|
|
||||||
|
|
||||||
/* Version number of package */
|
|
||||||
#define VERSION "${PACKAGE_VERSION}"
|
|
||||||
|
|
||||||
/* Define to 1 if your processor stores words with the most significant byte
|
|
||||||
first (like Motorola and SPARC, unlike Intel and VAX). */
|
|
||||||
#cmakedefine WORDS_BIGENDIAN
|
|
||||||
|
|
||||||
/* Intel Threading Building Blocks */
|
|
||||||
#cmakedefine HAVE_TBB
|
|
||||||
|
|
||||||
/* C= */
|
|
||||||
#cmakedefine HAVE_CSTRIPES
|
|
||||||
|
|
||||||
/* Eigen Matrix & Linear Algebra Library */
|
|
||||||
#cmakedefine HAVE_EIGEN
|
|
||||||
|
|
||||||
/* NVidia Cuda Runtime API*/
|
|
||||||
#cmakedefine HAVE_CUDA
|
|
||||||
|
|
||||||
/* NVidia Cuda Fast Fourier Transform (FFT) API*/
|
|
||||||
#cmakedefine HAVE_CUFFT
|
|
||||||
|
|
||||||
/* NVidia Cuda Basic Linear Algebra Subprograms (BLAS) API*/
|
|
||||||
#cmakedefine HAVE_CUBLAS
|
|
||||||
|
|
||||||
/* NVidia Video Decoding API*/
|
|
||||||
#cmakedefine HAVE_NVCUVID
|
|
||||||
|
|
||||||
/* Compile for 'real' NVIDIA GPU architectures */
|
|
||||||
#define CUDA_ARCH_BIN "${OPENCV_CUDA_ARCH_BIN}"
|
|
||||||
|
|
||||||
/* Compile for 'virtual' NVIDIA PTX architectures */
|
|
||||||
#define CUDA_ARCH_PTX "${OPENCV_CUDA_ARCH_PTX}"
|
|
||||||
|
|
||||||
/* NVIDIA GPU features are used */
|
|
||||||
#define CUDA_ARCH_FEATURES "${OPENCV_CUDA_ARCH_FEATURES}"
|
|
||||||
|
|
||||||
/* Create PTX or BIN for 1.0 compute capability */
|
|
||||||
#cmakedefine CUDA_ARCH_BIN_OR_PTX_10
|
|
||||||
|
|
||||||
/* OpenCL Support */
|
|
||||||
#cmakedefine HAVE_OPENCL
|
|
||||||
|
|
||||||
/* AMD's OpenCL Fast Fourier Transform Library*/
|
|
||||||
#cmakedefine HAVE_CLAMDFFT
|
|
||||||
|
|
||||||
/* AMD's Basic Linear Algebra Subprograms Library*/
|
|
||||||
#cmakedefine HAVE_CLAMDBLAS
|
|
||||||
|
|
||||||
/* DirectShow Video Capture library */
|
|
||||||
#cmakedefine HAVE_DSHOW
|
|
||||||
|
|
||||||
/* Microsoft Media Foundation Capture library */
|
/* Microsoft Media Foundation Capture library */
|
||||||
#cmakedefine HAVE_MSMF
|
#cmakedefine HAVE_MSMF
|
||||||
|
|
||||||
/* XIMEA camera support */
|
/* NVidia Video Decoding API*/
|
||||||
#cmakedefine HAVE_XIMEA
|
#cmakedefine HAVE_NVCUVID
|
||||||
|
|
||||||
|
/* OpenCL Support */
|
||||||
|
#cmakedefine HAVE_OPENCL
|
||||||
|
|
||||||
|
/* OpenEXR codec */
|
||||||
|
#cmakedefine HAVE_OPENEXR
|
||||||
|
|
||||||
/* OpenGL support*/
|
/* OpenGL support*/
|
||||||
#cmakedefine HAVE_OPENGL
|
#cmakedefine HAVE_OPENGL
|
||||||
|
|
||||||
/* Clp support */
|
/* OpenNI library */
|
||||||
#cmakedefine HAVE_CLP
|
#cmakedefine HAVE_OPENNI
|
||||||
|
|
||||||
|
/* PNG codec */
|
||||||
|
#cmakedefine HAVE_PNG
|
||||||
|
|
||||||
/* Qt support */
|
/* Qt support */
|
||||||
#cmakedefine HAVE_QT
|
#cmakedefine HAVE_QT
|
||||||
|
|
||||||
/* Qt OpenGL support */
|
/* Qt OpenGL support */
|
||||||
#cmakedefine HAVE_QT_OPENGL
|
#cmakedefine HAVE_QT_OPENGL
|
||||||
|
|
||||||
|
/* QuickTime video libraries */
|
||||||
|
#cmakedefine HAVE_QUICKTIME
|
||||||
|
|
||||||
|
/* QTKit video libraries */
|
||||||
|
#cmakedefine HAVE_QTKIT
|
||||||
|
|
||||||
|
/* Intel Threading Building Blocks */
|
||||||
|
#cmakedefine HAVE_TBB
|
||||||
|
|
||||||
|
/* TIFF codec */
|
||||||
|
#cmakedefine HAVE_TIFF
|
||||||
|
|
||||||
|
/* Unicap video capture library */
|
||||||
|
#cmakedefine HAVE_UNICAP
|
||||||
|
|
||||||
|
/* Video for Windows support */
|
||||||
|
#cmakedefine HAVE_VFW
|
||||||
|
|
||||||
|
/* V4L2 capturing support in videoio.h */
|
||||||
|
#cmakedefine HAVE_VIDEOIO
|
||||||
|
|
||||||
|
/* Win32 UI */
|
||||||
|
#cmakedefine HAVE_WIN32UI
|
||||||
|
|
||||||
|
/* XIMEA camera support */
|
||||||
|
#cmakedefine HAVE_XIMEA
|
||||||
|
|
||||||
|
/* Xine video library */
|
||||||
|
#cmakedefine HAVE_XINE
|
||||||
|
|
||||||
|
/* Define to 1 if your processor stores words with the most significant byte
|
||||||
|
first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||||
|
#cmakedefine WORDS_BIGENDIAN
|
||||||
|
@ -8,6 +8,6 @@ includedir_new=@includedir@
|
|||||||
|
|
||||||
Name: OpenCV
|
Name: OpenCV
|
||||||
Description: Open Source Computer Vision Library
|
Description: Open Source Computer Vision Library
|
||||||
Version: @VERSION@
|
Version: @OPENCV_VERSION@
|
||||||
Libs: @OpenCV_LIB_COMPONENTS@
|
Libs: @OpenCV_LIB_COMPONENTS@
|
||||||
Cflags: -I${includedir_old} -I${includedir_new}
|
Cflags: -I${includedir_old} -I${includedir_new}
|
||||||
|
@ -49,7 +49,7 @@ if(BUILD_DOCS AND HAVE_SPHINX)
|
|||||||
set(toc_file "${OPENCV_MODULE_opencv_${mod}_LOCATION}/doc/${mod}.rst")
|
set(toc_file "${OPENCV_MODULE_opencv_${mod}_LOCATION}/doc/${mod}.rst")
|
||||||
if(EXISTS "${toc_file}")
|
if(EXISTS "${toc_file}")
|
||||||
file(RELATIVE_PATH toc_file "${OpenCV_SOURCE_DIR}/modules" "${toc_file}")
|
file(RELATIVE_PATH toc_file "${OpenCV_SOURCE_DIR}/modules" "${toc_file}")
|
||||||
set(OPENCV_REFMAN_TOC "${OPENCV_REFMAN_TOC} ${toc_file}\r\n")
|
set(OPENCV_REFMAN_TOC "${OPENCV_REFMAN_TOC} ${toc_file}\n")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
1
doc/_static/insertIframe.js
vendored
1
doc/_static/insertIframe.js
vendored
@ -10,4 +10,3 @@ function insertIframe (elementId, iframeSrc)
|
|||||||
element.parentNode.replaceChild(iframe, element);
|
element.parentNode.replaceChild(iframe, element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,5 +184,3 @@ p = RSTParser()
|
|||||||
for m in opencv_module_list:
|
for m in opencv_module_list:
|
||||||
print "\n\n*************************** " + m + " *************************\n"
|
print "\n\n*************************** " + m + " *************************\n"
|
||||||
p.check_module_docs(m)
|
p.check_module_docs(m)
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,4 +39,3 @@
|
|||||||
#7 & #8 & #9
|
#7 & #8 & #9
|
||||||
\end{bmatrix}
|
\end{bmatrix}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,11 +75,11 @@
|
|||||||
% if using A4 paper. (This probably isn't strictly necessary.)
|
% if using A4 paper. (This probably isn't strictly necessary.)
|
||||||
% If using another size paper, use default 1cm margins.
|
% If using another size paper, use default 1cm margins.
|
||||||
\ifthenelse{\lengthtest { \paperwidth = 11in}}
|
\ifthenelse{\lengthtest { \paperwidth = 11in}}
|
||||||
{ \geometry{top=.5in,left=.5in,right=.5in,bottom=.5in} }
|
{ \geometry{top=.5in,left=.5in,right=.5in,bottom=.5in} }
|
||||||
{\ifthenelse{ \lengthtest{ \paperwidth = 297mm}}
|
{\ifthenelse{ \lengthtest{ \paperwidth = 297mm}}
|
||||||
{\geometry{top=1cm,left=1cm,right=1cm,bottom=1cm} }
|
{\geometry{top=1cm,left=1cm,right=1cm,bottom=1cm} }
|
||||||
{\geometry{top=1cm,left=1cm,right=1cm,bottom=1cm} }
|
{\geometry{top=1cm,left=1cm,right=1cm,bottom=1cm} }
|
||||||
}
|
}
|
||||||
|
|
||||||
% Turn off header and footer
|
% Turn off header and footer
|
||||||
% \pagestyle{empty}
|
% \pagestyle{empty}
|
||||||
|
@ -3667,4 +3667,3 @@ class YErrorBars:
|
|||||||
output.append(LineAxis(x, start, x, end, start, end, bars, False, False, **self.attr).SVG(trans))
|
output.append(LineAxis(x, start, x, end, start, end, bars, False, False, **self.attr).SVG(trans))
|
||||||
|
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
@ -3,42 +3,42 @@
|
|||||||
Camera calibration With OpenCV
|
Camera calibration With OpenCV
|
||||||
******************************
|
******************************
|
||||||
|
|
||||||
Cameras have been around for a long-long time. However, with the introduction of the cheap *pinhole* cameras in the late 20th century, they became a common occurrence in our everyday life. Unfortunately, this cheapness comes with its price: significant distortion. Luckily, these are constants and with a calibration and some remapping we can correct this. Furthermore, with calibration you may also determinate the relation between the camera's natural units (pixels) and the real world units (for example millimeters).
|
Cameras have been around for a long-long time. However, with the introduction of the cheap *pinhole* cameras in the late 20th century, they became a common occurrence in our everyday life. Unfortunately, this cheapness comes with its price: significant distortion. Luckily, these are constants and with a calibration and some remapping we can correct this. Furthermore, with calibration you may also determine the relation between the camera's natural units (pixels) and the real world units (for example millimeters).
|
||||||
|
|
||||||
Theory
|
Theory
|
||||||
======
|
======
|
||||||
|
|
||||||
For the distortion OpenCV takes into account the radial and tangential factors. For the radial one uses the following formula:
|
For the distortion OpenCV takes into account the radial and tangential factors. For the radial factor one uses the following formula:
|
||||||
|
|
||||||
.. math::
|
.. math::
|
||||||
|
|
||||||
x_{corrected} = x( 1 + k_1 r^2 + k_2 r^4 + k_3 r^6) \\
|
x_{corrected} = x( 1 + k_1 r^2 + k_2 r^4 + k_3 r^6) \\
|
||||||
y_{corrected} = y( 1 + k_1 r^2 + k_2 r^4 + k_3 r^6)
|
y_{corrected} = y( 1 + k_1 r^2 + k_2 r^4 + k_3 r^6)
|
||||||
|
|
||||||
So for an old pixel point at :math:`(x,y)` coordinate in the input image, for a corrected output image its position will be :math:`(x_{corrected} y_{corrected})` . The presence of the radial distortion manifests in form of the "barrel" or "fish-eye" effect.
|
So for an old pixel point at :math:`(x,y)` coordinates in the input image, its position on the corrected output image will be :math:`(x_{corrected} y_{corrected})`. The presence of the radial distortion manifests in form of the "barrel" or "fish-eye" effect.
|
||||||
|
|
||||||
Tangential distortion occurs because the image taking lenses are not perfectly parallel to the imaging plane. Correcting this is made via the formulas:
|
Tangential distortion occurs because the image taking lenses are not perfectly parallel to the imaging plane. It can be corrected via the formulas:
|
||||||
|
|
||||||
.. math::
|
.. math::
|
||||||
|
|
||||||
x_{corrected} = x + [ 2p_1xy + p_2(r^2+2x^2)] \\
|
x_{corrected} = x + [ 2p_1xy + p_2(r^2+2x^2)] \\
|
||||||
y_{corrected} = y + [ p_1(r^2+ 2y^2)+ 2p_2xy]
|
y_{corrected} = y + [ p_1(r^2+ 2y^2)+ 2p_2xy]
|
||||||
|
|
||||||
So we have five distortion parameters, which in OpenCV are organized in a 5 column one row matrix:
|
So we have five distortion parameters which in OpenCV are presented as one row matrix with 5 columns:
|
||||||
|
|
||||||
.. math::
|
.. math::
|
||||||
|
|
||||||
Distortion_{coefficients}=(k_1 \hspace{10pt} k_2 \hspace{10pt} p_1 \hspace{10pt} p_2 \hspace{10pt} k_3)
|
Distortion_{coefficients}=(k_1 \hspace{10pt} k_2 \hspace{10pt} p_1 \hspace{10pt} p_2 \hspace{10pt} k_3)
|
||||||
|
|
||||||
Now for the unit conversion, we use the following formula:
|
Now for the unit conversion we use the following formula:
|
||||||
|
|
||||||
.. math::
|
.. math::
|
||||||
|
|
||||||
\left [ \begin{matrix} x \\ y \\ w \end{matrix} \right ] = \left [ \begin{matrix} f_x & 0 & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1 \end{matrix} \right ] \left [ \begin{matrix} X \\ Y \\ Z \end{matrix} \right ]
|
\left [ \begin{matrix} x \\ y \\ w \end{matrix} \right ] = \left [ \begin{matrix} f_x & 0 & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1 \end{matrix} \right ] \left [ \begin{matrix} X \\ Y \\ Z \end{matrix} \right ]
|
||||||
|
|
||||||
Here the presence of the :math:`w` is cause we use a homography coordinate system (and :math:`w=Z`). The unknown parameters are :math:`f_x` and :math:`f_y` (camera focal lengths) and :math:`(c_x, c_y)` what are the optical centers expressed in pixels coordinates. If for both axes a common focal length is used with a given :math:`a` aspect ratio (usually 1), then :math:`f_y=f_x*a` and in the upper formula we will have a single :math:`f` focal length. The matrix containing these four parameters is referred to as the *camera matrix*. While the distortion coefficients are the same regardless of the camera resolutions used, these should be scaled along with the current resolution from the calibrated resolution.
|
Here the presence of :math:`w` is explained by the use of homography coordinate system (and :math:`w=Z`). The unknown parameters are :math:`f_x` and :math:`f_y` (camera focal lengths) and :math:`(c_x, c_y)` which are the optical centers expressed in pixels coordinates. If for both axes a common focal length is used with a given :math:`a` aspect ratio (usually 1), then :math:`f_y=f_x*a` and in the upper formula we will have a single focal length :math:`f`. The matrix containing these four parameters is referred to as the *camera matrix*. While the distortion coefficients are the same regardless of the camera resolutions used, these should be scaled along with the current resolution from the calibrated resolution.
|
||||||
|
|
||||||
The process of determining these two matrices is the calibration. Calculating these parameters is done by some basic geometrical equations. The equations used depend on the calibrating objects used. Currently OpenCV supports three types of object for calibration:
|
The process of determining these two matrices is the calibration. Calculation of these parameters is done through basic geometrical equations. The equations used depend on the chosen calibrating objects. Currently OpenCV supports three types of objects for calibration:
|
||||||
|
|
||||||
.. container:: enumeratevisibleitemswithsquare
|
.. container:: enumeratevisibleitemswithsquare
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ The process of determining these two matrices is the calibration. Calculating th
|
|||||||
+ Symmetrical circle pattern
|
+ Symmetrical circle pattern
|
||||||
+ Asymmetrical circle pattern
|
+ Asymmetrical circle pattern
|
||||||
|
|
||||||
Basically, you need to take snapshots of these patterns with your camera and let OpenCV find them. Each found pattern equals in a new equation. To solve the equation you need at least a predetermined number of pattern snapshots to form a well-posed equation system. This number is higher for the chessboard pattern and less for the circle ones. For example, in theory the chessboard one requires at least two. However, in practice we have a good amount of noise present in our input images, so for good results you will probably want at least 10 good snapshots of the input pattern in different position.
|
Basically, you need to take snapshots of these patterns with your camera and let OpenCV find them. Each found pattern results in a new equation. To solve the equation you need at least a predetermined number of pattern snapshots to form a well-posed equation system. This number is higher for the chessboard pattern and less for the circle ones. For example, in theory the chessboard pattern requires at least two snapshots. However, in practice we have a good amount of noise present in our input images, so for good results you will probably need at least 10 good snapshots of the input pattern in different positions.
|
||||||
|
|
||||||
Goal
|
Goal
|
||||||
====
|
====
|
||||||
@ -55,19 +55,19 @@ The sample application will:
|
|||||||
|
|
||||||
.. container:: enumeratevisibleitemswithsquare
|
.. container:: enumeratevisibleitemswithsquare
|
||||||
|
|
||||||
+ Determinate the distortion matrix
|
+ Determine the distortion matrix
|
||||||
+ Determinate the camera matrix
|
+ Determine the camera matrix
|
||||||
+ Input from Camera, Video and Image file list
|
+ Take input from Camera, Video and Image file list
|
||||||
+ Configuration from XML/YAML file
|
+ Read configuration from XML/YAML file
|
||||||
+ Save the results into XML/YAML file
|
+ Save the results into XML/YAML file
|
||||||
+ Calculate re-projection error
|
+ Calculate re-projection error
|
||||||
|
|
||||||
Source code
|
Source code
|
||||||
===========
|
===========
|
||||||
|
|
||||||
You may also find the source code in the :file:`samples/cpp/tutorial_code/calib3d/camera_calibration/` folder of the OpenCV source library or :download:`download it from here <../../../../samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp>`. The program has a single argument. The name of its configuration file. If none given it will try to open the one named "default.xml". :download:`Here's a sample configuration file <../../../../samples/cpp/tutorial_code/calib3d/camera_calibration/in_VID5.xml>` in XML format. In the configuration file you may choose to use as input a camera, a video file or an image list. If you opt for the later one, you need to create a configuration file where you enumerate the images to use. Here's :download:`an example of this <../../../../samples/cpp/tutorial_code/calib3d/camera_calibration/VID5.xml>`. The important part to remember is that the images needs to be specified using the absolute path or the relative one from your applications working directory. You may find all this in the beforehand mentioned directory.
|
You may also find the source code in the :file:`samples/cpp/tutorial_code/calib3d/camera_calibration/` folder of the OpenCV source library or :download:`download it from here <../../../../samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp>`. The program has a single argument: the name of its configuration file. If none is given then it will try to open the one named "default.xml". :download:`Here's a sample configuration file <../../../../samples/cpp/tutorial_code/calib3d/camera_calibration/in_VID5.xml>` in XML format. In the configuration file you may choose to use camera as an input, a video file or an image list. If you opt for the last one, you will need to create a configuration file where you enumerate the images to use. Here's :download:`an example of this <../../../../samples/cpp/tutorial_code/calib3d/camera_calibration/VID5.xml>`. The important part to remember is that the images need to be specified using the absolute path or the relative one from your application's working directory. You may find all this in the samples directory mentioned above.
|
||||||
|
|
||||||
The application starts up with reading the settings from the configuration file. Although, this is an important part of it, it has nothing to do with the subject of this tutorial: *camera calibration*. Therefore, I've chosen to do not post here the code part for that. The technical background on how to do this you can find in the :ref:`fileInputOutputXMLYAML` tutorial.
|
The application starts up with reading the settings from the configuration file. Although, this is an important part of it, it has nothing to do with the subject of this tutorial: *camera calibration*. Therefore, I've chosen not to post the code for that part here. Technical background on how to do this you can find in the :ref:`fileInputOutputXMLYAML` tutorial.
|
||||||
|
|
||||||
Explanation
|
Explanation
|
||||||
===========
|
===========
|
||||||
@ -93,9 +93,9 @@ Explanation
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
For this I've used simple OpenCV class input operation. After reading the file I've an additional post-process function that checks for the validity of the input. Only if all of them are good will be the *goodInput* variable true.
|
For this I've used simple OpenCV class input operation. After reading the file I've an additional post-processing function that checks validity of the input. Only if all inputs are good then *goodInput* variable will be true.
|
||||||
|
|
||||||
#. **Get next input, if it fails or we have enough of them calibrate**. After this we have a big loop where we do the following operations: get the next image from the image list, camera or video file. If this fails or we have enough images we run the calibration process. In case of image we step out of the loop and otherwise the remaining frames will be undistorted (if the option is set) via changing from *DETECTION* mode to *CALIBRATED* one.
|
#. **Get next input, if it fails or we have enough of them - calibrate**. After this we have a big loop where we do the following operations: get the next image from the image list, camera or video file. If this fails or we have enough images then we run the calibration process. In case of image we step out of the loop and otherwise the remaining frames will be undistorted (if the option is set) via changing from *DETECTION* mode to the *CALIBRATED* one.
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ Explanation
|
|||||||
|
|
||||||
For some cameras we may need to flip the input image. Here we do this too.
|
For some cameras we may need to flip the input image. Here we do this too.
|
||||||
|
|
||||||
#. **Find the pattern in the current input**. The formation of the equations I mentioned above consists of finding the major patterns in the input: in case of the chessboard this is their corners of the squares and for the circles, well, the circles itself. The position of these will form the result and is collected into the *pointBuf* vector.
|
#. **Find the pattern in the current input**. The formation of the equations I mentioned above aims to finding major patterns in the input: in case of the chessboard this are corners of the squares and for the circles, well, the circles themselves. The position of these will form the result which will be written into the *pointBuf* vector.
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
@ -146,9 +146,9 @@ Explanation
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Depending on the type of the input pattern you use either the :calib3d:`findChessboardCorners <findchessboardcorners>` or the :calib3d:`findCirclesGrid <findcirclesgrid>` function. For both of them you pass on the current image, the size of the board and you'll get back the positions of the patterns. Furthermore, they return a boolean variable that states if in the input we could find or not the pattern (we only need to take into account images where this is true!).
|
Depending on the type of the input pattern you use either the :calib3d:`findChessboardCorners <findchessboardcorners>` or the :calib3d:`findCirclesGrid <findcirclesgrid>` function. For both of them you pass the current image and the size of the board and you'll get the positions of the patterns. Furthermore, they return a boolean variable which states if the pattern was found in the input (we only need to take into account those images where this is true!).
|
||||||
|
|
||||||
Then again in case of cameras we only take camera images after an input delay time passed. This is in order to allow for the user to move the chessboard around and as getting different images. Same images mean same equations, and same equations at the calibration will form an ill-posed problem, so the calibration will fail. For square images the position of the corners are only approximate. We may improve this by calling the :feature2d:`cornerSubPix <cornersubpix>` function. This way will get a better calibration result. After this we add a valid inputs result to the *imagePoints* vector to collect all of the equations into a single container. Finally, for visualization feedback purposes we will draw the found points on the input image with the :calib3d:`findChessboardCorners <drawchessboardcorners>` function.
|
Then again in case of cameras we only take camera images when an input delay time is passed. This is done in order to allow user moving the chessboard around and getting different images. Similar images result in similar equations, and similar equations at the calibration step will form an ill-posed problem, so the calibration will fail. For square images the positions of the corners are only approximate. We may improve this by calling the :feature2d:`cornerSubPix <cornersubpix>` function. It will produce better calibration result. After this we add a valid inputs result to the *imagePoints* vector to collect all of the equations into a single container. Finally, for visualization feedback purposes we will draw the found points on the input image using :calib3d:`findChessboardCorners <drawchessboardcorners>` function.
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
@ -175,7 +175,7 @@ Explanation
|
|||||||
drawChessboardCorners( view, s.boardSize, Mat(pointBuf), found );
|
drawChessboardCorners( view, s.boardSize, Mat(pointBuf), found );
|
||||||
}
|
}
|
||||||
|
|
||||||
#. **Show state and result for the user, plus command line control of the application**. The showing part consists of a text output on the live feed, and for video or camera input to show the "capturing" frame we simply bitwise negate the input image.
|
#. **Show state and result to the user, plus command line control of the application**. This part shows text output on the image.
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ Explanation
|
|||||||
if( blinkOutput )
|
if( blinkOutput )
|
||||||
bitwise_not(view, view);
|
bitwise_not(view, view);
|
||||||
|
|
||||||
If we only ran the calibration and got the camera matrix plus the distortion coefficients we may just as correct the image with the :imgproc_geometric:`undistort <undistort>` function:
|
If we ran calibration and got camera's matrix with the distortion coefficients we may want to correct the image using :imgproc_geometric:`undistort <undistort>` function:
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
@ -212,7 +212,7 @@ Explanation
|
|||||||
//------------------------------ Show image and check for input commands -------------------
|
//------------------------------ Show image and check for input commands -------------------
|
||||||
imshow("Image View", view);
|
imshow("Image View", view);
|
||||||
|
|
||||||
Then we wait for an input key and if this is *u* we toggle the distortion removal, if it is *g* we start all over the detection process (or simply start it), and finally for the *ESC* key quit the application:
|
Then we wait for an input key and if this is *u* we toggle the distortion removal, if it is *g* we start again the detection process, and finally for the *ESC* key we quit the application:
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
@ -229,7 +229,7 @@ Explanation
|
|||||||
imagePoints.clear();
|
imagePoints.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
#. **Show the distortion removal for the images too**. When you work with an image list it is not possible to remove the distortion inside the loop. Therefore, you must append this after the loop. Taking advantage of this now I'll expand the :imgproc_geometric:`undistort <undistort>` function, which is in fact first a call of the :imgproc_geometric:`initUndistortRectifyMap <initundistortrectifymap>` to find out the transformation matrices and then doing the transformation with the :imgproc_geometric:`remap <remap>` function. Because, after a successful calibration the map calculation needs to be done only once, by using this expanded form you may speed up your application:
|
#. **Show the distortion removal for the images too**. When you work with an image list it is not possible to remove the distortion inside the loop. Therefore, you must do this after the loop. Taking advantage of this now I'll expand the :imgproc_geometric:`undistort <undistort>` function, which is in fact first calls :imgproc_geometric:`initUndistortRectifyMap <initundistortrectifymap>` to find transformation matrices and then performs transformation using :imgproc_geometric:`remap <remap>` function. Because, after successful calibration map calculation needs to be done only once, by using this expanded form you may speed up your application:
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
@ -256,7 +256,7 @@ Explanation
|
|||||||
The calibration and save
|
The calibration and save
|
||||||
========================
|
========================
|
||||||
|
|
||||||
Because the calibration needs to be only once per camera it makes sense to save them after a successful calibration. This way later on you can just load these values into your program. Due to this we first make the calibration, and if it succeeds we save the result into an OpenCV style XML or YAML file, depending on the extension you give in the configuration file.
|
Because the calibration needs to be done only once per camera, it makes sense to save it after a successful calibration. This way later on you can just load these values into your program. Due to this we first make the calibration, and if it succeeds we save the result into an OpenCV style XML or YAML file, depending on the extension you give in the configuration file.
|
||||||
|
|
||||||
Therefore in the first function we just split up these two processes. Because we want to save many of the calibration variables we'll create these variables here and pass on both of them to the calibration and saving function. Again, I'll not show the saving part as that has little in common with the calibration. Explore the source file in order to find out how and what:
|
Therefore in the first function we just split up these two processes. Because we want to save many of the calibration variables we'll create these variables here and pass on both of them to the calibration and saving function. Again, I'll not show the saving part as that has little in common with the calibration. Explore the source file in order to find out how and what:
|
||||||
|
|
||||||
@ -280,7 +280,7 @@ Therefore in the first function we just split up these two processes. Because we
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
We do the calibration with the help of the :calib3d:`calibrateCamera <calibratecamera>` function. This has the following parameters:
|
We do the calibration with the help of the :calib3d:`calibrateCamera <calibratecamera>` function. It has the following parameters:
|
||||||
|
|
||||||
.. container:: enumeratevisibleitemswithsquare
|
.. container:: enumeratevisibleitemswithsquare
|
||||||
|
|
||||||
@ -318,11 +318,11 @@ We do the calibration with the help of the :calib3d:`calibrateCamera <calibratec
|
|||||||
calcBoardCornerPositions(s.boardSize, s.squareSize, objectPoints[0], s.calibrationPattern);
|
calcBoardCornerPositions(s.boardSize, s.squareSize, objectPoints[0], s.calibrationPattern);
|
||||||
objectPoints.resize(imagePoints.size(),objectPoints[0]);
|
objectPoints.resize(imagePoints.size(),objectPoints[0]);
|
||||||
|
|
||||||
+ The image points. This is a vector of *Point2f* vector that for each input image contains where the important points (corners for chessboard, and center of circles for the circle patterns) were found. We already collected this from what the :calib3d:`findChessboardCorners <findchessboardcorners>` or the :calib3d:`findCirclesGrid <findcirclesgrid>` function returned. We just need to pass it on.
|
+ The image points. This is a vector of *Point2f* vector which for each input image contains coordinates of the important points (corners for chessboard and centers of the circles for the circle pattern). We have already collected this from :calib3d:`findChessboardCorners <findchessboardcorners>` or :calib3d:`findCirclesGrid <findcirclesgrid>` function. We just need to pass it on.
|
||||||
|
|
||||||
+ The size of the image acquired from the camera, video file or the images.
|
+ The size of the image acquired from the camera, video file or the images.
|
||||||
|
|
||||||
+ The camera matrix. If we used the fix aspect ratio option we need to set the :math:`f_x` to zero:
|
+ The camera matrix. If we used the fixed aspect ratio option we need to set the :math:`f_x` to zero:
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
@ -336,16 +336,16 @@ We do the calibration with the help of the :calib3d:`calibrateCamera <calibratec
|
|||||||
|
|
||||||
distCoeffs = Mat::zeros(8, 1, CV_64F);
|
distCoeffs = Mat::zeros(8, 1, CV_64F);
|
||||||
|
|
||||||
+ The function will calculate for all the views the rotation and translation vector that transform the object points (given in the model coordinate space) to the image points (given in the world coordinate space). The 7th and 8th parameters are an output vector of matrices containing in the ith position the rotation and translation vector for the ith object point to the ith image point.
|
+ For all the views the function will calculate rotation and translation vectors which transform the object points (given in the model coordinate space) to the image points (given in the world coordinate space). The 7-th and 8-th parameters are the output vector of matrices containing in the i-th position the rotation and translation vector for the i-th object point to the i-th image point.
|
||||||
|
|
||||||
+ The final argument is a flag. You need to specify here options like fix the aspect ratio for the focal length, assume zero tangential distortion or to fix the principal point.
|
+ The final argument is the flag. You need to specify here options like fix the aspect ratio for the focal length, assume zero tangential distortion or to fix the principal point.
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
double rms = calibrateCamera(objectPoints, imagePoints, imageSize, cameraMatrix,
|
double rms = calibrateCamera(objectPoints, imagePoints, imageSize, cameraMatrix,
|
||||||
distCoeffs, rvecs, tvecs, s.flag|CV_CALIB_FIX_K4|CV_CALIB_FIX_K5);
|
distCoeffs, rvecs, tvecs, s.flag|CV_CALIB_FIX_K4|CV_CALIB_FIX_K5);
|
||||||
|
|
||||||
+ The function returns the average re-projection error. This number gives a good estimation of just how exact is the found parameters. This should be as close to zero as possible. Given the intrinsic, distortion, rotation and translation matrices we may calculate the error for one view by using the :calib3d:`projectPoints <projectpoints>` to first transform the object point to image point. Then we calculate the absolute norm between what we got with our transformation and the corner/circle finding algorithm. To find the average error we calculate the arithmetical mean of the errors calculate for all the calibration images.
|
+ The function returns the average re-projection error. This number gives a good estimation of precision of the found parameters. This should be as close to zero as possible. Given the intrinsic, distortion, rotation and translation matrices we may calculate the error for one view by using the :calib3d:`projectPoints <projectpoints>` to first transform the object point to image point. Then we calculate the absolute norm between what we got with our transformation and the corner/circle finding algorithm. To find the average error we calculate the arithmetical mean of the errors calculated for all the calibration images.
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
@ -378,25 +378,25 @@ We do the calibration with the help of the :calib3d:`calibrateCamera <calibratec
|
|||||||
Results
|
Results
|
||||||
=======
|
=======
|
||||||
|
|
||||||
Let there be :download:`this input chessboard pattern <../../../pattern.png>` that has a size of 9 X 6. I've used an AXIS IP camera to create a couple of snapshots of the board and saved it into a VID5 directory. I've put this inside the :file:`images/CameraCalibraation` folder of my working directory and created the following :file:`VID5.XML` file that describes which images to use:
|
Let there be :download:`this input chessboard pattern <../../../pattern.png>` which has a size of 9 X 6. I've used an AXIS IP camera to create a couple of snapshots of the board and saved it into VID5 directory. I've put this inside the :file:`images/CameraCalibration` folder of my working directory and created the following :file:`VID5.XML` file that describes which images to use:
|
||||||
|
|
||||||
.. code-block:: xml
|
.. code-block:: xml
|
||||||
|
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<opencv_storage>
|
<opencv_storage>
|
||||||
<images>
|
<images>
|
||||||
images/CameraCalibraation/VID5/xx1.jpg
|
images/CameraCalibration/VID5/xx1.jpg
|
||||||
images/CameraCalibraation/VID5/xx2.jpg
|
images/CameraCalibration/VID5/xx2.jpg
|
||||||
images/CameraCalibraation/VID5/xx3.jpg
|
images/CameraCalibration/VID5/xx3.jpg
|
||||||
images/CameraCalibraation/VID5/xx4.jpg
|
images/CameraCalibration/VID5/xx4.jpg
|
||||||
images/CameraCalibraation/VID5/xx5.jpg
|
images/CameraCalibration/VID5/xx5.jpg
|
||||||
images/CameraCalibraation/VID5/xx6.jpg
|
images/CameraCalibration/VID5/xx6.jpg
|
||||||
images/CameraCalibraation/VID5/xx7.jpg
|
images/CameraCalibration/VID5/xx7.jpg
|
||||||
images/CameraCalibraation/VID5/xx8.jpg
|
images/CameraCalibration/VID5/xx8.jpg
|
||||||
</images>
|
</images>
|
||||||
</opencv_storage>
|
</opencv_storage>
|
||||||
|
|
||||||
Then specified the :file:`images/CameraCalibraation/VID5/VID5.XML` as input in the configuration file. Here's a chessboard pattern found during the runtime of the application:
|
Then passed :file:`images/CameraCalibration/VID5/VID5.XML` as an input in the configuration file. Here's a chessboard pattern found during the runtime of the application:
|
||||||
|
|
||||||
.. image:: images/fileListImage.jpg
|
.. image:: images/fileListImage.jpg
|
||||||
:alt: A found chessboard
|
:alt: A found chessboard
|
||||||
@ -433,7 +433,7 @@ In both cases in the specified output XML/YAML file you'll find the camera and d
|
|||||||
-4.1802327176423804e-001 5.0715244063187526e-001 0. 0.
|
-4.1802327176423804e-001 5.0715244063187526e-001 0. 0.
|
||||||
-5.7843597214487474e-001</data></Distortion_Coefficients>
|
-5.7843597214487474e-001</data></Distortion_Coefficients>
|
||||||
|
|
||||||
Add these values as constants to your program, call the :imgproc_geometric:`initUndistortRectifyMap <initundistortrectifymap>` and the :imgproc_geometric:`remap <remap>` function to remove distortion and enjoy distortion free inputs with cheap and low quality cameras.
|
Add these values as constants to your program, call the :imgproc_geometric:`initUndistortRectifyMap <initundistortrectifymap>` and the :imgproc_geometric:`remap <remap>` function to remove distortion and enjoy distortion free inputs for cheap and low quality cameras.
|
||||||
|
|
||||||
You may observe a runtime instance of this on the `YouTube here <https://www.youtube.com/watch?v=ViPN810E0SU>`_.
|
You may observe a runtime instance of this on the `YouTube here <https://www.youtube.com/watch?v=ViPN810E0SU>`_.
|
||||||
|
|
||||||
|
@ -99,11 +99,11 @@ Explanation
|
|||||||
|
|
||||||
/// 2.b. Creating rectangles
|
/// 2.b. Creating rectangles
|
||||||
rectangle( rook_image,
|
rectangle( rook_image,
|
||||||
Point( 0, 7*w/8.0 ),
|
Point( 0, 7*w/8.0 ),
|
||||||
Point( w, w),
|
Point( w, w),
|
||||||
Scalar( 0, 255, 255 ),
|
Scalar( 0, 255, 255 ),
|
||||||
-1,
|
-1,
|
||||||
8 );
|
8 );
|
||||||
|
|
||||||
/// 2.c. Create a few lines
|
/// 2.c. Create a few lines
|
||||||
MyLine( rook_image, Point( 0, 15*w/16 ), Point( w, 15*w/16 ) );
|
MyLine( rook_image, Point( 0, 15*w/16 ), Point( w, 15*w/16 ) );
|
||||||
@ -118,16 +118,16 @@ Explanation
|
|||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
void MyLine( Mat img, Point start, Point end )
|
void MyLine( Mat img, Point start, Point end )
|
||||||
{
|
{
|
||||||
int thickness = 2;
|
int thickness = 2;
|
||||||
int lineType = 8;
|
int lineType = 8;
|
||||||
line( img,
|
line( img,
|
||||||
start,
|
start,
|
||||||
end,
|
end,
|
||||||
Scalar( 0, 0, 0 ),
|
Scalar( 0, 0, 0 ),
|
||||||
thickness,
|
thickness,
|
||||||
lineType );
|
lineType );
|
||||||
}
|
}
|
||||||
|
|
||||||
As we can see, *MyLine* just call the function :line:`line <>`, which does the following:
|
As we can see, *MyLine* just call the function :line:`line <>`, which does the following:
|
||||||
|
|
||||||
@ -145,18 +145,18 @@ Explanation
|
|||||||
|
|
||||||
void MyEllipse( Mat img, double angle )
|
void MyEllipse( Mat img, double angle )
|
||||||
{
|
{
|
||||||
int thickness = 2;
|
int thickness = 2;
|
||||||
int lineType = 8;
|
int lineType = 8;
|
||||||
|
|
||||||
ellipse( img,
|
ellipse( img,
|
||||||
Point( w/2.0, w/2.0 ),
|
Point( w/2.0, w/2.0 ),
|
||||||
Size( w/4.0, w/16.0 ),
|
Size( w/4.0, w/16.0 ),
|
||||||
angle,
|
angle,
|
||||||
0,
|
0,
|
||||||
360,
|
360,
|
||||||
Scalar( 255, 0, 0 ),
|
Scalar( 255, 0, 0 ),
|
||||||
thickness,
|
thickness,
|
||||||
lineType );
|
lineType );
|
||||||
}
|
}
|
||||||
|
|
||||||
From the code above, we can observe that the function :ellipse:`ellipse <>` draws an ellipse such that:
|
From the code above, we can observe that the function :ellipse:`ellipse <>` draws an ellipse such that:
|
||||||
@ -176,17 +176,17 @@ Explanation
|
|||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
void MyFilledCircle( Mat img, Point center )
|
void MyFilledCircle( Mat img, Point center )
|
||||||
{
|
{
|
||||||
int thickness = -1;
|
int thickness = -1;
|
||||||
int lineType = 8;
|
int lineType = 8;
|
||||||
|
|
||||||
circle( img,
|
circle( img,
|
||||||
center,
|
center,
|
||||||
w/32.0,
|
w/32.0,
|
||||||
Scalar( 0, 0, 255 ),
|
Scalar( 0, 0, 255 ),
|
||||||
thickness,
|
thickness,
|
||||||
lineType );
|
lineType );
|
||||||
}
|
}
|
||||||
|
|
||||||
Similar to the ellipse function, we can observe that *circle* receives as arguments:
|
Similar to the ellipse function, we can observe that *circle* receives as arguments:
|
||||||
|
|
||||||
@ -203,41 +203,41 @@ Explanation
|
|||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
void MyPolygon( Mat img )
|
void MyPolygon( Mat img )
|
||||||
{
|
{
|
||||||
int lineType = 8;
|
int lineType = 8;
|
||||||
|
|
||||||
/** Create some points */
|
/** Create some points */
|
||||||
Point rook_points[1][20];
|
Point rook_points[1][20];
|
||||||
rook_points[0][0] = Point( w/4.0, 7*w/8.0 );
|
rook_points[0][0] = Point( w/4.0, 7*w/8.0 );
|
||||||
rook_points[0][1] = Point( 3*w/4.0, 7*w/8.0 );
|
rook_points[0][1] = Point( 3*w/4.0, 7*w/8.0 );
|
||||||
rook_points[0][2] = Point( 3*w/4.0, 13*w/16.0 );
|
rook_points[0][2] = Point( 3*w/4.0, 13*w/16.0 );
|
||||||
rook_points[0][3] = Point( 11*w/16.0, 13*w/16.0 );
|
rook_points[0][3] = Point( 11*w/16.0, 13*w/16.0 );
|
||||||
rook_points[0][4] = Point( 19*w/32.0, 3*w/8.0 );
|
rook_points[0][4] = Point( 19*w/32.0, 3*w/8.0 );
|
||||||
rook_points[0][5] = Point( 3*w/4.0, 3*w/8.0 );
|
rook_points[0][5] = Point( 3*w/4.0, 3*w/8.0 );
|
||||||
rook_points[0][6] = Point( 3*w/4.0, w/8.0 );
|
rook_points[0][6] = Point( 3*w/4.0, w/8.0 );
|
||||||
rook_points[0][7] = Point( 26*w/40.0, w/8.0 );
|
rook_points[0][7] = Point( 26*w/40.0, w/8.0 );
|
||||||
rook_points[0][8] = Point( 26*w/40.0, w/4.0 );
|
rook_points[0][8] = Point( 26*w/40.0, w/4.0 );
|
||||||
rook_points[0][9] = Point( 22*w/40.0, w/4.0 );
|
rook_points[0][9] = Point( 22*w/40.0, w/4.0 );
|
||||||
rook_points[0][10] = Point( 22*w/40.0, w/8.0 );
|
rook_points[0][10] = Point( 22*w/40.0, w/8.0 );
|
||||||
rook_points[0][11] = Point( 18*w/40.0, w/8.0 );
|
rook_points[0][11] = Point( 18*w/40.0, w/8.0 );
|
||||||
rook_points[0][12] = Point( 18*w/40.0, w/4.0 );
|
rook_points[0][12] = Point( 18*w/40.0, w/4.0 );
|
||||||
rook_points[0][13] = Point( 14*w/40.0, w/4.0 );
|
rook_points[0][13] = Point( 14*w/40.0, w/4.0 );
|
||||||
rook_points[0][14] = Point( 14*w/40.0, w/8.0 );
|
rook_points[0][14] = Point( 14*w/40.0, w/8.0 );
|
||||||
rook_points[0][15] = Point( w/4.0, w/8.0 );
|
rook_points[0][15] = Point( w/4.0, w/8.0 );
|
||||||
rook_points[0][16] = Point( w/4.0, 3*w/8.0 );
|
rook_points[0][16] = Point( w/4.0, 3*w/8.0 );
|
||||||
rook_points[0][17] = Point( 13*w/32.0, 3*w/8.0 );
|
rook_points[0][17] = Point( 13*w/32.0, 3*w/8.0 );
|
||||||
rook_points[0][18] = Point( 5*w/16.0, 13*w/16.0 );
|
rook_points[0][18] = Point( 5*w/16.0, 13*w/16.0 );
|
||||||
rook_points[0][19] = Point( w/4.0, 13*w/16.0) ;
|
rook_points[0][19] = Point( w/4.0, 13*w/16.0) ;
|
||||||
|
|
||||||
const Point* ppt[1] = { rook_points[0] };
|
const Point* ppt[1] = { rook_points[0] };
|
||||||
int npt[] = { 20 };
|
int npt[] = { 20 };
|
||||||
|
|
||||||
fillPoly( img,
|
fillPoly( img,
|
||||||
ppt,
|
ppt,
|
||||||
npt,
|
npt,
|
||||||
1,
|
1,
|
||||||
Scalar( 255, 255, 255 ),
|
Scalar( 255, 255, 255 ),
|
||||||
lineType );
|
lineType );
|
||||||
}
|
}
|
||||||
|
|
||||||
To draw a filled polygon we use the function :fill_poly:`fillPoly <>`. We note that:
|
To draw a filled polygon we use the function :fill_poly:`fillPoly <>`. We note that:
|
||||||
@ -255,11 +255,11 @@ Explanation
|
|||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
rectangle( rook_image,
|
rectangle( rook_image,
|
||||||
Point( 0, 7*w/8.0 ),
|
Point( 0, 7*w/8.0 ),
|
||||||
Point( w, w),
|
Point( w, w),
|
||||||
Scalar( 0, 255, 255 ),
|
Scalar( 0, 255, 255 ),
|
||||||
-1,
|
-1,
|
||||||
8 );
|
8 );
|
||||||
|
|
||||||
Finally we have the :rectangle:`rectangle <>` function (we did not create a special function for this guy). We note that:
|
Finally we have the :rectangle:`rectangle <>` function (we did not create a special function for this guy). We note that:
|
||||||
|
|
||||||
|
@ -277,4 +277,3 @@ You may observe a runtime instance of this on the `YouTube here <https://www.you
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
<iframe title="File Input and Output using XML and YAML files in OpenCV" width="560" height="349" src="http://www.youtube.com/embed/A4yqVnByMMM?rel=0&loop=1" frameborder="0" allowfullscreen align="middle"></iframe>
|
<iframe title="File Input and Output using XML and YAML files in OpenCV" width="560" height="349" src="http://www.youtube.com/embed/A4yqVnByMMM?rel=0&loop=1" frameborder="0" allowfullscreen align="middle"></iframe>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -127,6 +127,3 @@ You may observe a runtime instance of this on the `YouTube here <https://www.you
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
<iframe title="Interoperability with OpenCV 1" width="560" height="349" src="http://www.youtube.com/embed/qckm-zvo31w?rel=0&loop=1" frameborder="0" allowfullscreen align="middle"></iframe>
|
<iframe title="Interoperability with OpenCV 1" width="560" height="349" src="http://www.youtube.com/embed/qckm-zvo31w?rel=0&loop=1" frameborder="0" allowfullscreen align="middle"></iframe>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -100,6 +100,3 @@ Result
|
|||||||
.. image:: images/Feature_Description_BruteForce_Result.jpg
|
.. image:: images/Feature_Description_BruteForce_Result.jpg
|
||||||
:align: center
|
:align: center
|
||||||
:height: 200pt
|
:height: 200pt
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ This tutorial code's is shown lines below. You can also download it from `here <
|
|||||||
#include "opencv2/core/core.hpp"
|
#include "opencv2/core/core.hpp"
|
||||||
#include "opencv2/features2d/features2d.hpp"
|
#include "opencv2/features2d/features2d.hpp"
|
||||||
#include "opencv2/highgui/highgui.hpp"
|
#include "opencv2/highgui/highgui.hpp"
|
||||||
|
#include "opencv2/nonfree/nonfree.hpp"
|
||||||
|
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
|
|
||||||
@ -94,4 +95,3 @@ Result
|
|||||||
.. image:: images/Feature_Detection_Result_b.jpg
|
.. image:: images/Feature_Detection_Result_b.jpg
|
||||||
:align: center
|
:align: center
|
||||||
:height: 200pt
|
:height: 200pt
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ This tutorial code's is shown lines below. You can also download it from `here <
|
|||||||
#include "opencv2/core/core.hpp"
|
#include "opencv2/core/core.hpp"
|
||||||
#include "opencv2/features2d/features2d.hpp"
|
#include "opencv2/features2d/features2d.hpp"
|
||||||
#include "opencv2/highgui/highgui.hpp"
|
#include "opencv2/highgui/highgui.hpp"
|
||||||
|
#include "opencv2/nonfree/nonfree.hpp"
|
||||||
|
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ This tutorial code's is shown lines below. You can also download it from `here <
|
|||||||
#include "opencv2/features2d/features2d.hpp"
|
#include "opencv2/features2d/features2d.hpp"
|
||||||
#include "opencv2/highgui/highgui.hpp"
|
#include "opencv2/highgui/highgui.hpp"
|
||||||
#include "opencv2/calib3d/calib3d.hpp"
|
#include "opencv2/calib3d/calib3d.hpp"
|
||||||
|
#include "opencv2/nonfree/nonfree.hpp"
|
||||||
|
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
|
|
||||||
@ -145,4 +146,3 @@ Result
|
|||||||
.. image:: images/Feature_Homography_Result.jpg
|
.. image:: images/Feature_Homography_Result.jpg
|
||||||
:align: center
|
:align: center
|
||||||
:height: 200pt
|
:height: 200pt
|
||||||
|
|
||||||
|
@ -201,4 +201,3 @@ Learn about how to use the feature points detectors, descriptors and matching f
|
|||||||
../feature_flann_matcher/feature_flann_matcher
|
../feature_flann_matcher/feature_flann_matcher
|
||||||
../feature_homography/feature_homography
|
../feature_homography/feature_homography
|
||||||
../detection_of_planar_objects/detection_of_planar_objects
|
../detection_of_planar_objects/detection_of_planar_objects
|
||||||
|
|
||||||
|
@ -87,14 +87,14 @@ This tutorial code's is shown lines below. You can also download it from `here <
|
|||||||
|
|
||||||
/// Apply corner detection
|
/// Apply corner detection
|
||||||
goodFeaturesToTrack( src_gray,
|
goodFeaturesToTrack( src_gray,
|
||||||
corners,
|
corners,
|
||||||
maxCorners,
|
maxCorners,
|
||||||
qualityLevel,
|
qualityLevel,
|
||||||
minDistance,
|
minDistance,
|
||||||
Mat(),
|
Mat(),
|
||||||
blockSize,
|
blockSize,
|
||||||
useHarrisDetector,
|
useHarrisDetector,
|
||||||
k );
|
k );
|
||||||
|
|
||||||
|
|
||||||
/// Draw corners detected
|
/// Draw corners detected
|
||||||
@ -135,4 +135,3 @@ Here is the result:
|
|||||||
|
|
||||||
.. image:: images/Corner_Subpixeles_Result.jpg
|
.. image:: images/Corner_Subpixeles_Result.jpg
|
||||||
:align: center
|
:align: center
|
||||||
|
|
||||||
|
@ -37,4 +37,3 @@ Result
|
|||||||
|
|
||||||
.. image:: images/My_Shi_Tomasi_corner_detector_Result.jpg
|
.. image:: images/My_Shi_Tomasi_corner_detector_Result.jpg
|
||||||
:align: center
|
:align: center
|
||||||
|
|
||||||
|
@ -118,5 +118,3 @@ Result
|
|||||||
|
|
||||||
.. image:: images/Feature_Detection_Result_a.jpg
|
.. image:: images/Feature_Detection_Result_a.jpg
|
||||||
:align: center
|
:align: center
|
||||||
|
|
||||||
|
|
||||||
|
@ -98,16 +98,16 @@ How does it work?
|
|||||||
u & v
|
u & v
|
||||||
\end{bmatrix}
|
\end{bmatrix}
|
||||||
\left (
|
\left (
|
||||||
\displaystyle \sum_{x,y}
|
\displaystyle \sum_{x,y}
|
||||||
w(x,y)
|
w(x,y)
|
||||||
\begin{bmatrix}
|
\begin{bmatrix}
|
||||||
I_x^{2} & I_{x}I_{y} \\
|
I_x^{2} & I_{x}I_{y} \\
|
||||||
I_xI_{y} & I_{y}^{2}
|
I_xI_{y} & I_{y}^{2}
|
||||||
\end{bmatrix}
|
\end{bmatrix}
|
||||||
\right )
|
\right )
|
||||||
\begin{bmatrix}
|
\begin{bmatrix}
|
||||||
u \\
|
u \\
|
||||||
v
|
v
|
||||||
\end{bmatrix}
|
\end{bmatrix}
|
||||||
|
|
||||||
* Let's denote:
|
* Let's denote:
|
||||||
@ -115,11 +115,11 @@ How does it work?
|
|||||||
.. math::
|
.. math::
|
||||||
|
|
||||||
M = \displaystyle \sum_{x,y}
|
M = \displaystyle \sum_{x,y}
|
||||||
w(x,y)
|
w(x,y)
|
||||||
\begin{bmatrix}
|
\begin{bmatrix}
|
||||||
I_x^{2} & I_{x}I_{y} \\
|
I_x^{2} & I_{x}I_{y} \\
|
||||||
I_xI_{y} & I_{y}^{2}
|
I_xI_{y} & I_{y}^{2}
|
||||||
\end{bmatrix}
|
\end{bmatrix}
|
||||||
|
|
||||||
* So, our equation now is:
|
* So, our equation now is:
|
||||||
|
|
||||||
@ -128,10 +128,10 @@ How does it work?
|
|||||||
E(u,v) \approx \begin{bmatrix}
|
E(u,v) \approx \begin{bmatrix}
|
||||||
u & v
|
u & v
|
||||||
\end{bmatrix}
|
\end{bmatrix}
|
||||||
M
|
M
|
||||||
\begin{bmatrix}
|
\begin{bmatrix}
|
||||||
u \\
|
u \\
|
||||||
v
|
v
|
||||||
\end{bmatrix}
|
\end{bmatrix}
|
||||||
|
|
||||||
|
|
||||||
@ -243,5 +243,3 @@ The detected corners are surrounded by a small black circle
|
|||||||
|
|
||||||
.. image:: images/Harris_Detector_Result.jpg
|
.. image:: images/Harris_Detector_Result.jpg
|
||||||
:align: center
|
:align: center
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,4 +10,3 @@ These tutorials are the bottom of the iceberg as they link together multiple of
|
|||||||
.. raw:: latex
|
.. raw:: latex
|
||||||
|
|
||||||
\pagebreak
|
\pagebreak
|
||||||
|
|
||||||
|
@ -154,8 +154,3 @@ Result
|
|||||||
.. image:: images/Adding_Trackbars_Tutorial_Result_1.jpg
|
.. image:: images/Adding_Trackbars_Tutorial_Result_1.jpg
|
||||||
:alt: Adding Trackbars - Lena
|
:alt: Adding Trackbars - Lena
|
||||||
:align: center
|
:align: center
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -112,21 +112,21 @@ This tutorial code's is shown lines below. You can also download it from `here <
|
|||||||
|
|
||||||
/// Create Erosion Trackbar
|
/// Create Erosion Trackbar
|
||||||
createTrackbar( "Element:\n 0: Rect \n 1: Cross \n 2: Ellipse", "Erosion Demo",
|
createTrackbar( "Element:\n 0: Rect \n 1: Cross \n 2: Ellipse", "Erosion Demo",
|
||||||
&erosion_elem, max_elem,
|
&erosion_elem, max_elem,
|
||||||
Erosion );
|
Erosion );
|
||||||
|
|
||||||
createTrackbar( "Kernel size:\n 2n +1", "Erosion Demo",
|
createTrackbar( "Kernel size:\n 2n +1", "Erosion Demo",
|
||||||
&erosion_size, max_kernel_size,
|
&erosion_size, max_kernel_size,
|
||||||
Erosion );
|
Erosion );
|
||||||
|
|
||||||
/// Create Dilation Trackbar
|
/// Create Dilation Trackbar
|
||||||
createTrackbar( "Element:\n 0: Rect \n 1: Cross \n 2: Ellipse", "Dilation Demo",
|
createTrackbar( "Element:\n 0: Rect \n 1: Cross \n 2: Ellipse", "Dilation Demo",
|
||||||
&dilation_elem, max_elem,
|
&dilation_elem, max_elem,
|
||||||
Dilation );
|
Dilation );
|
||||||
|
|
||||||
createTrackbar( "Kernel size:\n 2n +1", "Dilation Demo",
|
createTrackbar( "Kernel size:\n 2n +1", "Dilation Demo",
|
||||||
&dilation_size, max_kernel_size,
|
&dilation_size, max_kernel_size,
|
||||||
Dilation );
|
Dilation );
|
||||||
|
|
||||||
/// Default start
|
/// Default start
|
||||||
Erosion( 0, 0 );
|
Erosion( 0, 0 );
|
||||||
@ -145,8 +145,8 @@ This tutorial code's is shown lines below. You can also download it from `here <
|
|||||||
else if( erosion_elem == 2) { erosion_type = MORPH_ELLIPSE; }
|
else if( erosion_elem == 2) { erosion_type = MORPH_ELLIPSE; }
|
||||||
|
|
||||||
Mat element = getStructuringElement( erosion_type,
|
Mat element = getStructuringElement( erosion_type,
|
||||||
Size( 2*erosion_size + 1, 2*erosion_size+1 ),
|
Size( 2*erosion_size + 1, 2*erosion_size+1 ),
|
||||||
Point( erosion_size, erosion_size ) );
|
Point( erosion_size, erosion_size ) );
|
||||||
|
|
||||||
/// Apply the erosion operation
|
/// Apply the erosion operation
|
||||||
erode( src, erosion_dst, element );
|
erode( src, erosion_dst, element );
|
||||||
@ -162,8 +162,8 @@ This tutorial code's is shown lines below. You can also download it from `here <
|
|||||||
else if( dilation_elem == 2) { dilation_type = MORPH_ELLIPSE; }
|
else if( dilation_elem == 2) { dilation_type = MORPH_ELLIPSE; }
|
||||||
|
|
||||||
Mat element = getStructuringElement( dilation_type,
|
Mat element = getStructuringElement( dilation_type,
|
||||||
Size( 2*dilation_size + 1, 2*dilation_size+1 ),
|
Size( 2*dilation_size + 1, 2*dilation_size+1 ),
|
||||||
Point( dilation_size, dilation_size ) );
|
Point( dilation_size, dilation_size ) );
|
||||||
/// Apply the dilation operation
|
/// Apply the dilation operation
|
||||||
dilate( src, dilation_dst, element );
|
dilate( src, dilation_dst, element );
|
||||||
imshow( "Dilation Demo", dilation_dst );
|
imshow( "Dilation Demo", dilation_dst );
|
||||||
@ -201,8 +201,8 @@ Explanation
|
|||||||
else if( erosion_elem == 2) { erosion_type = MORPH_ELLIPSE; }
|
else if( erosion_elem == 2) { erosion_type = MORPH_ELLIPSE; }
|
||||||
|
|
||||||
Mat element = getStructuringElement( erosion_type,
|
Mat element = getStructuringElement( erosion_type,
|
||||||
Size( 2*erosion_size + 1, 2*erosion_size+1 ),
|
Size( 2*erosion_size + 1, 2*erosion_size+1 ),
|
||||||
Point( erosion_size, erosion_size ) );
|
Point( erosion_size, erosion_size ) );
|
||||||
/// Apply the erosion operation
|
/// Apply the erosion operation
|
||||||
erode( src, erosion_dst, element );
|
erode( src, erosion_dst, element );
|
||||||
imshow( "Erosion Demo", erosion_dst );
|
imshow( "Erosion Demo", erosion_dst );
|
||||||
@ -216,17 +216,17 @@ Explanation
|
|||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
Mat element = getStructuringElement( erosion_type,
|
Mat element = getStructuringElement( erosion_type,
|
||||||
Size( 2*erosion_size + 1, 2*erosion_size+1 ),
|
Size( 2*erosion_size + 1, 2*erosion_size+1 ),
|
||||||
Point( erosion_size, erosion_size ) );
|
Point( erosion_size, erosion_size ) );
|
||||||
|
|
||||||
We can choose any of three shapes for our kernel:
|
We can choose any of three shapes for our kernel:
|
||||||
|
|
||||||
.. container:: enumeratevisibleitemswithsquare
|
.. container:: enumeratevisibleitemswithsquare
|
||||||
|
|
||||||
+ Rectangular box: MORPH_RECT
|
+ Rectangular box: MORPH_RECT
|
||||||
+ Cross: MORPH_CROSS
|
+ Cross: MORPH_CROSS
|
||||||
+ Ellipse: MORPH_ELLIPSE
|
+ Ellipse: MORPH_ELLIPSE
|
||||||
|
|
||||||
Then, we just have to specify the size of our kernel and the *anchor point*. If not specified, it is assumed to be in the center.
|
Then, we just have to specify the size of our kernel and the *anchor point*. If not specified, it is assumed to be in the center.
|
||||||
|
|
||||||
@ -251,8 +251,8 @@ The code is below. As you can see, it is completely similar to the snippet of co
|
|||||||
else if( dilation_elem == 2) { dilation_type = MORPH_ELLIPSE; }
|
else if( dilation_elem == 2) { dilation_type = MORPH_ELLIPSE; }
|
||||||
|
|
||||||
Mat element = getStructuringElement( dilation_type,
|
Mat element = getStructuringElement( dilation_type,
|
||||||
Size( 2*dilation_size + 1, 2*dilation_size+1 ),
|
Size( 2*dilation_size + 1, 2*dilation_size+1 ),
|
||||||
Point( dilation_size, dilation_size ) );
|
Point( dilation_size, dilation_size ) );
|
||||||
/// Apply the dilation operation
|
/// Apply the dilation operation
|
||||||
dilate( src, dilation_dst, element );
|
dilate( src, dilation_dst, element );
|
||||||
imshow( "Dilation Demo", dilation_dst );
|
imshow( "Dilation Demo", dilation_dst );
|
||||||
|
@ -94,7 +94,7 @@ Code
|
|||||||
* Loads an image
|
* Loads an image
|
||||||
* Convert the original to HSV format and separate only *Hue* channel to be used for the Histogram (using the OpenCV function :mix_channels:`mixChannels <>`)
|
* Convert the original to HSV format and separate only *Hue* channel to be used for the Histogram (using the OpenCV function :mix_channels:`mixChannels <>`)
|
||||||
* Let the user to enter the number of bins to be used in the calculation of the histogram.
|
* Let the user to enter the number of bins to be used in the calculation of the histogram.
|
||||||
* Calculate the histogram (and update it if the bins change) and the backprojection of the same image.
|
* Calculate the histogram (and update it if the bins change) and the backprojection of the same image.
|
||||||
* Display the backprojection and the histogram in windows.
|
* Display the backprojection and the histogram in windows.
|
||||||
|
|
||||||
* **Downloadable code**:
|
* **Downloadable code**:
|
||||||
|
@ -329,4 +329,3 @@ Result
|
|||||||
|
|
||||||
.. image:: images/Histogram_Calculation_Result.jpg
|
.. image:: images/Histogram_Calculation_Result.jpg
|
||||||
:align: center
|
:align: center
|
||||||
|
|
||||||
|
@ -369,4 +369,3 @@ Results
|
|||||||
|
|
||||||
.. image:: images/Template_Matching_Image_Result.jpg
|
.. image:: images/Template_Matching_Image_Result.jpg
|
||||||
:align: center
|
:align: center
|
||||||
|
|
||||||
|
@ -282,6 +282,3 @@ Result
|
|||||||
:align: center
|
:align: center
|
||||||
|
|
||||||
* Notice how the image is superposed to the black background on the edge regions.
|
* Notice how the image is superposed to the black background on the edge regions.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -290,4 +290,3 @@ We get the following result by using the Probabilistic Hough Line Transform:
|
|||||||
:align: center
|
:align: center
|
||||||
|
|
||||||
You may observe that the number of lines detected vary while you change the *threshold*. The explanation is sort of evident: If you establish a higher threshold, fewer lines will be detected (since you will need more points to declare a line detected).
|
You may observe that the number of lines detected vary while you change the *threshold*. The explanation is sort of evident: If you establish a higher threshold, fewer lines will be detected (since you will need more points to declare a line detected).
|
||||||
|
|
||||||
|
@ -124,34 +124,34 @@ Code
|
|||||||
|
|
||||||
for( int j = 0; j < src.rows; j++ )
|
for( int j = 0; j < src.rows; j++ )
|
||||||
{ for( int i = 0; i < src.cols; i++ )
|
{ for( int i = 0; i < src.cols; i++ )
|
||||||
{
|
{
|
||||||
switch( ind )
|
switch( ind )
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
if( i > src.cols*0.25 && i < src.cols*0.75 && j > src.rows*0.25 && j < src.rows*0.75 )
|
if( i > src.cols*0.25 && i < src.cols*0.75 && j > src.rows*0.25 && j < src.rows*0.75 )
|
||||||
{
|
{
|
||||||
map_x.at<float>(j,i) = 2*( i - src.cols*0.25 ) + 0.5 ;
|
map_x.at<float>(j,i) = 2*( i - src.cols*0.25 ) + 0.5 ;
|
||||||
map_y.at<float>(j,i) = 2*( j - src.rows*0.25 ) + 0.5 ;
|
map_y.at<float>(j,i) = 2*( j - src.rows*0.25 ) + 0.5 ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ map_x.at<float>(j,i) = 0 ;
|
{ map_x.at<float>(j,i) = 0 ;
|
||||||
map_y.at<float>(j,i) = 0 ;
|
map_y.at<float>(j,i) = 0 ;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
map_x.at<float>(j,i) = i ;
|
map_x.at<float>(j,i) = i ;
|
||||||
map_y.at<float>(j,i) = src.rows - j ;
|
map_y.at<float>(j,i) = src.rows - j ;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
map_x.at<float>(j,i) = src.cols - i ;
|
map_x.at<float>(j,i) = src.cols - i ;
|
||||||
map_y.at<float>(j,i) = j ;
|
map_y.at<float>(j,i) = j ;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
map_x.at<float>(j,i) = src.cols - i ;
|
map_x.at<float>(j,i) = src.cols - i ;
|
||||||
map_y.at<float>(j,i) = src.rows - j ;
|
map_y.at<float>(j,i) = src.rows - j ;
|
||||||
break;
|
break;
|
||||||
} // end of switch
|
} // end of switch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ind++;
|
ind++;
|
||||||
}
|
}
|
||||||
@ -241,34 +241,34 @@ Explanation
|
|||||||
|
|
||||||
for( int j = 0; j < src.rows; j++ )
|
for( int j = 0; j < src.rows; j++ )
|
||||||
{ for( int i = 0; i < src.cols; i++ )
|
{ for( int i = 0; i < src.cols; i++ )
|
||||||
{
|
{
|
||||||
switch( ind )
|
switch( ind )
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
if( i > src.cols*0.25 && i < src.cols*0.75 && j > src.rows*0.25 && j < src.rows*0.75 )
|
if( i > src.cols*0.25 && i < src.cols*0.75 && j > src.rows*0.25 && j < src.rows*0.75 )
|
||||||
{
|
{
|
||||||
map_x.at<float>(j,i) = 2*( i - src.cols*0.25 ) + 0.5 ;
|
map_x.at<float>(j,i) = 2*( i - src.cols*0.25 ) + 0.5 ;
|
||||||
map_y.at<float>(j,i) = 2*( j - src.rows*0.25 ) + 0.5 ;
|
map_y.at<float>(j,i) = 2*( j - src.rows*0.25 ) + 0.5 ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ map_x.at<float>(j,i) = 0 ;
|
{ map_x.at<float>(j,i) = 0 ;
|
||||||
map_y.at<float>(j,i) = 0 ;
|
map_y.at<float>(j,i) = 0 ;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
map_x.at<float>(j,i) = i ;
|
map_x.at<float>(j,i) = i ;
|
||||||
map_y.at<float>(j,i) = src.rows - j ;
|
map_y.at<float>(j,i) = src.rows - j ;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
map_x.at<float>(j,i) = src.cols - i ;
|
map_x.at<float>(j,i) = src.cols - i ;
|
||||||
map_y.at<float>(j,i) = j ;
|
map_y.at<float>(j,i) = j ;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
map_x.at<float>(j,i) = src.cols - i ;
|
map_x.at<float>(j,i) = src.cols - i ;
|
||||||
map_y.at<float>(j,i) = src.rows - j ;
|
map_y.at<float>(j,i) = src.rows - j ;
|
||||||
break;
|
break;
|
||||||
} // end of switch
|
} // end of switch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ind++;
|
ind++;
|
||||||
}
|
}
|
||||||
@ -311,4 +311,3 @@ Result
|
|||||||
:alt: Result 0 for remapping
|
:alt: Result 0 for remapping
|
||||||
:width: 250pt
|
:width: 250pt
|
||||||
:align: center
|
:align: center
|
||||||
|
|
||||||
|
@ -306,4 +306,3 @@ Result
|
|||||||
:alt: Original image
|
:alt: Original image
|
||||||
:width: 250pt
|
:width: 250pt
|
||||||
:align: center
|
:align: center
|
||||||
|
|
||||||
|
@ -154,13 +154,13 @@ This tutorial code's is shown lines below. You can also download it from `here <
|
|||||||
|
|
||||||
/// Create Trackbar to select kernel type
|
/// Create Trackbar to select kernel type
|
||||||
createTrackbar( "Element:\n 0: Rect - 1: Cross - 2: Ellipse", window_name,
|
createTrackbar( "Element:\n 0: Rect - 1: Cross - 2: Ellipse", window_name,
|
||||||
&morph_elem, max_elem,
|
&morph_elem, max_elem,
|
||||||
Morphology_Operations );
|
Morphology_Operations );
|
||||||
|
|
||||||
/// Create Trackbar to choose kernel size
|
/// Create Trackbar to choose kernel size
|
||||||
createTrackbar( "Kernel size:\n 2n +1", window_name,
|
createTrackbar( "Kernel size:\n 2n +1", window_name,
|
||||||
&morph_size, max_kernel_size,
|
&morph_size, max_kernel_size,
|
||||||
Morphology_Operations );
|
Morphology_Operations );
|
||||||
|
|
||||||
/// Default start
|
/// Default start
|
||||||
Morphology_Operations( 0, 0 );
|
Morphology_Operations( 0, 0 );
|
||||||
@ -211,16 +211,16 @@ Explanation
|
|||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
createTrackbar( "Element:\n 0: Rect - 1: Cross - 2: Ellipse", window_name,
|
createTrackbar( "Element:\n 0: Rect - 1: Cross - 2: Ellipse", window_name,
|
||||||
&morph_elem, max_elem,
|
&morph_elem, max_elem,
|
||||||
Morphology_Operations );
|
Morphology_Operations );
|
||||||
|
|
||||||
* The final trackbar **"Kernel Size"** returns the size of the kernel to be used (**morph_size**)
|
* The final trackbar **"Kernel Size"** returns the size of the kernel to be used (**morph_size**)
|
||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
createTrackbar( "Kernel size:\n 2n +1", window_name,
|
createTrackbar( "Kernel size:\n 2n +1", window_name,
|
||||||
&morph_size, max_kernel_size,
|
&morph_size, max_kernel_size,
|
||||||
Morphology_Operations );
|
Morphology_Operations );
|
||||||
|
|
||||||
|
|
||||||
* Every time we move any slider, the user's function **Morphology_Operations** will be called to effectuate a new morphology operation and it will update the output image based on the current trackbar values.
|
* Every time we move any slider, the user's function **Morphology_Operations** will be called to effectuate a new morphology operation and it will update the output image based on the current trackbar values.
|
||||||
@ -279,4 +279,3 @@ Results
|
|||||||
.. image:: images/Morphology_2_Tutorial_Cover.jpg
|
.. image:: images/Morphology_2_Tutorial_Cover.jpg
|
||||||
:alt: Morphology 2: Result sample
|
:alt: Morphology 2: Result sample
|
||||||
:align: center
|
:align: center
|
||||||
|
|
||||||
|
@ -259,5 +259,3 @@ Results
|
|||||||
.. image:: images/Pyramids_Tutorial_PyrUp_Result.jpg
|
.. image:: images/Pyramids_Tutorial_PyrUp_Result.jpg
|
||||||
:alt: Pyramids: PyrUp Result
|
:alt: Pyramids: PyrUp Result
|
||||||
:align: center
|
:align: center
|
||||||
|
|
||||||
|
|
||||||
|
@ -121,4 +121,3 @@ Result
|
|||||||
|
|
||||||
.. |BRC_1| image:: images/Bounding_Rects_Circles_Result.jpg
|
.. |BRC_1| image:: images/Bounding_Rects_Circles_Result.jpg
|
||||||
:align: middle
|
:align: middle
|
||||||
|
|
||||||
|
@ -123,4 +123,3 @@ Result
|
|||||||
|
|
||||||
.. |BRE_1| image:: images/Bounding_Rotated_Ellipses_Result.jpg
|
.. |BRE_1| image:: images/Bounding_Rotated_Ellipses_Result.jpg
|
||||||
:align: middle
|
:align: middle
|
||||||
|
|
||||||
|
@ -104,4 +104,3 @@ Result
|
|||||||
|
|
||||||
.. |contour_1| image:: images/Find_Contours_Result.jpg
|
.. |contour_1| image:: images/Find_Contours_Result.jpg
|
||||||
:align: middle
|
:align: middle
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user