diff --git a/.gitattributes b/.gitattributes index cd4359ba34..35df6ca2fc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,42 +1,58 @@ -.git* export-ignore - * text=auto whitespace=trailing-space,space-before-tab,-indent-with-non-tab,tab-in-indent,tabwidth=4 -*.py text -*.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 -*.mk text +.git* text export-ignore + +*.aidl 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 *.cmakein text whitespace=tabwidth=2 *.in text whitespace=tabwidth=2 CMakeLists.txt text whitespace=tabwidth=2 -*.png binary -*.jpeg binary -*.jpg binary +*.avi binary +*.bmp binary *.exr binary *.ico binary +*.jpeg binary +*.jpg binary +*.png binary *.a binary *.so binary @@ -47,6 +63,7 @@ CMakeLists.txt text whitespace=tabwidth=2 *.pbxproj binary *.vec binary *.doc binary +*.dia binary *.xml -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 org.eclipse.jdt.core.prefs -text whitespace=cr-at-eol merge=union -*.vcproj text eol=crlf merge=union *.bat text eol=crlf *.cmd 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 \ No newline at end of file +*.sh text eol=lf diff --git a/3rdparty/.gitattributes b/3rdparty/.gitattributes new file mode 100644 index 0000000000..562b12e16e --- /dev/null +++ b/3rdparty/.gitattributes @@ -0,0 +1 @@ +* -whitespace diff --git a/3rdparty/ffmpeg/ffmpeg_version.cmake b/3rdparty/ffmpeg/ffmpeg_version.cmake index f698ecf180..7bb8bab3fb 100644 --- a/3rdparty/ffmpeg/ffmpeg_version.cmake +++ b/3rdparty/ffmpeg/ffmpeg_version.cmake @@ -8,4 +8,4 @@ set(HAVE_GENTOO_FFMPEG 1) set(ALIASOF_libavcodec_VERSION 53.61.100) set(ALIASOF_libavformat_VERSION 53.32.100) set(ALIASOF_libavutil_VERSION 51.35.100) -set(ALIASOF_libswscale_VERSION 2.1.100) \ No newline at end of file +set(ALIASOF_libswscale_VERSION 2.1.100) diff --git a/3rdparty/ffmpeg/make.bat b/3rdparty/ffmpeg/make.bat index 9f11b52d63..2323af9ab8 100644 --- a/3rdparty/ffmpeg/make.bat +++ b/3rdparty/ffmpeg/make.bat @@ -1,2 +1,2 @@ set path=c:\dev\msys32\bin;%path% & gcc -Wall -shared -o opencv_ffmpeg.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat -lavcodec -lavdevice -lswscale -lavutil -lwsock32 -set path=c:\dev\msys64\bin;%path% & gcc -m64 -Wall -shared -o opencv_ffmpeg_64.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat64 -lavcodec64 -lavdevice64 -lswscale64 -lavutil64 -lavcore64 -lwsock32 -lws2_32 \ No newline at end of file +set path=c:\dev\msys64\bin;%path% & gcc -m64 -Wall -shared -o opencv_ffmpeg_64.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat64 -lavcodec64 -lavdevice64 -lswscale64 -lavutil64 -lavcore64 -lwsock32 -lws2_32 diff --git a/3rdparty/ffmpeg/readme.txt b/3rdparty/ffmpeg/readme.txt index 1928a53039..e98b285208 100644 --- a/3rdparty/ffmpeg/readme.txt +++ b/3rdparty/ffmpeg/readme.txt @@ -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 \3rdparty\ffmpeg, edit make.bat (change paths to the actual paths to your msys32 and msys64 distributions) and then run make.bat - - diff --git a/3rdparty/libpng/opencv-libpng.path b/3rdparty/libpng/opencv-libpng.patch similarity index 100% rename from 3rdparty/libpng/opencv-libpng.path rename to 3rdparty/libpng/opencv-libpng.patch diff --git a/3rdparty/libtiff/tif_config.h.cmakein b/3rdparty/libtiff/tif_config.h.cmakein index 1e6bc0454c..182f2833d1 100644 --- a/3rdparty/libtiff/tif_config.h.cmakein +++ b/3rdparty/libtiff/tif_config.h.cmakein @@ -168,4 +168,3 @@ /* Support Deflate compression */ #define ZIP_SUPPORT 1 - diff --git a/3rdparty/tbb/.gitignore b/3rdparty/tbb/.gitignore index 601e1b265e..69ce9ceb9c 100644 --- a/3rdparty/tbb/.gitignore +++ b/3rdparty/tbb/.gitignore @@ -1 +1 @@ -tbb*.tgz \ No newline at end of file +tbb*.tgz diff --git a/CMakeLists.txt b/CMakeLists.txt index 29fdc4eca9..9e3c95be4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -460,6 +460,8 @@ include(cmake/OpenCVGenAndroidMK.cmake) # Generate OpenCVŠ”onfig.cmake and OpenCVConfig-version.cmake for cmake projects include(cmake/OpenCVGenConfig.cmake) +# Generate Info.plist for the IOS framework +include(cmake/OpenCVGenInfoPlist.cmake) # ---------------------------------------------------------------------------- # Summary: @@ -863,4 +865,3 @@ ocv_finalize_status() 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") endif() - diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index ad0f0daade..f5ac42a018 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -3,4 +3,3 @@ add_definitions(-D__OPENCV_BUILD=1) add_subdirectory(haartraining) add_subdirectory(traincascade) add_subdirectory(sft) - diff --git a/apps/haartraining/CMakeLists.txt b/apps/haartraining/CMakeLists.txt index f71cbeeaa2..7a197db837 100644 --- a/apps/haartraining/CMakeLists.txt +++ b/apps/haartraining/CMakeLists.txt @@ -79,4 +79,3 @@ if(ENABLE_SOLUTION_FOLDERS) set_target_properties(opencv_haartraining PROPERTIES FOLDER "applications") set_target_properties(opencv_haartraining_engine PROPERTIES FOLDER "applications") endif() - diff --git a/apps/haartraining/_cvcommon.h b/apps/haartraining/_cvcommon.h index 1c4bad52d0..92fee8e84a 100644 --- a/apps/haartraining/_cvcommon.h +++ b/apps/haartraining/_cvcommon.h @@ -90,4 +90,3 @@ int icvGetIdxAt( CvMat* idx, int pos ) void icvSave( const CvArr* ptr, const char* filename, int line ); #endif /* __CVCOMMON_H_ */ - diff --git a/apps/haartraining/performance.cpp b/apps/haartraining/performance.cpp index a95e4d4c46..cb8dda1c83 100644 --- a/apps/haartraining/performance.cpp +++ b/apps/haartraining/performance.cpp @@ -375,4 +375,3 @@ int main( int argc, char* argv[] ) return 0; } - diff --git a/apps/sft/CMakeLists.txt b/apps/sft/CMakeLists.txt index 8b950225c8..05bd337c34 100644 --- a/apps/sft/CMakeLists.txt +++ b/apps/sft/CMakeLists.txt @@ -30,4 +30,4 @@ if(ENABLE_SOLUTION_FOLDERS) set_target_properties(${the_target} PROPERTIES FOLDER "applications") endif() -install(TARGETS ${the_target} RUNTIME DESTINATION bin COMPONENT main) \ No newline at end of file +install(TARGETS ${the_target} RUNTIME DESTINATION bin COMPONENT main) diff --git a/apps/sft/config.cpp b/apps/sft/config.cpp index 3cc64c7fec..9157575a1e 100644 --- a/apps/sft/config.cpp +++ b/apps/sft/config.cpp @@ -159,4 +159,4 @@ std::ostream& sft::operator<<(std::ostream& out, const Config& m) << std::setw(14) << std::left << "featureType" << m.featureType << std::endl; return out; -} \ No newline at end of file +} diff --git a/apps/sft/include/sft/common.hpp b/apps/sft/include/sft/common.hpp index 4a0a03f362..5c142a749d 100644 --- a/apps/sft/include/sft/common.hpp +++ b/apps/sft/include/sft/common.hpp @@ -71,4 +71,4 @@ namespace sft # define dprintf(format, ...) #endif -#endif \ No newline at end of file +#endif diff --git a/apps/sft/include/sft/config.hpp b/apps/sft/include/sft/config.hpp index 3d39d32722..c6e85b264c 100644 --- a/apps/sft/include/sft/config.hpp +++ b/apps/sft/include/sft/config.hpp @@ -135,4 +135,4 @@ std::ostream& operator<<(std::ostream& out, const Config& m); } -#endif \ No newline at end of file +#endif diff --git a/apps/sft/include/sft/dataset.hpp b/apps/sft/include/sft/dataset.hpp index 98d6192568..7504f4033d 100644 --- a/apps/sft/include/sft/dataset.hpp +++ b/apps/sft/include/sft/dataset.hpp @@ -64,4 +64,4 @@ private: }; } -#endif \ No newline at end of file +#endif diff --git a/apps/sft/sft.cpp b/apps/sft/sft.cpp index 7b51387638..79d41032eb 100644 --- a/apps/sft/sft.cpp +++ b/apps/sft/sft.cpp @@ -165,4 +165,4 @@ int main(int argc, char** argv) fso.release(); std::cout << "Training complete..." << std::endl; return 0; -} \ No newline at end of file +} diff --git a/apps/traincascade/CMakeLists.txt b/apps/traincascade/CMakeLists.txt index 72e51b9ea0..eb0c83df5a 100644 --- a/apps/traincascade/CMakeLists.txt +++ b/apps/traincascade/CMakeLists.txt @@ -34,4 +34,3 @@ if(ENABLE_SOLUTION_FOLDERS) endif() install(TARGETS ${the_target} RUNTIME DESTINATION bin COMPONENT main) - diff --git a/cmake/OpenCVCRTLinkage.cmake b/cmake/OpenCVCRTLinkage.cmake index 62d89af4a9..8e689da806 100644 --- a/cmake/OpenCVCRTLinkage.cmake +++ b/cmake/OpenCVCRTLinkage.cmake @@ -26,8 +26,8 @@ else() set(HAVE_MSVC2012 TRUE) endif() -TRY_COMPILE(HAVE_WINRT_SDK - "${OPENCV_BINARY_DIR}/CMakeFiles/CMakeTmp" +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) @@ -98,4 +98,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_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") endif() - diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake index a71bcf06e3..bfca6a0bc9 100644 --- a/cmake/OpenCVCompilerOptions.cmake +++ b/cmake/OpenCVCompilerOptions.cmake @@ -233,6 +233,10 @@ if(MSVC) set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /fp:fast") # !! important - be on the same wave with x64 compilers endif() endif() + + if(OPENCV_WARNINGS_ARE_ERRORS) + set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /WX") + endif() endif() # Extra link libs if the user selects building static libs: @@ -294,4 +298,4 @@ if(MSVC) if(NOT ENABLE_NOISY_WARNINGS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251") #class 'std::XXX' needs to have dll-interface to be used by clients of YYY endif() -endif() \ No newline at end of file +endif() diff --git a/cmake/OpenCVFindIPP.cmake b/cmake/OpenCVFindIPP.cmake index 9921d2503c..772cae886f 100644 --- a/cmake/OpenCVFindIPP.cmake +++ b/cmake/OpenCVFindIPP.cmake @@ -136,17 +136,20 @@ endfunction() # ------------------------------------------------------------------------ # 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 _LATEST_VERSION) set(IPP_PREFIX "ipp") - + if(${_LATEST_VERSION} VERSION_LESS "8.0") - set(IPP_SUFFIX "_l") # static not threaded libs suffix + set(IPP_SUFFIX "_l") # static not threaded libs suffix IPP 7.x else() - set(IPP_SUFFIX "") # static not threaded libs suffix + 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(IPP_THRD "_t") # static threaded libs suffix set(IPPCORE "core") # core functionality set(IPPSP "s") # signal processing set(IPPIP "i") # image processing @@ -218,7 +221,7 @@ function(set_ipp_variables _LATEST_VERSION) set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/ia32 PARENT_SCOPE) endif() - # set IPP_LIBRARIES variable (7.x lib names) + # set IPP_LIBRARIES variable (7.x or 8.x lib names) set_ipp_new_libraries(${_LATEST_VERSION}) set(IPP_LIBRARIES ${IPP_LIBRARIES} PARENT_SCOPE) message(STATUS "IPP libs: ${IPP_LIBRARIES}") @@ -343,4 +346,4 @@ if(WIN32 AND MINGW AND NOT IPP_LATEST_VERSION_MAJOR LESS 7) # See http://code.opencv.org/issues/1906 for additional details set(MSV_NTDLL "ntdll") set(IPP_LIBRARIES ${IPP_LIBRARIES} ${MSV_NTDLL}${IPP_LIB_SUFFIX}) -endif() \ No newline at end of file +endif() diff --git a/cmake/OpenCVFindLibsGUI.cmake b/cmake/OpenCVFindLibsGUI.cmake index d8d0be8ea7..c80beca055 100644 --- a/cmake/OpenCVFindLibsGUI.cmake +++ b/cmake/OpenCVFindLibsGUI.cmake @@ -5,12 +5,11 @@ #--- Win32 UI --- ocv_clear_vars(HAVE_WIN32UI) if(WITH_WIN32UI) - TRY_COMPILE(HAVE_WIN32UI - "${OPENCV_BINARY_DIR}/CMakeFiles/CMakeTmp" + try_compile(HAVE_WIN32UI + "${OpenCV_BINARY_DIR}" "${OpenCV_SOURCE_DIR}/cmake/checks/win32uitest.cpp" - CMAKE_FLAGS "\"user32.lib\" \"gdi32.lib\"" - OUTPUT_VARIABLE OUTPUT) -endif(WITH_WIN32UI) + CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=user32;gdi32") +endif() # --- QT4 --- ocv_clear_vars(HAVE_QT HAVE_QT5) diff --git a/cmake/OpenCVFindLibsGrfmt.cmake b/cmake/OpenCVFindLibsGrfmt.cmake index 7d885f7a7a..d8ddcfeb71 100644 --- a/cmake/OpenCVFindLibsGrfmt.cmake +++ b/cmake/OpenCVFindLibsGrfmt.cmake @@ -149,7 +149,7 @@ if(WITH_JASPER) endif() # --- libpng (optional, should be searched after zlib) --- -if(WITH_PNG AND NOT IOS) +if(WITH_PNG) if(BUILD_PNG) ocv_clear_vars(PNG_FOUND) else() diff --git a/cmake/OpenCVFindLibsPerf.cmake b/cmake/OpenCVFindLibsPerf.cmake index db71b8aebb..b8945c257b 100644 --- a/cmake/OpenCVFindLibsPerf.cmake +++ b/cmake/OpenCVFindLibsPerf.cmake @@ -27,7 +27,7 @@ endif(WITH_CUDA) # --- Eigen --- if(WITH_EIGEN) find_path(EIGEN_INCLUDE_PATH "Eigen/Core" - PATHS /usr/local /opt /usr $ENV{EIGEN_ROOT}/include ENV ProgramFiles ENV ProgramW6432 + PATHS /usr/local /opt /usr $ENV{EIGEN_ROOT}/include ENV ProgramFiles ENV ProgramW6432 PATH_SUFFIXES include/eigen3 include/eigen2 Eigen/include/eigen3 Eigen/include/eigen2 DOC "The path to Eigen3/Eigen2 headers" CMAKE_FIND_ROOT_PATH_BOTH) diff --git a/cmake/OpenCVFindLibsVideo.cmake b/cmake/OpenCVFindLibsVideo.cmake index 472620aac4..eba6fa988c 100644 --- a/cmake/OpenCVFindLibsVideo.cmake +++ b/cmake/OpenCVFindLibsVideo.cmake @@ -3,13 +3,12 @@ # ---------------------------------------------------------------------------- ocv_clear_vars(HAVE_VFW) -if (WITH_VFW) - TRY_COMPILE(HAVE_VFW - "${OPENCV_BINARY_DIR}/CMakeFiles/CMakeTmp" +if(WITH_VFW) + try_compile(HAVE_VFW + "${OpenCV_BINARY_DIR}" "${OpenCV_SOURCE_DIR}/cmake/checks/vfwtest.cpp" - CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=vfw32" - OUTPUT_VARIABLE OUTPUT) - endif(WITH_VFW) + CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=vfw32") +endif(WITH_VFW) # --- GStreamer --- ocv_clear_vars(HAVE_GSTREAMER) @@ -271,8 +270,10 @@ if(WITH_AVFOUNDATION) endif() # --- QuickTime --- -if(WITH_QUICKTIME) - set(HAVE_QUICKTIME YES) -elseif(APPLE) - set(HAVE_QTKIT YES) +if (NOT IOS) + if(WITH_QUICKTIME) + set(HAVE_QUICKTIME YES) + elseif(APPLE) + set(HAVE_QTKIT YES) + endif() endif() diff --git a/cmake/OpenCVFindXimea.cmake b/cmake/OpenCVFindXimea.cmake index 27e2a78ad4..6b86b609e9 100644 --- a/cmake/OpenCVFindXimea.cmake +++ b/cmake/OpenCVFindXimea.cmake @@ -19,7 +19,7 @@ set(XIMEA_LIBRARY_DIR) if(WIN32) # Try to find the XIMEA API path in registry. GET_FILENAME_COMPONENT(XIMEA_PATH "[HKEY_CURRENT_USER\\Software\\XIMEA\\CamSupport\\API;Path]" ABSOLUTE) - + if(EXISTS ${XIMEA_PATH}) set(XIMEA_FOUND 1) # set LIB folders @@ -43,4 +43,4 @@ endif() mark_as_advanced(FORCE XIMEA_FOUND) mark_as_advanced(FORCE XIMEA_PATH) -mark_as_advanced(FORCE XIMEA_LIBRARY_DIR) \ No newline at end of file +mark_as_advanced(FORCE XIMEA_LIBRARY_DIR) diff --git a/cmake/OpenCVGenInfoPlist.cmake b/cmake/OpenCVGenInfoPlist.cmake new file mode 100644 index 0000000000..97c674ceb7 --- /dev/null +++ b/cmake/OpenCVGenInfoPlist.cmake @@ -0,0 +1,4 @@ +if(IOS) + configure_file("${OpenCV_SOURCE_DIR}/platforms/ios/Info.plist.in" + "${CMAKE_BINARY_DIR}/ios/Info.plist") +endif() diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake index 59366eb03b..ddf0290673 100644 --- a/cmake/OpenCVUtils.cmake +++ b/cmake/OpenCVUtils.cmake @@ -77,7 +77,7 @@ MACRO(ocv_check_compiler_flag LANG FLAG RESULT) if(_fname) MESSAGE(STATUS "Performing Test ${RESULT}") TRY_COMPILE(${RESULT} - ${CMAKE_BINARY_DIR} + "${CMAKE_BINARY_DIR}" "${_fname}" COMPILE_DEFINITIONS "${FLAG}" OUTPUT_VARIABLE OUTPUT) @@ -515,4 +515,4 @@ function(ocv_source_group group) cmake_parse_arguments(OCV_SOURCE_GROUP "" "" "GLOB" ${ARGN}) file(GLOB srcs ${OCV_SOURCE_GROUP_GLOB}) source_group(${group} FILES ${srcs}) -endfunction() \ No newline at end of file +endfunction() diff --git a/cmake/checks/OpenCVDetectCudaArch.cu b/cmake/checks/OpenCVDetectCudaArch.cu index 008f8ba8d0..9d7086cf24 100644 --- a/cmake/checks/OpenCVDetectCudaArch.cu +++ b/cmake/checks/OpenCVDetectCudaArch.cu @@ -11,4 +11,4 @@ int main() printf("%d.%d ", prop.major, prop.minor); } return 0; -} \ No newline at end of file +} diff --git a/cmake/checks/vfwtest.cpp b/cmake/checks/vfwtest.cpp index 63d545788f..8d8ecb2719 100644 --- a/cmake/checks/vfwtest.cpp +++ b/cmake/checks/vfwtest.cpp @@ -7,4 +7,4 @@ int main() AVIFileInit(); AVIFileExit(); return 0; -} \ No newline at end of file +} diff --git a/cmake/checks/winrttest.cpp b/cmake/checks/winrttest.cpp index 2b1d5fa2ad..9ec0c9ac1f 100644 --- a/cmake/checks/winrttest.cpp +++ b/cmake/checks/winrttest.cpp @@ -3,4 +3,4 @@ int main(int, char**) { return 0; -} \ No newline at end of file +} diff --git a/cmake/cl2cpp.cmake b/cmake/cl2cpp.cmake index 4f18e9e643..1e932eabdb 100644 --- a/cmake/cl2cpp.cmake +++ b/cmake/cl2cpp.cmake @@ -32,4 +32,4 @@ foreach(cl ${cl_list}) file(APPEND ${OUTPUT} "const char* ${cl_filename}=\"${lines};\n") endforeach() -file(APPEND ${OUTPUT} "}\n}\n") \ No newline at end of file +file(APPEND ${OUTPUT} "}\n}\n") diff --git a/cmake/templates/cmake_uninstall.cmake.in b/cmake/templates/cmake_uninstall.cmake.in index 14e601019d..0e63d705cd 100644 --- a/cmake/templates/cmake_uninstall.cmake.in +++ b/cmake/templates/cmake_uninstall.cmake.in @@ -23,5 +23,3 @@ FOREACH(file ${files}) MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") ENDIF(EXISTS "$ENV{DESTDIR}${file}") ENDFOREACH(file) - - diff --git a/cmake/templates/opencv_modules.hpp.in b/cmake/templates/opencv_modules.hpp.in index 5d58e40e4c..1498715028 100644 --- a/cmake/templates/opencv_modules.hpp.in +++ b/cmake/templates/opencv_modules.hpp.in @@ -6,4 +6,4 @@ * */ -@OPENCV_MODULE_DEFINITIONS_CONFIGMAKE@ \ No newline at end of file +@OPENCV_MODULE_DEFINITIONS_CONFIGMAKE@ diff --git a/doc/_static/insertIframe.js b/doc/_static/insertIframe.js index 904ff361de..0a3099a8c2 100644 --- a/doc/_static/insertIframe.js +++ b/doc/_static/insertIframe.js @@ -1,4 +1,4 @@ -function insertIframe (elementId, iframeSrc) +function insertIframe (elementId, iframeSrc) { var iframe; if (document.createElement && (iframe = document.createElement('iframe'))) @@ -10,4 +10,3 @@ function insertIframe (elementId, iframeSrc) element.parentNode.replaceChild(iframe, element); } } - diff --git a/doc/_themes/blue/static/default.css_t b/doc/_themes/blue/static/default.css_t index 49a57e9ec3..4d410be8aa 100644 --- a/doc/_themes/blue/static/default.css_t +++ b/doc/_themes/blue/static/default.css_t @@ -387,4 +387,4 @@ div.sphinxsidebar #searchbox input[type="text"] { div.sphinxsidebar #searchbox input[type="submit"] { width:auto; -} \ No newline at end of file +} diff --git a/doc/_themes/blue/theme.conf b/doc/_themes/blue/theme.conf index 206193f6f2..bc0b99b2a3 100644 --- a/doc/_themes/blue/theme.conf +++ b/doc/_themes/blue/theme.conf @@ -28,4 +28,4 @@ feedbacklinkcolor = #ffffff bodyfont = sans-serif headfont = 'Trebuchet MS', sans-serif guifont = "Lucida Sans","Lucida Sans Unicode","Lucida Grande",Verdana,Arial,Helvetica,sans-serif -lang = none \ No newline at end of file +lang = none diff --git a/doc/check_docs.py b/doc/check_docs.py index c18bf07261..0290fc70f4 100755 --- a/doc/check_docs.py +++ b/doc/check_docs.py @@ -184,5 +184,3 @@ p = RSTParser() for m in opencv_module_list: print "\n\n*************************** " + m + " *************************\n" p.check_module_docs(m) - - diff --git a/doc/mymath.sty b/doc/mymath.sty index 491c160cc3..4da8282121 100644 --- a/doc/mymath.sty +++ b/doc/mymath.sty @@ -39,4 +39,3 @@ #7 & #8 & #9 \end{bmatrix} } - diff --git a/doc/opencv_cheatsheet.tex b/doc/opencv_cheatsheet.tex index e76bd016e9..fc0c0fa41b 100644 --- a/doc/opencv_cheatsheet.tex +++ b/doc/opencv_cheatsheet.tex @@ -75,11 +75,11 @@ % if using A4 paper. (This probably isn't strictly necessary.) % If using another size paper, use default 1cm margins. \ifthenelse{\lengthtest { \paperwidth = 11in}} - { \geometry{top=.5in,left=.5in,right=.5in,bottom=.5in} } - {\ifthenelse{ \lengthtest{ \paperwidth = 297mm}} - {\geometry{top=1cm,left=1cm,right=1cm,bottom=1cm} } - {\geometry{top=1cm,left=1cm,right=1cm,bottom=1cm} } - } + { \geometry{top=.5in,left=.5in,right=.5in,bottom=.5in} } + {\ifthenelse{ \lengthtest{ \paperwidth = 297mm}} + {\geometry{top=1cm,left=1cm,right=1cm,bottom=1cm} } + {\geometry{top=1cm,left=1cm,right=1cm,bottom=1cm} } + } % Turn off header and footer % \pagestyle{empty} diff --git a/doc/pattern_tools/svgfig.py b/doc/pattern_tools/svgfig.py index 86afa59133..c690c9ff08 100755 --- a/doc/pattern_tools/svgfig.py +++ b/doc/pattern_tools/svgfig.py @@ -3667,4 +3667,3 @@ class YErrorBars: output.append(LineAxis(x, start, x, end, start, end, bars, False, False, **self.attr).SVG(trans)) return output - diff --git a/doc/tutorials/bioinspired/retina_model/retina_model.rst b/doc/tutorials/bioinspired/retina_model/retina_model.rst index 32081dfd28..e8527ee8b6 100644 --- a/doc/tutorials/bioinspired/retina_model/retina_model.rst +++ b/doc/tutorials/bioinspired/retina_model/retina_model.rst @@ -130,7 +130,7 @@ To compile it, assuming OpenCV is correctly installed, use the following command Here is a code explanation : -Retina definition is present in the bioinspired package and a simple include allows to use it. You can rather use the specific header : *opencv2/bioinspired.hpp* if you prefer but then include the other required openv modules : *opencv2/core.hpp* and *opencv2/highgui.hpp* +Retina definition is present in the bioinspired package and a simple include allows to use it. You can rather use the specific header : *opencv2/bioinspired.hpp* if you prefer but then include the other required openv modules : *opencv2/core.hpp* and *opencv2/highgui.hpp* .. code-block:: cpp diff --git a/doc/tutorials/calib3d/camera_calibration/camera_calibration.rst b/doc/tutorials/calib3d/camera_calibration/camera_calibration.rst index 4e807698e3..2cf00f42a9 100644 --- a/doc/tutorials/calib3d/camera_calibration/camera_calibration.rst +++ b/doc/tutorials/calib3d/camera_calibration/camera_calibration.rst @@ -8,23 +8,23 @@ Cameras have been around for a long-long time. However, with the introduction of Theory ====== -For the distortion OpenCV takes into account the radial and tangential factors. For the radial factor 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:: 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) -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. +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. It can be corrected 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:: x_{corrected} = x + [ 2p_1xy + p_2(r^2+2x^2)] \\ y_{corrected} = y + [ p_1(r^2+ 2y^2)+ 2p_2xy] -So we have five distortion parameters which in OpenCV are presented as one row matrix with 5 columns: +So we have five distortion parameters which in OpenCV are presented as one row matrix with 5 columns: .. math:: @@ -38,7 +38,7 @@ Now for the unit conversion we use the following formula: 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. 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: +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 @@ -148,7 +148,7 @@ Explanation Depending on the type of the input pattern you use either the :calib3d:`findChessboardCorners ` or the :calib3d:`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 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 ` 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 ` 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 ` 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 ` function. .. code-block:: cpp @@ -175,7 +175,7 @@ Explanation drawChessboardCorners( view, s.boardSize, Mat(pointBuf), found ); } -#. **Show state and result to the user, plus command line control of the application**. This part shows text output on the 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 @@ -199,7 +199,7 @@ Explanation if( blinkOutput ) bitwise_not(view, view); - If we ran calibration and got camera's matrix with the distortion coefficients we may want to correct the image using :imgproc_geometric:`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 ` function: .. code-block:: cpp @@ -229,7 +229,7 @@ Explanation 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 do this after the loop. Taking advantage of this now I'll expand the :imgproc_geometric:`undistort ` function, which is in fact first calls :imgproc_geometric:`initUndistortRectifyMap ` to find transformation matrices and then performs transformation using :imgproc_geometric:`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: +#. **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 ` function, which is in fact first calls :imgproc_geometric:`initUndistortRectifyMap ` to find transformation matrices and then performs transformation using :imgproc_geometric:`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 @@ -256,7 +256,7 @@ Explanation The calibration and save ======================== -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. +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: @@ -280,7 +280,7 @@ Therefore in the first function we just split up these two processes. Because we return ok; } -We do the calibration with the help of the :calib3d:`calibrateCamera ` function. It has the following parameters: +We do the calibration with the help of the :calib3d:`calibrateCamera ` function. It has the following parameters: .. container:: enumeratevisibleitemswithsquare @@ -318,11 +318,11 @@ We do the calibration with the help of the :calib3d:`calibrateCamera ` or :calib3d:`findCirclesGrid ` function. 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 ` or :calib3d:`findCirclesGrid ` function. We just need to pass it on. + The size of the image acquired from the camera, video file or the images. - + The camera matrix. If we used the fixed 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 @@ -336,16 +336,16 @@ We do the calibration with the help of the :calib3d:`calibrateCamera ` 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. + + 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 ` 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 @@ -378,7 +378,7 @@ We do the calibration with the help of the :calib3d:`calibrateCamera ` 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: +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 @@ -396,7 +396,7 @@ Let there be :download:`this input chessboard pattern <../../../pattern.png>` wh -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: +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 :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. -5.7843597214487474e-001 -Add these values as constants to your program, call the :imgproc_geometric:`initUndistortRectifyMap ` and the :imgproc_geometric:`remap ` function to remove distortion and enjoy distortion free inputs for cheap and low quality cameras. +Add these values as constants to your program, call the :imgproc_geometric:`initUndistortRectifyMap ` and the :imgproc_geometric:`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 `_. diff --git a/doc/tutorials/calib3d/camera_calibration_square_chess/camera_calibration_square_chess.rst b/doc/tutorials/calib3d/camera_calibration_square_chess/camera_calibration_square_chess.rst index 4eff2640ad..e08550750d 100644 --- a/doc/tutorials/calib3d/camera_calibration_square_chess/camera_calibration_square_chess.rst +++ b/doc/tutorials/calib3d/camera_calibration_square_chess/camera_calibration_square_chess.rst @@ -59,4 +59,4 @@ Now, let us write a code that detects a chessboard in a new image and finds its #. Calculate reprojection error like it is done in ``calibration`` sample (see ``opencv/samples/cpp/calibration.cpp``, function ``computeReprojectionErrors``). -Question: how to calculate the distance from the camera origin to any of the corners? \ No newline at end of file +Question: how to calculate the distance from the camera origin to any of the corners? diff --git a/doc/tutorials/core/file_input_output_with_xml_yml/file_input_output_with_xml_yml.rst b/doc/tutorials/core/file_input_output_with_xml_yml/file_input_output_with_xml_yml.rst index 87166b7cc3..42f6a60915 100644 --- a/doc/tutorials/core/file_input_output_with_xml_yml/file_input_output_with_xml_yml.rst +++ b/doc/tutorials/core/file_input_output_with_xml_yml/file_input_output_with_xml_yml.rst @@ -277,4 +277,3 @@ You may observe a runtime instance of this on the `YouTube here - diff --git a/doc/tutorials/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.rst b/doc/tutorials/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.rst index 99d6692743..9285509b07 100644 --- a/doc/tutorials/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.rst +++ b/doc/tutorials/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.rst @@ -127,6 +127,3 @@ You may observe a runtime instance of this on the `YouTube here - - - diff --git a/doc/tutorials/core/table_of_content_core/table_of_content_core.rst b/doc/tutorials/core/table_of_content_core/table_of_content_core.rst index b50d97635f..4150265d10 100644 --- a/doc/tutorials/core/table_of_content_core/table_of_content_core.rst +++ b/doc/tutorials/core/table_of_content_core/table_of_content_core.rst @@ -218,4 +218,4 @@ Here you will learn the about the basic building blocks of the library. A must r ../random_generator_and_text/random_generator_and_text ../discrete_fourier_transform/discrete_fourier_transform ../file_input_output_with_xml_yml/file_input_output_with_xml_yml - ../interoperability_with_OpenCV_1/interoperability_with_OpenCV_1 \ No newline at end of file + ../interoperability_with_OpenCV_1/interoperability_with_OpenCV_1 diff --git a/doc/tutorials/definitions/README.txt b/doc/tutorials/definitions/README.txt index 829e27cacb..a598a95dd7 100644 --- a/doc/tutorials/definitions/README.txt +++ b/doc/tutorials/definitions/README.txt @@ -1 +1 @@ -Include in this directory only defintion files. None of the reST files entered here will be parsed by the Sphinx Builder. \ No newline at end of file +Include in this directory only defintion files. None of the reST files entered here will be parsed by the Sphinx Builder. diff --git a/doc/tutorials/features2d/feature_description/feature_description.rst b/doc/tutorials/features2d/feature_description/feature_description.rst index 2d97f83be8..b6e2dfa2bd 100644 --- a/doc/tutorials/features2d/feature_description/feature_description.rst +++ b/doc/tutorials/features2d/feature_description/feature_description.rst @@ -100,6 +100,3 @@ Result .. image:: images/Feature_Description_BruteForce_Result.jpg :align: center :height: 200pt - - - diff --git a/doc/tutorials/features2d/table_of_content_features2d/table_of_content_features2d.rst b/doc/tutorials/features2d/table_of_content_features2d/table_of_content_features2d.rst index cc90082b85..f4107804bb 100644 --- a/doc/tutorials/features2d/table_of_content_features2d/table_of_content_features2d.rst +++ b/doc/tutorials/features2d/table_of_content_features2d/table_of_content_features2d.rst @@ -201,4 +201,3 @@ Learn about how to use the feature points detectors, descriptors and matching f ../feature_flann_matcher/feature_flann_matcher ../feature_homography/feature_homography ../detection_of_planar_objects/detection_of_planar_objects - diff --git a/doc/tutorials/features2d/trackingmotion/corner_subpixeles/corner_subpixeles.rst b/doc/tutorials/features2d/trackingmotion/corner_subpixeles/corner_subpixeles.rst index a267b13803..4e9015cb68 100644 --- a/doc/tutorials/features2d/trackingmotion/corner_subpixeles/corner_subpixeles.rst +++ b/doc/tutorials/features2d/trackingmotion/corner_subpixeles/corner_subpixeles.rst @@ -135,4 +135,3 @@ Here is the result: .. image:: images/Corner_Subpixeles_Result.jpg :align: center - diff --git a/doc/tutorials/features2d/trackingmotion/generic_corner_detector/generic_corner_detector.rst b/doc/tutorials/features2d/trackingmotion/generic_corner_detector/generic_corner_detector.rst index 465ff216cb..d33bf3df6c 100644 --- a/doc/tutorials/features2d/trackingmotion/generic_corner_detector/generic_corner_detector.rst +++ b/doc/tutorials/features2d/trackingmotion/generic_corner_detector/generic_corner_detector.rst @@ -37,4 +37,3 @@ Result .. image:: images/My_Shi_Tomasi_corner_detector_Result.jpg :align: center - diff --git a/doc/tutorials/features2d/trackingmotion/good_features_to_track/good_features_to_track.rst b/doc/tutorials/features2d/trackingmotion/good_features_to_track/good_features_to_track.rst index 9f71e987f2..1495befc75 100644 --- a/doc/tutorials/features2d/trackingmotion/good_features_to_track/good_features_to_track.rst +++ b/doc/tutorials/features2d/trackingmotion/good_features_to_track/good_features_to_track.rst @@ -118,5 +118,3 @@ Result .. image:: images/Feature_Detection_Result_a.jpg :align: center - - diff --git a/doc/tutorials/features2d/trackingmotion/harris_detector/harris_detector.rst b/doc/tutorials/features2d/trackingmotion/harris_detector/harris_detector.rst index 0f6bb33fa8..e0e4ea47e4 100644 --- a/doc/tutorials/features2d/trackingmotion/harris_detector/harris_detector.rst +++ b/doc/tutorials/features2d/trackingmotion/harris_detector/harris_detector.rst @@ -243,5 +243,3 @@ The detected corners are surrounded by a small black circle .. image:: images/Harris_Detector_Result.jpg :align: center - - diff --git a/doc/tutorials/general/table_of_content_general/table_of_content_general.rst b/doc/tutorials/general/table_of_content_general/table_of_content_general.rst index 2a6d57ffb9..6e127a98f6 100644 --- a/doc/tutorials/general/table_of_content_general/table_of_content_general.rst +++ b/doc/tutorials/general/table_of_content_general/table_of_content_general.rst @@ -10,4 +10,3 @@ These tutorials are the bottom of the iceberg as they link together multiple of .. raw:: latex \pagebreak - diff --git a/doc/tutorials/highgui/table_of_content_highgui/table_of_content_highgui.rst b/doc/tutorials/highgui/table_of_content_highgui/table_of_content_highgui.rst index 0ba7c323cb..ef6eacce27 100644 --- a/doc/tutorials/highgui/table_of_content_highgui/table_of_content_highgui.rst +++ b/doc/tutorials/highgui/table_of_content_highgui/table_of_content_highgui.rst @@ -74,4 +74,4 @@ This section contains valuable tutorials about how to read/save your image/video ../trackbar/trackbar ../video-input-psnr-ssim/video-input-psnr-ssim - ../video-write/video-write \ No newline at end of file + ../video-write/video-write diff --git a/doc/tutorials/highgui/trackbar/trackbar.rst b/doc/tutorials/highgui/trackbar/trackbar.rst index dabfa5e8cf..5749123c10 100644 --- a/doc/tutorials/highgui/trackbar/trackbar.rst +++ b/doc/tutorials/highgui/trackbar/trackbar.rst @@ -152,8 +152,3 @@ Result .. image:: images/Adding_Trackbars_Tutorial_Result_1.jpg :alt: Adding Trackbars - Lena :align: center - - - - - diff --git a/doc/tutorials/imgproc/histograms/histogram_calculation/histogram_calculation.rst b/doc/tutorials/imgproc/histograms/histogram_calculation/histogram_calculation.rst index 133a613add..9277a101d6 100644 --- a/doc/tutorials/imgproc/histograms/histogram_calculation/histogram_calculation.rst +++ b/doc/tutorials/imgproc/histograms/histogram_calculation/histogram_calculation.rst @@ -329,4 +329,3 @@ Result .. image:: images/Histogram_Calculation_Result.jpg :align: center - diff --git a/doc/tutorials/imgproc/histograms/template_matching/template_matching.rst b/doc/tutorials/imgproc/histograms/template_matching/template_matching.rst index d8a91560e9..afe15ee0dd 100644 --- a/doc/tutorials/imgproc/histograms/template_matching/template_matching.rst +++ b/doc/tutorials/imgproc/histograms/template_matching/template_matching.rst @@ -369,4 +369,3 @@ Results .. image:: images/Template_Matching_Image_Result.jpg :align: center - diff --git a/doc/tutorials/imgproc/imgtrans/canny_detector/canny_detector.rst b/doc/tutorials/imgproc/imgtrans/canny_detector/canny_detector.rst index 01c9050f26..ae2d0c8ace 100644 --- a/doc/tutorials/imgproc/imgtrans/canny_detector/canny_detector.rst +++ b/doc/tutorials/imgproc/imgtrans/canny_detector/canny_detector.rst @@ -282,6 +282,3 @@ Result :align: center * Notice how the image is superposed to the black background on the edge regions. - - - diff --git a/doc/tutorials/imgproc/imgtrans/hough_lines/hough_lines.rst b/doc/tutorials/imgproc/imgtrans/hough_lines/hough_lines.rst index 6b872bff51..d716c08323 100644 --- a/doc/tutorials/imgproc/imgtrans/hough_lines/hough_lines.rst +++ b/doc/tutorials/imgproc/imgtrans/hough_lines/hough_lines.rst @@ -290,4 +290,3 @@ We get the following result by using the Probabilistic Hough Line Transform: :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). - diff --git a/doc/tutorials/imgproc/imgtrans/remap/remap.rst b/doc/tutorials/imgproc/imgtrans/remap/remap.rst index a8b9fdf744..a060aa779e 100644 --- a/doc/tutorials/imgproc/imgtrans/remap/remap.rst +++ b/doc/tutorials/imgproc/imgtrans/remap/remap.rst @@ -311,4 +311,3 @@ Result :alt: Result 0 for remapping :width: 250pt :align: center - diff --git a/doc/tutorials/imgproc/imgtrans/warp_affine/warp_affine.rst b/doc/tutorials/imgproc/imgtrans/warp_affine/warp_affine.rst index b601929781..d61b493371 100644 --- a/doc/tutorials/imgproc/imgtrans/warp_affine/warp_affine.rst +++ b/doc/tutorials/imgproc/imgtrans/warp_affine/warp_affine.rst @@ -306,4 +306,3 @@ Result :alt: Original image :width: 250pt :align: center - diff --git a/doc/tutorials/imgproc/opening_closing_hats/opening_closing_hats.rst b/doc/tutorials/imgproc/opening_closing_hats/opening_closing_hats.rst index 6baa3a3d71..ca9d445464 100644 --- a/doc/tutorials/imgproc/opening_closing_hats/opening_closing_hats.rst +++ b/doc/tutorials/imgproc/opening_closing_hats/opening_closing_hats.rst @@ -279,4 +279,3 @@ Results .. image:: images/Morphology_2_Tutorial_Cover.jpg :alt: Morphology 2: Result sample :align: center - diff --git a/doc/tutorials/imgproc/pyramids/pyramids.rst b/doc/tutorials/imgproc/pyramids/pyramids.rst index 00baae2ac1..dacc5b93a1 100644 --- a/doc/tutorials/imgproc/pyramids/pyramids.rst +++ b/doc/tutorials/imgproc/pyramids/pyramids.rst @@ -259,5 +259,3 @@ Results .. image:: images/Pyramids_Tutorial_PyrUp_Result.jpg :alt: Pyramids: PyrUp Result :align: center - - diff --git a/doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.rst b/doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.rst index f91730ec88..24c276dc31 100644 --- a/doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.rst +++ b/doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.rst @@ -121,4 +121,3 @@ Result .. |BRC_1| image:: images/Bounding_Rects_Circles_Result.jpg :align: middle - diff --git a/doc/tutorials/imgproc/shapedescriptors/bounding_rotated_ellipses/bounding_rotated_ellipses.rst b/doc/tutorials/imgproc/shapedescriptors/bounding_rotated_ellipses/bounding_rotated_ellipses.rst index 0986e1edcd..9c7fbb85f6 100644 --- a/doc/tutorials/imgproc/shapedescriptors/bounding_rotated_ellipses/bounding_rotated_ellipses.rst +++ b/doc/tutorials/imgproc/shapedescriptors/bounding_rotated_ellipses/bounding_rotated_ellipses.rst @@ -123,4 +123,3 @@ Result .. |BRE_1| image:: images/Bounding_Rotated_Ellipses_Result.jpg :align: middle - diff --git a/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.rst b/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.rst index 1fca7df93a..68cf80dc7c 100644 --- a/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.rst +++ b/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.rst @@ -104,4 +104,3 @@ Result .. |contour_1| image:: images/Find_Contours_Result.jpg :align: middle - diff --git a/doc/tutorials/imgproc/shapedescriptors/hull/hull.rst b/doc/tutorials/imgproc/shapedescriptors/hull/hull.rst index c1ed79cea1..eb5d19e3b5 100644 --- a/doc/tutorials/imgproc/shapedescriptors/hull/hull.rst +++ b/doc/tutorials/imgproc/shapedescriptors/hull/hull.rst @@ -113,4 +113,3 @@ Result .. |Hull_1| image:: images/Hull_Result.jpg :align: middle - diff --git a/doc/tutorials/imgproc/shapedescriptors/moments/moments.rst b/doc/tutorials/imgproc/shapedescriptors/moments/moments.rst index 15ac2f51f7..350ca38d46 100644 --- a/doc/tutorials/imgproc/shapedescriptors/moments/moments.rst +++ b/doc/tutorials/imgproc/shapedescriptors/moments/moments.rst @@ -133,4 +133,3 @@ Result .. |MU_2| image:: images/Moments_Result2.jpg :width: 250pt :align: middle - diff --git a/doc/tutorials/imgproc/shapedescriptors/point_polygon_test/point_polygon_test.rst b/doc/tutorials/imgproc/shapedescriptors/point_polygon_test/point_polygon_test.rst index b7f72c8150..2d68cc2470 100644 --- a/doc/tutorials/imgproc/shapedescriptors/point_polygon_test/point_polygon_test.rst +++ b/doc/tutorials/imgproc/shapedescriptors/point_polygon_test/point_polygon_test.rst @@ -114,4 +114,3 @@ Result .. |PPT_1| image:: images/Point_Polygon_Test_Result.jpg :align: middle - diff --git a/doc/tutorials/imgproc/table_of_content_imgproc/table_of_content_imgproc.rst b/doc/tutorials/imgproc/table_of_content_imgproc/table_of_content_imgproc.rst index 1be239cfb1..a371c02c87 100644 --- a/doc/tutorials/imgproc/table_of_content_imgproc/table_of_content_imgproc.rst +++ b/doc/tutorials/imgproc/table_of_content_imgproc/table_of_content_imgproc.rst @@ -539,6 +539,3 @@ In this section you will learn about the image processing (manipulation) functio ../shapedescriptors/bounding_rotated_ellipses/bounding_rotated_ellipses ../shapedescriptors/moments/moments ../shapedescriptors/point_polygon_test/point_polygon_test - - - diff --git a/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.rst b/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.rst index c86ae378ca..243dc35dd8 100644 --- a/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.rst +++ b/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.rst @@ -125,9 +125,9 @@ designed mostly for development purposes. This approach is deprecated for the pr release package is recommended to communicate with OpenCV Manager via the async initialization described above. -#. Add the OpenCV library project to your workspace the same way as for the async initialization +#. Add the OpenCV library project to your workspace the same way as for the async initialization above. Use menu :guilabel:`File -> Import -> Existing project in your workspace`, - press :guilabel:`Browse` button and select OpenCV SDK path + press :guilabel:`Browse` button and select OpenCV SDK path (:file:`OpenCV-2.4.6-android-sdk/sdk`). .. image:: images/eclipse_opencv_dependency0.png diff --git a/doc/tutorials/introduction/linux_eclipse/linux_eclipse.rst b/doc/tutorials/introduction/linux_eclipse/linux_eclipse.rst index 451a875c84..74e0ff9e09 100644 --- a/doc/tutorials/introduction/linux_eclipse/linux_eclipse.rst +++ b/doc/tutorials/introduction/linux_eclipse/linux_eclipse.rst @@ -245,6 +245,3 @@ Say you have or create a new file, *helloworld.cpp* in a directory called *foo*: a. You can also optionally modify the ``Build command:`` from ``make`` to something like ``make VERBOSE=1 -j4`` which tells the compiler to produce detailed symbol files for debugging and also to compile in 4 parallel threads. #. Done! - - - diff --git a/doc/tutorials/introduction/linux_install/linux_install.rst b/doc/tutorials/introduction/linux_install/linux_install.rst index e8b96dab73..1e02b64c9d 100644 --- a/doc/tutorials/introduction/linux_install/linux_install.rst +++ b/doc/tutorials/introduction/linux_install/linux_install.rst @@ -80,4 +80,3 @@ Building OpenCV from Source Using CMake, Using the Command Line .. note:: If the size of the created library is a critical issue (like in case of an Android build) you can use the ``install/strip`` command to get the smallest size as possible. The *stripped* version appears to be twice as small. However, we do not recommend using this unless those extra megabytes do really matter. - diff --git a/doc/tutorials/ios/hello/hello.rst b/doc/tutorials/ios/hello/hello.rst index b2a37aa703..8435be54dc 100644 --- a/doc/tutorials/ios/hello/hello.rst +++ b/doc/tutorials/ios/hello/hello.rst @@ -73,4 +73,3 @@ Now we will learn how to write a simple Hello World Application in Xcode using O .. image:: images/output.png :alt: output :align: center - diff --git a/doc/tutorials/ios/image_manipulation/image_manipulation.rst b/doc/tutorials/ios/image_manipulation/image_manipulation.rst index fd2d9c6e3f..c4cde19907 100644 --- a/doc/tutorials/ios/image_manipulation/image_manipulation.rst +++ b/doc/tutorials/ios/image_manipulation/image_manipulation.rst @@ -127,4 +127,4 @@ Check out an instance of running code with more Image Effects on `YouTube - \ No newline at end of file + diff --git a/doc/tutorials/ml/introduction_to_svm/introduction_to_svm.rst b/doc/tutorials/ml/introduction_to_svm/introduction_to_svm.rst index 1b3abd660a..50f734803d 100644 --- a/doc/tutorials/ml/introduction_to_svm/introduction_to_svm.rst +++ b/doc/tutorials/ml/introduction_to_svm/introduction_to_svm.rst @@ -185,4 +185,3 @@ Results .. image:: images/result.png :alt: The seperated planes :align: center - diff --git a/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.rst b/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.rst index e778fad6a6..ba9c2740e2 100644 --- a/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.rst +++ b/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.rst @@ -130,4 +130,3 @@ Result .. image:: images/Cascade_Classifier_Tutorial_Result_LBP.jpg :align: center :height: 300pt - diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 1d5909616a..ed3b85a8fc 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -5,5 +5,3 @@ install(FILES ${old_hdrs} install(FILES "opencv2/opencv.hpp" DESTINATION ${OPENCV_INCLUDE_INSTALL_PATH}/opencv2 COMPONENT main) - - diff --git a/include/opencv/cv.h b/include/opencv/cv.h index 5a517dc739..1ed020a356 100644 --- a/include/opencv/cv.h +++ b/include/opencv/cv.h @@ -73,4 +73,3 @@ #endif //CV_IMPL #endif // __OPENCV_OLD_CV_H_ - diff --git a/include/opencv/cxeigen.hpp b/include/opencv/cxeigen.hpp index c503f713d6..1f04d1a3a2 100644 --- a/include/opencv/cxeigen.hpp +++ b/include/opencv/cxeigen.hpp @@ -46,4 +46,3 @@ #include "opencv2/core/eigen.hpp" #endif - diff --git a/modules/androidcamera/camera_wrapper/camera_wrapper.h b/modules/androidcamera/camera_wrapper/camera_wrapper.h index 88c9c4100b..430dea2dd5 100644 --- a/modules/androidcamera/camera_wrapper/camera_wrapper.h +++ b/modules/androidcamera/camera_wrapper/camera_wrapper.h @@ -14,4 +14,3 @@ double getCameraPropertyC(void* camera, int propIdx); void setCameraPropertyC(void* camera, int propIdx, double value); void applyCameraPropertiesC(void** camera); } - diff --git a/modules/androidcamera/include/camera_activity.hpp b/modules/androidcamera/include/camera_activity.hpp index 8aa25b620e..2af7befe30 100644 --- a/modules/androidcamera/include/camera_activity.hpp +++ b/modules/androidcamera/include/camera_activity.hpp @@ -44,4 +44,4 @@ private: int frameHeight; }; -#endif \ No newline at end of file +#endif diff --git a/modules/calib3d/doc/calib3d.rst b/modules/calib3d/doc/calib3d.rst index 0ac8d51960..0c056843d2 100644 --- a/modules/calib3d/doc/calib3d.rst +++ b/modules/calib3d/doc/calib3d.rst @@ -6,4 +6,3 @@ calib3d. Camera Calibration and 3D Reconstruction :maxdepth: 2 camera_calibration_and_3d_reconstruction - diff --git a/modules/calib3d/include/opencv2/calib3d/calib3d.hpp b/modules/calib3d/include/opencv2/calib3d/calib3d.hpp index 302de229bd..b3da45edd5 100644 --- a/modules/calib3d/include/opencv2/calib3d/calib3d.hpp +++ b/modules/calib3d/include/opencv2/calib3d/calib3d.hpp @@ -45,4 +45,4 @@ #error this is a compatibility header which should not be used inside the OpenCV library #endif -#include "opencv2/calib3d.hpp" \ No newline at end of file +#include "opencv2/calib3d.hpp" diff --git a/modules/calib3d/src/calib3d_init.cpp b/modules/calib3d/src/calib3d_init.cpp index 06303bd985..6192c7998a 100644 --- a/modules/calib3d/src/calib3d_init.cpp +++ b/modules/calib3d/src/calib3d_init.cpp @@ -47,7 +47,7 @@ using namespace cv; ////////////////////////////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/modules/calib3d/src/compat_ptsetreg.cpp b/modules/calib3d/src/compat_ptsetreg.cpp index 74c9e00122..db3fc99561 100644 --- a/modules/calib3d/src/compat_ptsetreg.cpp +++ b/modules/calib3d/src/compat_ptsetreg.cpp @@ -428,4 +428,3 @@ CV_IMPL void cvConvertPointsHomogeneous( const CvMat* _src, CvMat* _dst ) dst.convertTo(dst0, dst0.type()); } } - diff --git a/modules/calib3d/src/epnp.cpp b/modules/calib3d/src/epnp.cpp index 7fb63254dc..edbcaffd39 100644 --- a/modules/calib3d/src/epnp.cpp +++ b/modules/calib3d/src/epnp.cpp @@ -621,4 +621,3 @@ void epnp::qr_solve(CvMat * A, CvMat * b, CvMat * X) pX[i] = (pb[i] - sum) / A2[i]; } } - diff --git a/modules/calib3d/src/five-point.cpp b/modules/calib3d/src/five-point.cpp index 3796627a00..88fb402726 100644 --- a/modules/calib3d/src/five-point.cpp +++ b/modules/calib3d/src/five-point.cpp @@ -529,16 +529,16 @@ int cv::recoverPose( InputArray E, InputArray _points1, InputArray _points2, Out mask4 = (Q.row(2) > 0) & mask4; mask4 = (Q.row(2) < dist) & mask4; - mask1 = mask1.t(); - mask2 = mask2.t(); - mask3 = mask3.t(); - mask4 = mask4.t(); + mask1 = mask1.t(); + mask2 = mask2.t(); + mask3 = mask3.t(); + mask4 = mask4.t(); // If _mask is given, then use it to filter outliers. if (!_mask.empty()) { Mat mask = _mask.getMat(); - CV_Assert(mask.size() == mask1.size()); + CV_Assert(mask.size() == mask1.size()); bitwise_and(mask, mask1, mask1); bitwise_and(mask, mask2, mask2); bitwise_and(mask, mask3, mask3); @@ -546,7 +546,7 @@ int cv::recoverPose( InputArray E, InputArray _points1, InputArray _points2, Out } if (_mask.empty() && _mask.needed()) { - _mask.create(mask1.size(), CV_8U); + _mask.create(mask1.size(), CV_8U); } CV_Assert(_R.needed() && _t.needed()); diff --git a/modules/calib3d/src/levmarq.cpp b/modules/calib3d/src/levmarq.cpp index 539c804e2b..31b96d098b 100644 --- a/modules/calib3d/src/levmarq.cpp +++ b/modules/calib3d/src/levmarq.cpp @@ -47,30 +47,30 @@ This is translation to C++ of the Matlab's LMSolve package by Miroslav Balda. Here is the original copyright: ============================================================================ - + Copyright (c) 2007, Miroslav Balda All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ @@ -112,7 +112,7 @@ public: gemm(J, r, 1, noArray(), 0, v, GEMM_1_T); Mat D = A.diag().clone(); - + const double Rlo = 0.25, Rhi = 0.75; double lambda = 1, lc = 0.75; int i, iter = 0; @@ -222,5 +222,5 @@ Ptr createLMSolver(const Ptr& cb, int maxIters) CV_Assert( !LMSolverImpl_info_auto.name().empty() ); return new LMSolverImpl(cb, maxIters); } - + } diff --git a/modules/calib3d/src/p3p.cpp b/modules/calib3d/src/p3p.cpp index 92e7954721..882868d6b8 100644 --- a/modules/calib3d/src/p3p.cpp +++ b/modules/calib3d/src/p3p.cpp @@ -411,4 +411,3 @@ bool p3p::jacobi_4x4(double * A, double * D, double * U) return false; } - diff --git a/modules/calib3d/src/p3p.h b/modules/calib3d/src/p3p.h index a58b0fa149..57f8d7df88 100644 --- a/modules/calib3d/src/p3p.h +++ b/modules/calib3d/src/p3p.h @@ -59,4 +59,3 @@ class p3p }; #endif // P3P_H - diff --git a/modules/calib3d/src/ptsetreg.cpp b/modules/calib3d/src/ptsetreg.cpp index c92d858dc0..da2da56c7a 100644 --- a/modules/calib3d/src/ptsetreg.cpp +++ b/modules/calib3d/src/ptsetreg.cpp @@ -534,4 +534,3 @@ int cv::estimateAffine3D(InputArray _from, InputArray _to, return createRANSACPointSetRegistrator(new Affine3DEstimatorCallback, 4, param1, param2)->run(dFrom, dTo, _out, _inliers); } - diff --git a/modules/calib3d/src/solvepnp.cpp b/modules/calib3d/src/solvepnp.cpp index e395b0dc55..698302b942 100644 --- a/modules/calib3d/src/solvepnp.cpp +++ b/modules/calib3d/src/solvepnp.cpp @@ -348,4 +348,3 @@ void cv::solvePnPRansac(InputArray _opoints, InputArray _ipoints, } return; } - diff --git a/modules/calib3d/src/stereosgbm.cpp b/modules/calib3d/src/stereosgbm.cpp index 508eb59b1f..700b70684a 100644 --- a/modules/calib3d/src/stereosgbm.cpp +++ b/modules/calib3d/src/stereosgbm.cpp @@ -1169,4 +1169,3 @@ void cv::validateDisparity( InputOutputArray _disp, InputArray _cost, int minDis } } } - diff --git a/modules/calib3d/test/test_affine3.cpp b/modules/calib3d/test/test_affine3.cpp index 196d428e45..62326e9203 100644 --- a/modules/calib3d/test/test_affine3.cpp +++ b/modules/calib3d/test/test_affine3.cpp @@ -52,30 +52,30 @@ TEST(Calib3d_Affine3f, accuracy) cv::Mat expected; cv::Rodrigues(rvec, expected); - - + + ASSERT_EQ(0, norm(cv::Mat(affine.matrix, false).colRange(0, 3).rowRange(0, 3) != expected)); ASSERT_EQ(0, norm(cv::Mat(affine.linear()) != expected)); - - + + cv::Matx33d R = cv::Matx33d::eye(); - + double angle = 50; R.val[0] = R.val[4] = std::cos(CV_PI*angle/180.0); R.val[3] = std::sin(CV_PI*angle/180.0); R.val[1] = -R.val[3]; - - + + cv::Affine3d affine1(cv::Mat(cv::Vec3d(0.2, 0.5, 0.3)).reshape(1, 1), cv::Vec3d(4, 5, 6)); cv::Affine3d affine2(R, cv::Vec3d(1, 1, 0.4)); - + cv::Affine3d result = affine1.inv() * affine2; - + expected = cv::Mat(affine1.matrix.inv(cv::DECOMP_SVD)) * cv::Mat(affine2.matrix, false); - + cv::Mat diff; cv::absdiff(expected, result.matrix, diff); - + ASSERT_LT(cv::norm(diff, cv::NORM_INF), 1e-15); } diff --git a/modules/calib3d/test/test_affine3d_estimator.cpp b/modules/calib3d/test/test_affine3d_estimator.cpp index ff061aacfa..f31e2e7324 100644 --- a/modules/calib3d/test/test_affine3d_estimator.cpp +++ b/modules/calib3d/test/test_affine3d_estimator.cpp @@ -195,4 +195,3 @@ void CV_Affine3D_EstTest::run( int /* start_from */) } TEST(Calib3d_EstimateAffineTransform, accuracy) { CV_Affine3D_EstTest test; test.safe_run(); } - diff --git a/modules/calib3d/test/test_cameracalibration_badarg.cpp b/modules/calib3d/test/test_cameracalibration_badarg.cpp index 91118e1ed2..3edab8becf 100644 --- a/modules/calib3d/test/test_cameracalibration_badarg.cpp +++ b/modules/calib3d/test/test_cameracalibration_badarg.cpp @@ -735,5 +735,3 @@ protected: TEST(Calib3d_CalibrateCamera_C, badarg) { CV_CameraCalibrationBadArgTest test; test.safe_run(); } TEST(Calib3d_Rodrigues_C, badarg) { CV_Rodrigues2BadArgTest test; test.safe_run(); } TEST(Calib3d_ProjectPoints_C, badarg) { CV_ProjectPoints2BadArgTest test; test.safe_run(); } - - diff --git a/modules/calib3d/test/test_chessboardgenerator.cpp b/modules/calib3d/test/test_chessboardgenerator.cpp index 3a5ebbc3a0..7c0bd34dc7 100644 --- a/modules/calib3d/test/test_chessboardgenerator.cpp +++ b/modules/calib3d/test/test_chessboardgenerator.cpp @@ -329,4 +329,3 @@ Mat cv::ChessBoardGenerator::operator ()(const Mat& bg, const Mat& camMat, const return generateChessBoard(bg, camMat, distCoeffs, zero, pb1, pb2, squareSize.width, squareSize.height, pts3d, corners); } - diff --git a/modules/calib3d/test/test_compose_rt.cpp b/modules/calib3d/test/test_compose_rt.cpp index b71288e6d4..577cc06270 100644 --- a/modules/calib3d/test/test_compose_rt.cpp +++ b/modules/calib3d/test/test_compose_rt.cpp @@ -212,4 +212,3 @@ protected: }; TEST(Calib3d_ComposeRT, accuracy) { CV_composeRT_Test test; test.safe_run(); } - diff --git a/modules/calib3d/test/test_modelest.cpp b/modules/calib3d/test/test_modelest.cpp index 5b0a860169..55cb79ebaf 100644 --- a/modules/calib3d/test/test_modelest.cpp +++ b/modules/calib3d/test/test_modelest.cpp @@ -229,4 +229,3 @@ void CV_ModelEstimator2_Test::run_func() TEST(Calib3d_ModelEstimator2, accuracy) { CV_ModelEstimator2_Test test; test.safe_run(); } #endif - diff --git a/modules/calib3d/test/test_precomp.hpp b/modules/calib3d/test/test_precomp.hpp index 3fe4480d5b..d670a4c220 100644 --- a/modules/calib3d/test/test_precomp.hpp +++ b/modules/calib3d/test/test_precomp.hpp @@ -21,4 +21,3 @@ namespace cvtest } #endif - diff --git a/modules/calib3d/test/test_reproject_image_to_3d.cpp b/modules/calib3d/test/test_reproject_image_to_3d.cpp index 3b44566abe..daf89e0f0d 100644 --- a/modules/calib3d/test/test_reproject_image_to_3d.cpp +++ b/modules/calib3d/test/test_reproject_image_to_3d.cpp @@ -173,4 +173,3 @@ protected: }; TEST(Calib3d_ReprojectImageTo3D, accuracy) { CV_ReprojectImageTo3DTest test; test.safe_run(); } - diff --git a/modules/calib3d/test/test_solvepnp_ransac.cpp b/modules/calib3d/test/test_solvepnp_ransac.cpp index c0aff188db..4d00d805b5 100644 --- a/modules/calib3d/test/test_solvepnp_ransac.cpp +++ b/modules/calib3d/test/test_solvepnp_ransac.cpp @@ -306,4 +306,4 @@ TEST(DISABLED_Calib3d_SolvePnPRansac, concurrency) EXPECT_LT(tnorm, 1e-6); } -#endif \ No newline at end of file +#endif diff --git a/modules/calib3d/test/test_undistort_points.cpp b/modules/calib3d/test/test_undistort_points.cpp index c1ace3d4df..5dabd213db 100644 --- a/modules/calib3d/test/test_undistort_points.cpp +++ b/modules/calib3d/test/test_undistort_points.cpp @@ -94,4 +94,4 @@ void CV_UndistortTest::run(int /* start_from */) } } -TEST(Calib3d_Undistort, accuracy) { CV_UndistortTest test; test.safe_run(); } \ No newline at end of file +TEST(Calib3d_Undistort, accuracy) { CV_UndistortTest test; test.safe_run(); } diff --git a/modules/contrib/doc/facerec/facerec_tutorial.rst b/modules/contrib/doc/facerec/facerec_tutorial.rst index 16b425d7ee..cbfb417971 100644 --- a/modules/contrib/doc/facerec/facerec_tutorial.rst +++ b/modules/contrib/doc/facerec/facerec_tutorial.rst @@ -626,5 +626,3 @@ CSV for the AT&T Facedatabase .. literalinclude:: etc/at.txt :language: none :linenos: - - diff --git a/modules/contrib/doc/facerec/index.rst b/modules/contrib/doc/facerec/index.rst index ce8a15e677..b871448c55 100644 --- a/modules/contrib/doc/facerec/index.rst +++ b/modules/contrib/doc/facerec/index.rst @@ -30,4 +30,3 @@ Indices and tables * :ref:`genindex` * :ref:`modindex` * :ref:`search` - diff --git a/modules/contrib/doc/facerec/src/CMakeLists.txt b/modules/contrib/doc/facerec/src/CMakeLists.txt index e56762ea49..94aa36fbe0 100644 --- a/modules/contrib/doc/facerec/src/CMakeLists.txt +++ b/modules/contrib/doc/facerec/src/CMakeLists.txt @@ -23,4 +23,3 @@ target_link_libraries(facerec_fisherfaces opencv_contrib opencv_core opencv_imgp add_executable(facerec_lbph facerec_lbph.cpp) target_link_libraries(facerec_lbph opencv_contrib opencv_core opencv_imgproc opencv_highgui) - diff --git a/modules/contrib/doc/facerec/tutorial/facerec_gender_classification.rst b/modules/contrib/doc/facerec/tutorial/facerec_gender_classification.rst index 0c7398d2fb..770083170d 100644 --- a/modules/contrib/doc/facerec/tutorial/facerec_gender_classification.rst +++ b/modules/contrib/doc/facerec/tutorial/facerec_gender_classification.rst @@ -231,5 +231,3 @@ Here are some examples: +---------------------------------+----------------------------------------------------------------------------+ | 0.2 (20%), 0.2 (20%), (70,70) | .. image:: ../img/tutorial/gender_classification/arnie_20_20_70_70.jpg | +---------------------------------+----------------------------------------------------------------------------+ - - diff --git a/modules/contrib/doc/facerec/tutorial/facerec_save_load.rst b/modules/contrib/doc/facerec/tutorial/facerec_save_load.rst index 7948bcd73a..2d0b65dffd 100644 --- a/modules/contrib/doc/facerec/tutorial/facerec_save_load.rst +++ b/modules/contrib/doc/facerec/tutorial/facerec_save_load.rst @@ -44,4 +44,3 @@ And here is the Reconstruction, which is the same as the original: .. image:: ../img/eigenface_reconstruction_opencv.png :align: center - diff --git a/modules/contrib/doc/facerec/tutorial/facerec_video_recognition.rst b/modules/contrib/doc/facerec/tutorial/facerec_video_recognition.rst index b692fe5137..76e76eebe2 100644 --- a/modules/contrib/doc/facerec/tutorial/facerec_video_recognition.rst +++ b/modules/contrib/doc/facerec/tutorial/facerec_video_recognition.rst @@ -205,5 +205,3 @@ Here are some examples: +---------------------------------+----------------------------------------------------------------------------+ | 0.2 (20%), 0.2 (20%), (70,70) | .. image:: ../img/tutorial/gender_classification/arnie_20_20_70_70.jpg | +---------------------------------+----------------------------------------------------------------------------+ - - diff --git a/modules/contrib/doc/stereo.rst b/modules/contrib/doc/stereo.rst index d5f2d00801..103bd0f3fd 100644 --- a/modules/contrib/doc/stereo.rst +++ b/modules/contrib/doc/stereo.rst @@ -113,5 +113,3 @@ The method executes the variational algorithm on a rectified stereo pair. See `` **Note**: The method is not constant, so you should not use the same ``StereoVar`` instance from different threads simultaneously. - - diff --git a/modules/contrib/src/adaptiveskindetector.cpp b/modules/contrib/src/adaptiveskindetector.cpp index 1448e63842..092e48cb47 100644 --- a/modules/contrib/src/adaptiveskindetector.cpp +++ b/modules/contrib/src/adaptiveskindetector.cpp @@ -286,5 +286,3 @@ void CvAdaptiveSkinDetector::Histogram::mergeWith(CvAdaptiveSkinDetector::Histog } } }; - - diff --git a/modules/contrib/src/bowmsctrainer.cpp b/modules/contrib/src/bowmsctrainer.cpp index c1e945f9ba..3057691204 100644 --- a/modules/contrib/src/bowmsctrainer.cpp +++ b/modules/contrib/src/bowmsctrainer.cpp @@ -136,4 +136,3 @@ Mat BOWMSCTrainer::cluster(const Mat& _descriptors) const { } } - diff --git a/modules/contrib/src/chowliutree.cpp b/modules/contrib/src/chowliutree.cpp index 8c6acabdcd..d4aed5383a 100644 --- a/modules/contrib/src/chowliutree.cpp +++ b/modules/contrib/src/chowliutree.cpp @@ -287,4 +287,3 @@ bool ChowLiuTree::reduceEdgesToMinSpan(std::list& edges) { } } - diff --git a/modules/contrib/src/colortracker.cpp b/modules/contrib/src/colortracker.cpp index c1d91bb9b8..a3eeb052b2 100644 --- a/modules/contrib/src/colortracker.cpp +++ b/modules/contrib/src/colortracker.cpp @@ -132,5 +132,3 @@ Point2f CvMeanShiftTracker::getTrackingCenter() { return prev_center; } - - diff --git a/modules/contrib/src/contrib_init.cpp b/modules/contrib/src/contrib_init.cpp index a80f6f5e11..317867a59f 100644 --- a/modules/contrib/src/contrib_init.cpp +++ b/modules/contrib/src/contrib_init.cpp @@ -41,4 +41,3 @@ //M*/ #include "precomp.hpp" - diff --git a/modules/contrib/src/detection_based_tracker.cpp b/modules/contrib/src/detection_based_tracker.cpp index 49d09d1bfd..91bb0b1710 100644 --- a/modules/contrib/src/detection_based_tracker.cpp +++ b/modules/contrib/src/detection_based_tracker.cpp @@ -892,4 +892,3 @@ const cv::DetectionBasedTracker::Parameters& DetectionBasedTracker::getParameter } #endif - diff --git a/modules/contrib/src/featuretracker.cpp b/modules/contrib/src/featuretracker.cpp index e13d119b9f..e14c55c23f 100644 --- a/modules/contrib/src/featuretracker.cpp +++ b/modules/contrib/src/featuretracker.cpp @@ -221,4 +221,3 @@ Point2f CvFeatureTracker::getTrackingCenter() center.y = (float)(prev_center.y + prev_trackwindow.height/2.0); return center; } - diff --git a/modules/contrib/src/fuzzymeanshifttracker.cpp b/modules/contrib/src/fuzzymeanshifttracker.cpp index 7ad8cd838e..5e5ebc7e99 100644 --- a/modules/contrib/src/fuzzymeanshifttracker.cpp +++ b/modules/contrib/src/fuzzymeanshifttracker.cpp @@ -721,4 +721,3 @@ void CvFuzzyMeanShiftTracker::track(IplImage *maskImage, IplImage *depthMap, int searchMode = tsTracking; } }; - diff --git a/modules/contrib/src/hybridtracker.cpp b/modules/contrib/src/hybridtracker.cpp index 23a6ecbbad..d93f76d0d3 100644 --- a/modules/contrib/src/hybridtracker.cpp +++ b/modules/contrib/src/hybridtracker.cpp @@ -233,4 +233,3 @@ void CvHybridTracker::updateTrackerWithLowPassFilter(Mat) { Rect CvHybridTracker::getTrackingWindow() { return prev_window; } - diff --git a/modules/contrib/src/inputoutput.cpp b/modules/contrib/src/inputoutput.cpp index d0e947b33f..7f583558e8 100644 --- a/modules/contrib/src/inputoutput.cpp +++ b/modules/contrib/src/inputoutput.cpp @@ -10,7 +10,7 @@ namespace cv { - std::vector Directory::GetListFiles( const String& path, const String & exten, bool addPath ) + std::vector Directory::GetListFiles( const String& path, const String & exten, bool addPath ) { std::vector list; list.clear(); @@ -24,10 +24,9 @@ namespace cv HANDLE hFind; #ifdef HAVE_WINRT - size_t size = mbstowcs(NULL, path_f.c_str(), path_f.size()); - Ptr wpath = new wchar_t[size+1]; - wpath[size] = 0; - mbstowcs(wpath, path_f.c_str(), path_f.size()); + wchar_t wpath[MAX_PATH]; + size_t copied = mbstowcs(wpath, path_f.c_str(), MAX_PATH); + CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1)); hFind = FindFirstFileExW(wpath, FindExInfoStandard, &FindFileData, FindExSearchNameMatch, NULL, 0); #else hFind = FindFirstFileA((LPCSTR)path_f.c_str(), &FindFileData); @@ -46,12 +45,12 @@ namespace cv FindFileData.dwFileAttributes == FILE_ATTRIBUTE_SYSTEM || FindFileData.dwFileAttributes == FILE_ATTRIBUTE_READONLY) { - cv::Ptr fname; + char* fname; #ifdef HAVE_WINRT - size_t asize = wcstombs(NULL, FindFileData.cFileName, 0); - fname = new char[asize+1]; - fname[asize] = 0; - wcstombs(fname, FindFileData.cFileName, asize); + char fname_tmp[MAX_PATH] = {0}; + size_t copied = wcstombs(fname_tmp, FindFileData.cFileName, MAX_PATH); + CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1)); + fname = fname_tmp; #else fname = FindFileData.cFileName; #endif @@ -108,10 +107,10 @@ namespace cv HANDLE hFind; #ifdef HAVE_WINRT - size_t size = mbstowcs(NULL, path_f.c_str(), path_f.size()); - Ptr wpath = new wchar_t[size+1]; - wpath[size] = 0; - mbstowcs(wpath, path_f.c_str(), path_f.size()); + wchar_t wpath [MAX_PATH]; + size_t copied = mbstowcs(wpath, path_f.c_str(), path_f.size()); + CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1)); + hFind = FindFirstFileExW(wpath, FindExInfoStandard, &FindFileData, FindExSearchNameMatch, NULL, 0); #else hFind = FindFirstFileA((LPCSTR)path_f.c_str(), &FindFileData); @@ -134,12 +133,12 @@ namespace cv strcmp(FindFileData.cFileName, "..") != 0) #endif { - cv::Ptr fname; + char* fname; #ifdef HAVE_WINRT - size_t asize = wcstombs(NULL, FindFileData.cFileName, 0); - fname = new char[asize+1]; - fname[asize] = 0; - wcstombs(fname, FindFileData.cFileName, asize); + char fname_tmp[MAX_PATH]; + size_t copied = wcstombs(fname_tmp, FindFileData.cFileName, MAX_PATH); + CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1)); + fname = fname_tmp; #else fname = FindFileData.cFileName; #endif diff --git a/modules/contrib/src/lda.cpp b/modules/contrib/src/lda.cpp index 60693fc772..fe60e89237 100644 --- a/modules/contrib/src/lda.cpp +++ b/modules/contrib/src/lda.cpp @@ -1106,4 +1106,3 @@ Mat LDA::reconstruct(InputArray src) { } } - diff --git a/modules/contrib/src/logpolar_bsm.cpp b/modules/contrib/src/logpolar_bsm.cpp index 70c7437bbe..8327b0a2da 100644 --- a/modules/contrib/src/logpolar_bsm.cpp +++ b/modules/contrib/src/logpolar_bsm.cpp @@ -649,4 +649,3 @@ LogPolar_Adjacent::~LogPolar_Adjacent() } } - diff --git a/modules/contrib/src/stereovar.cpp b/modules/contrib/src/stereovar.cpp index 54dd82ac9f..b2141b1f15 100644 --- a/modules/contrib/src/stereovar.cpp +++ b/modules/contrib/src/stereovar.cpp @@ -408,4 +408,4 @@ void StereoVar::operator ()( const Mat& left, const Mat& right, Mat& disp ) u.release(); } -} // namespace \ No newline at end of file +} // namespace diff --git a/modules/contrib/test/test_precomp.hpp b/modules/contrib/test/test_precomp.hpp index de9e283ee2..992ff28dfa 100644 --- a/modules/contrib/test/test_precomp.hpp +++ b/modules/contrib/test/test_precomp.hpp @@ -14,4 +14,3 @@ #include #endif - diff --git a/modules/core/doc/basic_structures.rst b/modules/core/doc/basic_structures.rst index 7acd1e2186..353d404f7d 100644 --- a/modules/core/doc/basic_structures.rst +++ b/modules/core/doc/basic_structures.rst @@ -544,7 +544,7 @@ Range ----- .. ocv:class:: Range -Template class specifying a continuous subsequence (slice) of a sequence. +Template class specifying a continuous subsequence (slice) of a sequence. :: @@ -854,7 +854,7 @@ Mat --- .. ocv:class:: Mat -OpenCV C++ n-dimensional dense array class +OpenCV C++ n-dimensional dense array class :: class CV_EXPORTS Mat @@ -1369,7 +1369,7 @@ The method makes a new header for the specified row span of the matrix. Similarl Mat::colRange ------------- -Creates a matrix header for the specified row span. +Creates a matrix header for the specified column span. .. ocv:function:: Mat Mat::colRange(int startcol, int endcol) const @@ -2941,4 +2941,3 @@ The above methods are usually enough for users. If you want to make your own alg * Add public virtual method ``AlgorithmInfo* info() const;`` to your class. * Add constructor function, ``AlgorithmInfo`` instance and implement the ``info()`` method. The simplest way is to take http://code.opencv.org/projects/opencv/repository/revisions/master/entry/modules/ml/src/ml_init.cpp as the reference and modify it according to the list of your parameters. * Add some public function (e.g. ``initModule_()``) that calls info() of your algorithm and put it into the same source file as ``info()`` implementation. This is to force C++ linker to include this object file into the target application. See ``Algorithm::create()`` for details. - diff --git a/modules/core/doc/command_line_parser.rst b/modules/core/doc/command_line_parser.rst index 64c72020aa..c1f69f4e50 100644 --- a/modules/core/doc/command_line_parser.rst +++ b/modules/core/doc/command_line_parser.rst @@ -98,4 +98,3 @@ Use: # ./app -fps=aaa ERRORS: Exception: can not convert: [aaa] to [double] - diff --git a/modules/core/doc/core.rst b/modules/core/doc/core.rst index 9d4704da37..73bfc35367 100644 --- a/modules/core/doc/core.rst +++ b/modules/core/doc/core.rst @@ -16,4 +16,3 @@ core. The Core Functionality clustering utility_and_system_functions_and_macros opengl_interop - diff --git a/modules/core/doc/dynamic_structures.rst b/modules/core/doc/dynamic_structures.rst index 1f2abd480d..0f3df5d12e 100644 --- a/modules/core/doc/dynamic_structures.rst +++ b/modules/core/doc/dynamic_structures.rst @@ -1580,4 +1580,3 @@ Gathers all node pointers to a single sequence. :param storage: Container for the sequence The function puts pointers of all nodes reachable from ``first`` into a single sequence. The pointers are written sequentially in the depth-first order. - diff --git a/modules/core/doc/old_basic_structures.rst b/modules/core/doc/old_basic_structures.rst index d86daa4a51..906306dcb2 100644 --- a/modules/core/doc/old_basic_structures.rst +++ b/modules/core/doc/old_basic_structures.rst @@ -1677,4 +1677,3 @@ For example, `NumPy `_ arrays support the array interfa (480, 640, 3) 1 .. note:: In the new Python wrappers (**cv2** module) the function is not needed, since cv2 can process Numpy arrays (and this is the only supported array type). - diff --git a/modules/core/include/opencv2/core/affine.hpp b/modules/core/include/opencv2/core/affine.hpp index cf7b29cadb..ed8bd29a18 100644 --- a/modules/core/include/opencv2/core/affine.hpp +++ b/modules/core/include/opencv2/core/affine.hpp @@ -430,5 +430,3 @@ cv::Affine3::operator Eigen::Transform() const #endif /* __cplusplus */ #endif /* __OPENCV_CORE_AFFINE3_HPP__ */ - - diff --git a/modules/core/include/opencv2/core/cvstd.inl.hpp b/modules/core/include/opencv2/core/cvstd.inl.hpp index 3f29a1b675..8642b7442e 100644 --- a/modules/core/include/opencv2/core/cvstd.inl.hpp +++ b/modules/core/include/opencv2/core/cvstd.inl.hpp @@ -247,4 +247,4 @@ std::ostream& operator << (std::ostream& out, const Rect_<_Tp>& rect) #endif // OPENCV_NOSTL } // cv -#endif // __OPENCV_CORE_CVSTDINL_HPP__ \ No newline at end of file +#endif // __OPENCV_CORE_CVSTDINL_HPP__ diff --git a/modules/core/include/opencv2/core/types.hpp b/modules/core/include/opencv2/core/types.hpp index 67e551e628..3ca86add05 100644 --- a/modules/core/include/opencv2/core/types.hpp +++ b/modules/core/include/opencv2/core/types.hpp @@ -1922,4 +1922,4 @@ TermCriteria::TermCriteria(int _type, int _maxCount, double _epsilon) } // cv -#endif //__OPENCV_CORE_TYPES_HPP__ \ No newline at end of file +#endif //__OPENCV_CORE_TYPES_HPP__ diff --git a/modules/core/perf/perf_abs.cpp b/modules/core/perf/perf_abs.cpp index 691c6f7c4b..63cb06b638 100644 --- a/modules/core/perf/perf_abs.cpp +++ b/modules/core/perf/perf_abs.cpp @@ -24,4 +24,3 @@ PERF_TEST_P(Size_MatType, abs, TYPICAL_MATS_ABS) SANITY_CHECK(c); } - diff --git a/modules/core/perf/perf_bitwise.cpp b/modules/core/perf/perf_bitwise.cpp index 64a8dd8bd9..1308b7bf3e 100644 --- a/modules/core/perf/perf_bitwise.cpp +++ b/modules/core/perf/perf_bitwise.cpp @@ -73,4 +73,3 @@ PERF_TEST_P(Size_MatType, bitwise_xor, TYPICAL_MATS_BITW_ARITHM) SANITY_CHECK(c); } - diff --git a/modules/core/perf/perf_main.cpp b/modules/core/perf/perf_main.cpp index 79c28a645c..7c899c2446 100644 --- a/modules/core/perf/perf_main.cpp +++ b/modules/core/perf/perf_main.cpp @@ -1,3 +1,8 @@ #include "perf_precomp.hpp" +#ifdef _MSC_VER +# if _MSC_VER >= 1700 +# pragma warning(disable:4447) // Disable warning 'main' signature found without threading model +# endif +#endif CV_PERF_TEST_MAIN(core) diff --git a/modules/core/perf/perf_merge.cpp b/modules/core/perf/perf_merge.cpp index d82941a92b..e7e8d2fe3f 100644 --- a/modules/core/perf/perf_merge.cpp +++ b/modules/core/perf/perf_merge.cpp @@ -34,4 +34,4 @@ PERF_TEST_P( Size_SrcDepth_DstChannels, merge, TEST_CYCLE_MULTIRUN(runs) merge( (vector &)mv, dst ); SANITY_CHECK(dst, 1e-12); -} \ No newline at end of file +} diff --git a/modules/core/src/convert.cpp b/modules/core/src/convert.cpp index 97bd5ddd93..5cd6894600 100644 --- a/modules/core/src/convert.cpp +++ b/modules/core/src/convert.cpp @@ -1396,4 +1396,4 @@ CV_IMPL void cvNormalize( const CvArr* srcarr, CvArr* dstarr, cv::normalize( src, dst, a, b, norm_type, dst.type(), mask ); } -/* End of file. */ \ No newline at end of file +/* End of file. */ diff --git a/modules/core/src/glob.cpp b/modules/core/src/glob.cpp index e39cba0163..208b4e05cf 100644 --- a/modules/core/src/glob.cpp +++ b/modules/core/src/glob.cpp @@ -79,10 +79,9 @@ namespace dir->ent.d_name = 0; #ifdef HAVE_WINRT cv::String full_path = cv::String(path) + "\\*"; - size_t size = mbstowcs(NULL, full_path.c_str(), full_path.size()); - cv::Ptr wfull_path = new wchar_t[size+1]; - wfull_path[size] = 0; - mbstowcs(wfull_path, full_path.c_str(), full_path.size()); + wchar_t wfull_path[MAX_PATH]; + size_t copied = mbstowcs(wfull_path, full_path.c_str(), MAX_PATH); + CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1)); dir->handle = ::FindFirstFileExW(wfull_path, FindExInfoStandard, &dir->data, FindExSearchNameMatch, NULL, 0); #else @@ -106,6 +105,7 @@ namespace return 0; } size_t asize = wcstombs(NULL, dir->data.cFileName, 0); + CV_Assert((asize != 0) && (asize != (size_t)-1)); char* aname = new char[asize+1]; aname[asize] = 0; wcstombs(aname, dir->data.cFileName, asize); @@ -146,10 +146,9 @@ static bool isDir(const cv::String& path, DIR* dir) { WIN32_FILE_ATTRIBUTE_DATA all_attrs; #ifdef HAVE_WINRT - size_t size = mbstowcs(NULL, path.c_str(), path.size()); - cv::Ptr wpath = new wchar_t[size+1]; - wpath[size] = 0; - mbstowcs(wpath, path.c_str(), path.size()); + wchar_t wpath[MAX_PATH]; + size_t copied = mbstowcs(wpath, path.c_str(), MAX_PATH); + CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1)); ::GetFileAttributesExW(wpath, GetFileExInfoStandard, &all_attrs); #else ::GetFileAttributesExA(path.c_str(), GetFileExInfoStandard, &all_attrs); diff --git a/modules/core/src/lapack.cpp b/modules/core/src/lapack.cpp index 9e64697c31..f6bc7c88c9 100644 --- a/modules/core/src/lapack.cpp +++ b/modules/core/src/lapack.cpp @@ -1823,4 +1823,4 @@ cvSVBkSb( const CvArr* warr, const CvArr* uarr, cv::SVD::backSubst(w, u, v, rhs, dst); CV_Assert( dst.data == dst0.data ); -} \ No newline at end of file +} diff --git a/modules/core/src/parallel.cpp b/modules/core/src/parallel.cpp index 1ae8c96314..27d7ecc038 100644 --- a/modules/core/src/parallel.cpp +++ b/modules/core/src/parallel.cpp @@ -144,9 +144,9 @@ namespace { cv::Range r; r.start = (int)(wholeRange.start + - ((size_t)sr.start*(wholeRange.end - wholeRange.start) + nstripes/2)/nstripes); + ((uint64)sr.start*(wholeRange.end - wholeRange.start) + nstripes/2)/nstripes); r.end = sr.end >= nstripes ? wholeRange.end : (int)(wholeRange.start + - ((size_t)sr.end*(wholeRange.end - wholeRange.start) + nstripes/2)/nstripes); + ((uint64)sr.end*(wholeRange.end - wholeRange.start) + nstripes/2)/nstripes); (*body)(r); } cv::Range stripeRange() const { return cv::Range(0, nstripes); } diff --git a/modules/core/src/stat.cpp b/modules/core/src/stat.cpp index 780012c0ed..25729a9206 100644 --- a/modules/core/src/stat.cpp +++ b/modules/core/src/stat.cpp @@ -454,45 +454,45 @@ cv::Scalar cv::sum( InputArray _src ) { Mat src = _src.getMat(); int k, cn = src.channels(), depth = src.depth(); - + #if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7) - size_t total_size = src.total(); - int rows = src.size[0], cols = (int)(total_size/rows); - if( src.dims == 2 || (src.isContinuous() && cols > 0 && (size_t)rows*cols == total_size) ) - { - IppiSize sz = { cols, rows }; - int type = src.type(); - typedef IppStatus (CV_STDCALL* ippiSumFunc)(const void*, int, IppiSize, double *, int); - ippiSumFunc ippFunc = - type == CV_8UC1 ? (ippiSumFunc)ippiSum_8u_C1R : - type == CV_8UC3 ? (ippiSumFunc)ippiSum_8u_C3R : - type == CV_8UC4 ? (ippiSumFunc)ippiSum_8u_C4R : - type == CV_16UC1 ? (ippiSumFunc)ippiSum_16u_C1R : - type == CV_16UC3 ? (ippiSumFunc)ippiSum_16u_C3R : - type == CV_16UC4 ? (ippiSumFunc)ippiSum_16u_C4R : - type == CV_16SC1 ? (ippiSumFunc)ippiSum_16s_C1R : - type == CV_16SC3 ? (ippiSumFunc)ippiSum_16s_C3R : - type == CV_16SC4 ? (ippiSumFunc)ippiSum_16s_C4R : - type == CV_32FC1 ? (ippiSumFunc)ippiSum_32f_C1R : - type == CV_32FC3 ? (ippiSumFunc)ippiSum_32f_C3R : - type == CV_32FC4 ? (ippiSumFunc)ippiSum_32f_C4R : - 0; - if( ippFunc ) - { - Ipp64f res[4]; - if( ippFunc(src.data, src.step[0], sz, res, ippAlgHintAccurate) >= 0 ) - { - Scalar sc; - for( int i = 0; i < cn; i++ ) - { - sc[i] = res[i]; - } - return sc; - } - } - } -#endif - + size_t total_size = src.total(); + int rows = src.size[0], cols = (int)(total_size/rows); + if( src.dims == 2 || (src.isContinuous() && cols > 0 && (size_t)rows*cols == total_size) ) + { + IppiSize sz = { cols, rows }; + int type = src.type(); + typedef IppStatus (CV_STDCALL* ippiSumFunc)(const void*, int, IppiSize, double *, int); + ippiSumFunc ippFunc = + type == CV_8UC1 ? (ippiSumFunc)ippiSum_8u_C1R : + type == CV_8UC3 ? (ippiSumFunc)ippiSum_8u_C3R : + type == CV_8UC4 ? (ippiSumFunc)ippiSum_8u_C4R : + type == CV_16UC1 ? (ippiSumFunc)ippiSum_16u_C1R : + type == CV_16UC3 ? (ippiSumFunc)ippiSum_16u_C3R : + type == CV_16UC4 ? (ippiSumFunc)ippiSum_16u_C4R : + type == CV_16SC1 ? (ippiSumFunc)ippiSum_16s_C1R : + type == CV_16SC3 ? (ippiSumFunc)ippiSum_16s_C3R : + type == CV_16SC4 ? (ippiSumFunc)ippiSum_16s_C4R : + type == CV_32FC1 ? (ippiSumFunc)ippiSum_32f_C1R : + type == CV_32FC3 ? (ippiSumFunc)ippiSum_32f_C3R : + type == CV_32FC4 ? (ippiSumFunc)ippiSum_32f_C4R : + 0; + if( ippFunc ) + { + Ipp64f res[4]; + if( ippFunc(src.data, src.step[0], sz, res, ippAlgHintAccurate) >= 0 ) + { + Scalar sc; + for( int i = 0; i < cn; i++ ) + { + sc[i] = res[i]; + } + return sc; + } + } + } +#endif + SumFunc func = getSumFunc(depth); CV_Assert( cn <= 4 && func != 0 ); @@ -566,81 +566,81 @@ cv::Scalar cv::mean( InputArray _src, InputArray _mask ) CV_Assert( mask.empty() || mask.type() == CV_8U ); int k, cn = src.channels(), depth = src.depth(); - + #if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7) - size_t total_size = src.total(); - int rows = src.size[0], cols = (int)(total_size/rows); - if( src.dims == 2 || (src.isContinuous() && mask.isContinuous() && cols > 0 && (size_t)rows*cols == total_size) ) - { - IppiSize sz = { cols, rows }; - int type = src.type(); - if( !mask.empty() ) - { - typedef IppStatus (CV_STDCALL* ippiMaskMeanFuncC1)(const void *, int, void *, int, IppiSize, Ipp64f *); - ippiMaskMeanFuncC1 ippFuncC1 = - type == CV_8UC1 ? (ippiMaskMeanFuncC1)ippiMean_8u_C1MR : - type == CV_16UC1 ? (ippiMaskMeanFuncC1)ippiMean_16u_C1MR : - type == CV_32FC1 ? (ippiMaskMeanFuncC1)ippiMean_32f_C1MR : - 0; - if( ippFuncC1 ) - { - Ipp64f res; - if( ippFuncC1(src.data, src.step[0], mask.data, mask.step[0], sz, &res) >= 0 ) - { - return Scalar(res); - } - } - typedef IppStatus (CV_STDCALL* ippiMaskMeanFuncC3)(const void *, int, void *, int, IppiSize, int, Ipp64f *); - ippiMaskMeanFuncC3 ippFuncC3 = - type == CV_8UC3 ? (ippiMaskMeanFuncC3)ippiMean_8u_C3CMR : - type == CV_16UC3 ? (ippiMaskMeanFuncC3)ippiMean_16u_C3CMR : - type == CV_32FC3 ? (ippiMaskMeanFuncC3)ippiMean_32f_C3CMR : - 0; - if( ippFuncC3 ) - { - Ipp64f res1, res2, res3; - if( ippFuncC3(src.data, src.step[0], mask.data, mask.step[0], sz, 1, &res1) >= 0 && - ippFuncC3(src.data, src.step[0], mask.data, mask.step[0], sz, 2, &res2) >= 0 && - ippFuncC3(src.data, src.step[0], mask.data, mask.step[0], sz, 3, &res3) >= 0 ) - { - return Scalar(res1, res2, res3); - } - } - } - else - { - typedef IppStatus (CV_STDCALL* ippiMeanFunc)(const void*, int, IppiSize, double *, int); - ippiMeanFunc ippFunc = - type == CV_8UC1 ? (ippiMeanFunc)ippiMean_8u_C1R : - type == CV_8UC3 ? (ippiMeanFunc)ippiMean_8u_C3R : - type == CV_8UC4 ? (ippiMeanFunc)ippiMean_8u_C4R : - type == CV_16UC1 ? (ippiMeanFunc)ippiMean_16u_C1R : - type == CV_16UC3 ? (ippiMeanFunc)ippiMean_16u_C3R : - type == CV_16UC4 ? (ippiMeanFunc)ippiMean_16u_C4R : - type == CV_16SC1 ? (ippiMeanFunc)ippiMean_16s_C1R : - type == CV_16SC3 ? (ippiMeanFunc)ippiMean_16s_C3R : - type == CV_16SC4 ? (ippiMeanFunc)ippiMean_16s_C4R : - type == CV_32FC1 ? (ippiMeanFunc)ippiMean_32f_C1R : - type == CV_32FC3 ? (ippiMeanFunc)ippiMean_32f_C3R : - type == CV_32FC4 ? (ippiMeanFunc)ippiMean_32f_C4R : - 0; - if( ippFunc ) - { - Ipp64f res[4]; - if( ippFunc(src.data, src.step[0], sz, res, ippAlgHintAccurate) >= 0 ) - { - Scalar sc; - for( int i = 0; i < cn; i++ ) - { - sc[i] = res[i]; - } - return sc; - } - } - } - } + size_t total_size = src.total(); + int rows = src.size[0], cols = (int)(total_size/rows); + if( src.dims == 2 || (src.isContinuous() && mask.isContinuous() && cols > 0 && (size_t)rows*cols == total_size) ) + { + IppiSize sz = { cols, rows }; + int type = src.type(); + if( !mask.empty() ) + { + typedef IppStatus (CV_STDCALL* ippiMaskMeanFuncC1)(const void *, int, void *, int, IppiSize, Ipp64f *); + ippiMaskMeanFuncC1 ippFuncC1 = + type == CV_8UC1 ? (ippiMaskMeanFuncC1)ippiMean_8u_C1MR : + type == CV_16UC1 ? (ippiMaskMeanFuncC1)ippiMean_16u_C1MR : + type == CV_32FC1 ? (ippiMaskMeanFuncC1)ippiMean_32f_C1MR : + 0; + if( ippFuncC1 ) + { + Ipp64f res; + if( ippFuncC1(src.data, src.step[0], mask.data, mask.step[0], sz, &res) >= 0 ) + { + return Scalar(res); + } + } + typedef IppStatus (CV_STDCALL* ippiMaskMeanFuncC3)(const void *, int, void *, int, IppiSize, int, Ipp64f *); + ippiMaskMeanFuncC3 ippFuncC3 = + type == CV_8UC3 ? (ippiMaskMeanFuncC3)ippiMean_8u_C3CMR : + type == CV_16UC3 ? (ippiMaskMeanFuncC3)ippiMean_16u_C3CMR : + type == CV_32FC3 ? (ippiMaskMeanFuncC3)ippiMean_32f_C3CMR : + 0; + if( ippFuncC3 ) + { + Ipp64f res1, res2, res3; + if( ippFuncC3(src.data, src.step[0], mask.data, mask.step[0], sz, 1, &res1) >= 0 && + ippFuncC3(src.data, src.step[0], mask.data, mask.step[0], sz, 2, &res2) >= 0 && + ippFuncC3(src.data, src.step[0], mask.data, mask.step[0], sz, 3, &res3) >= 0 ) + { + return Scalar(res1, res2, res3); + } + } + } + else + { + typedef IppStatus (CV_STDCALL* ippiMeanFunc)(const void*, int, IppiSize, double *, int); + ippiMeanFunc ippFunc = + type == CV_8UC1 ? (ippiMeanFunc)ippiMean_8u_C1R : + type == CV_8UC3 ? (ippiMeanFunc)ippiMean_8u_C3R : + type == CV_8UC4 ? (ippiMeanFunc)ippiMean_8u_C4R : + type == CV_16UC1 ? (ippiMeanFunc)ippiMean_16u_C1R : + type == CV_16UC3 ? (ippiMeanFunc)ippiMean_16u_C3R : + type == CV_16UC4 ? (ippiMeanFunc)ippiMean_16u_C4R : + type == CV_16SC1 ? (ippiMeanFunc)ippiMean_16s_C1R : + type == CV_16SC3 ? (ippiMeanFunc)ippiMean_16s_C3R : + type == CV_16SC4 ? (ippiMeanFunc)ippiMean_16s_C4R : + type == CV_32FC1 ? (ippiMeanFunc)ippiMean_32f_C1R : + type == CV_32FC3 ? (ippiMeanFunc)ippiMean_32f_C3R : + type == CV_32FC4 ? (ippiMeanFunc)ippiMean_32f_C4R : + 0; + if( ippFunc ) + { + Ipp64f res[4]; + if( ippFunc(src.data, src.step[0], sz, res, ippAlgHintAccurate) >= 0 ) + { + Scalar sc; + for( int i = 0; i < cn; i++ ) + { + sc[i] = res[i]; + } + return sc; + } + } + } + } #endif - + SumFunc func = getSumFunc(depth); CV_Assert( cn <= 4 && func != 0 ); diff --git a/modules/core/src/stl.cpp b/modules/core/src/stl.cpp index 09ba66c21e..f03c1a2d79 100644 --- a/modules/core/src/stl.cpp +++ b/modules/core/src/stl.cpp @@ -66,4 +66,4 @@ void cv::String::deallocate() { cv::fastFree(data-1); } -} \ No newline at end of file +} diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp index 543353b641..738e863d76 100644 --- a/modules/core/src/system.cpp +++ b/modules/core/src/system.cpp @@ -42,6 +42,12 @@ #include "precomp.hpp" +#ifdef _MSC_VER +# if _MSC_VER >= 1700 +# pragma warning(disable:4447) // Disable warning 'main' signature found without threading model +# endif +#endif + #if defined WIN32 || defined _WIN32 || defined WINCE #ifndef _WIN32_WINNT // This is needed for the declaration of TryEnterCriticalSection in winbase.h with Visual Studio 2005 (and older?) #define _WIN32_WINNT 0x0400 // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx @@ -423,15 +429,14 @@ String tempfile( const char* suffix ) temp_file = temp_dir + std::wstring(L"\\") + temp_file; DeleteFileW(temp_file.c_str()); - size_t asize = wcstombs(NULL, temp_file.c_str(), 0); - Ptr aname = new char[asize+1]; - aname[asize] = 0; - wcstombs(aname, temp_file.c_str(), asize); + char aname[MAX_PATH]; + size_t copied = wcstombs(aname, temp_file.c_str(), MAX_PATH); + CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1)); fname = std::string(aname); RoUninitialize(); #else - char temp_dir2[MAX_PATH + 1] = { 0 }; - char temp_file[MAX_PATH + 1] = { 0 }; + char temp_dir2[MAX_PATH] = { 0 }; + char temp_file[MAX_PATH] = { 0 }; if (temp_dir == 0 || temp_dir[0] == 0) { diff --git a/modules/core/src/types.cpp b/modules/core/src/types.cpp index 4dbb06f31d..89e0042657 100644 --- a/modules/core/src/types.cpp +++ b/modules/core/src/types.cpp @@ -136,4 +136,4 @@ float KeyPoint::overlap( const KeyPoint& kp1, const KeyPoint& kp2 ) return ovrl; } -} // cv \ No newline at end of file +} // cv diff --git a/modules/core/test/test_ds.cpp b/modules/core/test/test_ds.cpp index d79786054a..cd76ca2fe9 100644 --- a/modules/core/test/test_ds.cpp +++ b/modules/core/test/test_ds.cpp @@ -2118,5 +2118,3 @@ TEST(Core_DS_Seq, sort_invert) { Core_SeqSortInvTest test; test.safe_run(); } TEST(Core_DS_Set, basic_operations) { Core_SetTest test; test.safe_run(); } TEST(Core_DS_Graph, basic_operations) { Core_GraphTest test; test.safe_run(); } TEST(Core_DS_Graph, scan) { Core_GraphScanTest test; test.safe_run(); } - - diff --git a/modules/core/test/test_dxt.cpp b/modules/core/test/test_dxt.cpp index 16025fa8f2..1c0c7b00bf 100644 --- a/modules/core/test/test_dxt.cpp +++ b/modules/core/test/test_dxt.cpp @@ -866,5 +866,3 @@ protected: }; TEST(Core_DFT, complex_output) { Core_DFTComplexOutputTest test; test.safe_run(); } - - diff --git a/modules/core/test/test_io.cpp b/modules/core/test/test_io.cpp index d88b1b0301..8644d8eeac 100644 --- a/modules/core/test/test_io.cpp +++ b/modules/core/test/test_io.cpp @@ -406,7 +406,7 @@ protected: Vec v1(15, 16, 17, 18, 19), ov1; Scalar sc1(20.0, 21.1, 22.2, 23.3), osc1; Range g1(7, 8), og1; - + FileStorage fs(fname, FileStorage::WRITE); fs << "mi" << mi; fs << "mv" << mv; diff --git a/modules/core/test/test_main.cpp b/modules/core/test/test_main.cpp index 3294fab2b0..d5400e20fd 100644 --- a/modules/core/test/test_main.cpp +++ b/modules/core/test/test_main.cpp @@ -1,7 +1,10 @@ -#ifdef HAVE_WINRT - #pragma warning(disable:4447) // Disable warning 'main' signature found without threading model +#ifdef _MSC_VER +# if _MSC_VER >= 1700 +# pragma warning(disable:4447) // Disable warning 'main' signature found without threading model +# endif #endif + #include "test_precomp.hpp" CV_TEST_MAIN("cv") diff --git a/modules/core/test/test_math.cpp b/modules/core/test/test_math.cpp index b9beeb7d30..377742386f 100644 --- a/modules/core/test/test_math.cpp +++ b/modules/core/test/test_math.cpp @@ -2755,4 +2755,3 @@ TEST(CovariationMatrixVectorOfMatWithMean, accuracy) } /* End of file. */ - diff --git a/modules/cudev/test/test_split_merge.cu b/modules/cudev/test/test_split_merge.cu index 82369e5ba6..3af24f5882 100644 --- a/modules/cudev/test/test_split_merge.cu +++ b/modules/cudev/test/test_split_merge.cu @@ -178,4 +178,3 @@ TYPED_TEST(SplitTest, C4) { SplitTest::test_c4(); } - diff --git a/modules/features2d/CMakeLists.txt b/modules/features2d/CMakeLists.txt index 7d36a58ac1..0b080cfb9a 100644 --- a/modules/features2d/CMakeLists.txt +++ b/modules/features2d/CMakeLists.txt @@ -1,3 +1,2 @@ set(the_description "2D Features Framework") ocv_define_module(features2d opencv_imgproc opencv_flann OPTIONAL opencv_highgui) - diff --git a/modules/features2d/doc/common_interfaces_of_generic_descriptor_matchers.rst b/modules/features2d/doc/common_interfaces_of_generic_descriptor_matchers.rst index fcdc8b9b0e..5a7f952bc2 100644 --- a/modules/features2d/doc/common_interfaces_of_generic_descriptor_matchers.rst +++ b/modules/features2d/doc/common_interfaces_of_generic_descriptor_matchers.rst @@ -274,5 +274,3 @@ Example: :: VectorDescriptorMatcher matcher( new SurfDescriptorExtractor, new BruteForceMatcher > ); - - diff --git a/modules/features2d/doc/drawing_function_of_keypoints_and_matches.rst b/modules/features2d/doc/drawing_function_of_keypoints_and_matches.rst index cc9850b9b5..68c68fc6c4 100644 --- a/modules/features2d/doc/drawing_function_of_keypoints_and_matches.rst +++ b/modules/features2d/doc/drawing_function_of_keypoints_and_matches.rst @@ -83,4 +83,4 @@ Draws keypoints. :param flags: Flags setting drawing features. Possible ``flags`` bit values are defined by ``DrawMatchesFlags``. See details above in :ocv:func:`drawMatches` . -.. note:: For Python API, flags are modified as `cv2.DRAW_MATCHES_FLAGS_DEFAULT`, `cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS`, `cv2.DRAW_MATCHES_FLAGS_DRAW_OVER_OUTIMG`, `cv2.DRAW_MATCHES_FLAGS_NOT_DRAW_SINGLE_POINTS` +.. note:: For Python API, flags are modified as `cv2.DRAW_MATCHES_FLAGS_DEFAULT`, `cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS`, `cv2.DRAW_MATCHES_FLAGS_DRAW_OVER_OUTIMG`, `cv2.DRAW_MATCHES_FLAGS_NOT_DRAW_SINGLE_POINTS` diff --git a/modules/features2d/doc/feature_detection_and_description.rst b/modules/features2d/doc/feature_detection_and_description.rst index 2fcdf0c42e..a6fe7c8fad 100644 --- a/modules/features2d/doc/feature_detection_and_description.rst +++ b/modules/features2d/doc/feature_detection_and_description.rst @@ -120,7 +120,7 @@ Finds keypoints in an image and computes their descriptors :param descriptors: The output descriptors. Pass ``cv::noArray()`` if you do not need it. :param useProvidedKeypoints: If it is true, then the method will use the provided vector of keypoints instead of detecting them. - + BRISK ----- diff --git a/modules/features2d/include/opencv2/features2d/features2d.hpp b/modules/features2d/include/opencv2/features2d/features2d.hpp index c825295ecd..e81df0ad08 100644 --- a/modules/features2d/include/opencv2/features2d/features2d.hpp +++ b/modules/features2d/include/opencv2/features2d/features2d.hpp @@ -45,4 +45,4 @@ #error this is a compatibility header which should not be used inside the OpenCV library #endif -#include "opencv2/features2d.hpp" \ No newline at end of file +#include "opencv2/features2d.hpp" diff --git a/modules/features2d/perf/perf_fast.cpp b/modules/features2d/perf/perf_fast.cpp index fe7396183c..25b82bd412 100644 --- a/modules/features2d/perf/perf_fast.cpp +++ b/modules/features2d/perf/perf_fast.cpp @@ -41,4 +41,3 @@ PERF_TEST_P(fast, detect, testing::Combine( SANITY_CHECK_KEYPOINTS(points); } - diff --git a/modules/features2d/src/bagofwords.cpp b/modules/features2d/src/bagofwords.cpp index 4307983fe0..a257f6cbe4 100644 --- a/modules/features2d/src/bagofwords.cpp +++ b/modules/features2d/src/bagofwords.cpp @@ -176,10 +176,10 @@ void BOWImgDescriptorExtractor::compute( const Mat& image, std::vector // Normalize image descriptor. imgDescriptor /= descriptors.rows; - + // Add the descriptors of image keypoints if (_descriptors) { - *_descriptors = descriptors.clone(); + *_descriptors = descriptors.clone(); } } diff --git a/modules/features2d/src/evaluation.cpp b/modules/features2d/src/evaluation.cpp index cdc5834d44..369ba44c91 100644 --- a/modules/features2d/src/evaluation.cpp +++ b/modules/features2d/src/evaluation.cpp @@ -257,7 +257,7 @@ struct IntersectAreaCounter { CV_Assert( miny < maxy ); CV_Assert( dr > FLT_EPSILON ); - + int temp_bua = bua, temp_bna = bna; for( int i = range.begin(); i != range.end(); i++ ) { diff --git a/modules/features2d/src/fast_score.cpp b/modules/features2d/src/fast_score.cpp index 423b1f950d..de697b7c90 100644 --- a/modules/features2d/src/fast_score.cpp +++ b/modules/features2d/src/fast_score.cpp @@ -357,4 +357,3 @@ int cornerScore<8>(const uchar* ptr, const int pixel[], int threshold) } } // namespace cv - diff --git a/modules/features2d/test/test_brisk.cpp b/modules/features2d/test/test_brisk.cpp index adac8e2e70..38e07c3f6f 100644 --- a/modules/features2d/test/test_brisk.cpp +++ b/modules/features2d/test/test_brisk.cpp @@ -93,4 +93,3 @@ void CV_BRISKTest::run( int ) } TEST(Features2d_BRISK, regression) { CV_BRISKTest test; test.safe_run(); } - diff --git a/modules/features2d/test/test_fast.cpp b/modules/features2d/test/test_fast.cpp index 76d7918640..d500ce549c 100644 --- a/modules/features2d/test/test_fast.cpp +++ b/modules/features2d/test/test_fast.cpp @@ -135,4 +135,3 @@ void CV_FastTest::run( int ) } TEST(Features2d_FAST, regression) { CV_FastTest test; test.safe_run(); } - diff --git a/modules/features2d/test/test_keypoints.cpp b/modules/features2d/test/test_keypoints.cpp index 7bc5c6e9a2..c689cd3722 100644 --- a/modules/features2d/test/test_keypoints.cpp +++ b/modules/features2d/test/test_keypoints.cpp @@ -166,5 +166,3 @@ TEST(Features2d_Detector_Keypoints_Dense, validation) CV_FeatureDetectorKeypointsTest test(Algorithm::create("Feature2D.Dense")); test.safe_run(); } - - diff --git a/modules/features2d/test/test_mser.cpp b/modules/features2d/test/test_mser.cpp index 1627886ba5..6b1b4ef639 100644 --- a/modules/features2d/test/test_mser.cpp +++ b/modules/features2d/test/test_mser.cpp @@ -205,4 +205,3 @@ void CV_MserTest::run(int) } TEST(Features2d_MSER, DISABLED_regression) { CV_MserTest test; test.safe_run(); } - diff --git a/modules/flann/CMakeLists.txt b/modules/flann/CMakeLists.txt index 645e8ce857..a6326c40a0 100644 --- a/modules/flann/CMakeLists.txt +++ b/modules/flann/CMakeLists.txt @@ -1,3 +1,2 @@ set(the_description "Clustering and Search in Multi-Dimensional Spaces") ocv_define_module(flann opencv_core) - diff --git a/modules/flann/include/opencv2/flann/flann.hpp b/modules/flann/include/opencv2/flann/flann.hpp index f40aaf79f3..227683f979 100644 --- a/modules/flann/include/opencv2/flann/flann.hpp +++ b/modules/flann/include/opencv2/flann/flann.hpp @@ -45,4 +45,4 @@ #error this is a compatibility header which should not be used inside the OpenCV library #endif -#include "opencv2/flann.hpp" \ No newline at end of file +#include "opencv2/flann.hpp" diff --git a/modules/flann/include/opencv2/flann/random.h b/modules/flann/include/opencv2/flann/random.h index 2a67352da3..a3cf5ec53d 100644 --- a/modules/flann/include/opencv2/flann/random.h +++ b/modules/flann/include/opencv2/flann/random.h @@ -131,5 +131,3 @@ public: } #endif //OPENCV_FLANN_RANDOM_H - - diff --git a/modules/flann/include/opencv2/flann/result_set.h b/modules/flann/include/opencv2/flann/result_set.h index 7bb709b76e..3adad46596 100644 --- a/modules/flann/include/opencv2/flann/result_set.h +++ b/modules/flann/include/opencv2/flann/result_set.h @@ -540,4 +540,3 @@ private: } #endif //OPENCV_FLANN_RESULTSET_H - diff --git a/modules/flann/src/flann.cpp b/modules/flann/src/flann.cpp index 43d0e1f2a0..7ebb7eda7a 100644 --- a/modules/flann/src/flann.cpp +++ b/modules/flann/src/flann.cpp @@ -54,4 +54,4 @@ namespace cvflann } void dummyfunc() {} -} \ No newline at end of file +} diff --git a/modules/gpu/doc/data_structures.rst b/modules/gpu/doc/data_structures.rst index 823d3c309f..2a21710356 100644 --- a/modules/gpu/doc/data_structures.rst +++ b/modules/gpu/doc/data_structures.rst @@ -309,4 +309,3 @@ Class that enables getting ``cudaStream_t`` from :ocv:class:`gpu::Stream` and is { CV_EXPORTS static cudaStream_t getStream(const Stream& stream); }; - diff --git a/modules/gpu/doc/introduction.rst b/modules/gpu/doc/introduction.rst index ef34c369b9..a1237629c5 100644 --- a/modules/gpu/doc/introduction.rst +++ b/modules/gpu/doc/introduction.rst @@ -60,4 +60,3 @@ With this algorithm, a dual GPU gave a 180 % performance increase comparing to the single Fermi GPU. For a source code example, see http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/gpu/. - diff --git a/modules/gpu/misc/mark_nvidia.py b/modules/gpu/misc/mark_nvidia.py index 08743fb136..80dc7f9cee 100755 --- a/modules/gpu/misc/mark_nvidia.py +++ b/modules/gpu/misc/mark_nvidia.py @@ -257,4 +257,3 @@ if __name__ == "__main__": outputFile = open(sys.argv[2], 'w') outputFile.writelines(lines) outputFile.close() - diff --git a/modules/gpu/src/calib3d.cpp b/modules/gpu/src/calib3d.cpp index 9e912582a0..631174218c 100644 --- a/modules/gpu/src/calib3d.cpp +++ b/modules/gpu/src/calib3d.cpp @@ -290,5 +290,3 @@ void cv::gpu::solvePnPRansac(const Mat& object, const Mat& image, const Mat& cam } #endif - - diff --git a/modules/gpuarithm/perf/perf_arithm.cpp b/modules/gpuarithm/perf/perf_arithm.cpp index dfeafa0fa4..b18c8a8c0e 100644 --- a/modules/gpuarithm/perf/perf_arithm.cpp +++ b/modules/gpuarithm/perf/perf_arithm.cpp @@ -84,7 +84,7 @@ PERF_TEST_P(Sz_Type_Flags, GEMM, TEST_CYCLE() cv::gpu::gemm(d_src1, d_src2, 1.0, d_src3, 1.0, dst, flags); - GPU_SANITY_CHECK(dst, 1e-6); + GPU_SANITY_CHECK(dst, 1e-6, ERROR_RELATIVE); } else { @@ -234,7 +234,7 @@ PERF_TEST_P(Sz_KernelSz_Ccorr, Convolve, TEST_CYCLE() convolution->convolve(d_image, d_templ, dst, ccorr); - GPU_SANITY_CHECK(dst); + GPU_SANITY_CHECK(dst, 1e-6, ERROR_RELATIVE); } else { diff --git a/modules/gpuarithm/src/element_operations.cpp b/modules/gpuarithm/src/element_operations.cpp index 3ec4f84f66..20473de381 100644 --- a/modules/gpuarithm/src/element_operations.cpp +++ b/modules/gpuarithm/src/element_operations.cpp @@ -1912,7 +1912,7 @@ void cv::gpu::bitwise_not(InputArray _src, OutputArray _dst, InputArray _mask, S } else { - bitMatNot( + bitMatNot( PtrStepSzb(src.rows, bcols, src.data, src.step), PtrStepSzb(src.rows, bcols, dst.data, dst.step), mask, stream); diff --git a/modules/gpuoptflow/src/tvl1flow.cpp b/modules/gpuoptflow/src/tvl1flow.cpp index e725e0f271..b9ef05ea1d 100644 --- a/modules/gpuoptflow/src/tvl1flow.cpp +++ b/modules/gpuoptflow/src/tvl1flow.cpp @@ -222,7 +222,8 @@ void cv::gpu::OpticalFlowDual_TVL1_GPU::procOneScale(const GpuMat& I0, const Gpu { estimateU(I1wx, I1wy, grad, rho_c, p11, p12, p21, p22, u1, u2, diff, l_t, static_cast(theta)); - error = gpu::sum(diff, norm_buf)[0]; + if (epsilon > 0) + error = gpu::sum(diff, norm_buf)[0]; estimateDualVariables(u1, u2, p11, p12, p21, p22, taut); } diff --git a/modules/gpuwarping/src/cuda/resize.cu b/modules/gpuwarping/src/cuda/resize.cu index 04c1fb2ac4..037718980d 100644 --- a/modules/gpuwarping/src/cuda/resize.cu +++ b/modules/gpuwarping/src/cuda/resize.cu @@ -49,254 +49,434 @@ #include "opencv2/core/cuda/vec_math.hpp" #include "opencv2/core/cuda/saturate_cast.hpp" #include "opencv2/core/cuda/filters.hpp" -#include "opencv2/core/cuda/scan.hpp" namespace cv { namespace gpu { namespace cudev { - namespace imgproc + // kernels + + template __global__ void resize_nearest(const PtrStep src, PtrStepSz dst, const float fy, const float fx) { - template __global__ void resize(const Ptr2D src, float fx, float fy, PtrStepSz dst) + const int dst_x = blockDim.x * blockIdx.x + threadIdx.x; + const int dst_y = blockDim.y * blockIdx.y + threadIdx.y; + + if (dst_x < dst.cols && dst_y < dst.rows) { - const int x = blockDim.x * blockIdx.x + threadIdx.x; - const int y = blockDim.y * blockIdx.y + threadIdx.y; + const float src_x = dst_x * fx; + const float src_y = dst_y * fy; - if (x < dst.cols && y < dst.rows) - { - const float xcoo = x * fx; - const float ycoo = y * fy; + dst(dst_y, dst_x) = src(__float2int_rz(src_y), __float2int_rz(src_x)); + } + } - dst(y, x) = saturate_cast(src(ycoo, xcoo)); - } + template __global__ void resize_linear(const PtrStepSz src, PtrStepSz dst, const float fy, const float fx) + { + typedef typename TypeVec::cn>::vec_type work_type; + + const int dst_x = blockDim.x * blockIdx.x + threadIdx.x; + const int dst_y = blockDim.y * blockIdx.y + threadIdx.y; + + if (dst_x < dst.cols && dst_y < dst.rows) + { + const float src_x = dst_x * fx; + const float src_y = dst_y * fy; + + work_type out = VecTraits::all(0); + + const int x1 = __float2int_rd(src_x); + const int y1 = __float2int_rd(src_y); + const int x2 = x1 + 1; + const int y2 = y1 + 1; + const int x2_read = ::min(x2, src.cols - 1); + const int y2_read = ::min(y2, src.rows - 1); + + T src_reg = src(y1, x1); + out = out + src_reg * ((x2 - src_x) * (y2 - src_y)); + + src_reg = src(y1, x2_read); + out = out + src_reg * ((src_x - x1) * (y2 - src_y)); + + src_reg = src(y2_read, x1); + out = out + src_reg * ((x2 - src_x) * (src_y - y1)); + + src_reg = src(y2_read, x2_read); + out = out + src_reg * ((src_x - x1) * (src_y - y1)); + + dst(dst_y, dst_x) = saturate_cast(out); } + } + + template __global__ void resize(const Ptr2D src, PtrStepSz dst, const float fy, const float fx) + { + const int dst_x = blockDim.x * blockIdx.x + threadIdx.x; + const int dst_y = blockDim.y * blockIdx.y + threadIdx.y; - template __global__ void resize_area(const Ptr2D src, float fx, float fy, PtrStepSz dst) + if (dst_x < dst.cols && dst_y < dst.rows) { - const int x = blockDim.x * blockIdx.x + threadIdx.x; - const int y = blockDim.y * blockIdx.y + threadIdx.y; + const float src_x = dst_x * fx; + const float src_y = dst_y * fy; - if (x < dst.cols && y < dst.rows) - { - dst(y, x) = saturate_cast(src(y, x)); - } + dst(dst_y, dst_x) = src(src_y, src_x); } + } - template