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 +.git* text export-ignore -*.aidl text -*.mk text +*.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/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..9fc762849f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -863,4 +863,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/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/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..26437669d5 100644 --- a/cmake/OpenCVCRTLinkage.cmake +++ b/cmake/OpenCVCRTLinkage.cmake @@ -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..907f93f2b1 100644 --- a/cmake/OpenCVCompilerOptions.cmake +++ b/cmake/OpenCVCompilerOptions.cmake @@ -294,4 +294,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 9f74d941fa..772cae886f 100644 --- a/cmake/OpenCVFindIPP.cmake +++ b/cmake/OpenCVFindIPP.cmake @@ -140,7 +140,7 @@ endfunction() # ------------------------------------------------------------------------ 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 IPP 7.x else() @@ -346,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/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/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake index 59366eb03b..cefe3d812f 100644 --- a/cmake/OpenCVUtils.cmake +++ b/cmake/OpenCVUtils.cmake @@ -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/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/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/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..afa2951128 100644 --- a/doc/tutorials/introduction/linux_install/linux_install.rst +++ b/doc/tutorials/introduction/linux_install/linux_install.rst @@ -81,3 +81,4 @@ Building OpenCV from Source Using CMake, Using the Command Line 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. + 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/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/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/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/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/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/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_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/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..df97b0478a 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 @@ -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/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/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_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/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/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/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_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/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/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/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/highgui/doc/qt_new_functions.rst b/modules/highgui/doc/qt_new_functions.rst index ee77e4d58c..3d11445b1d 100644 --- a/modules/highgui/doc/qt_new_functions.rst +++ b/modules/highgui/doc/qt_new_functions.rst @@ -334,5 +334,3 @@ See below various examples of the ``createButton`` function call: :: createButton("button6",callbackButton2,NULL,CV_PUSH_BUTTON,1); .. - - diff --git a/modules/highgui/doc/reading_and_writing_images_and_video.rst b/modules/highgui/doc/reading_and_writing_images_and_video.rst index dc1aa868a0..6b956b40dd 100644 --- a/modules/highgui/doc/reading_and_writing_images_and_video.rst +++ b/modules/highgui/doc/reading_and_writing_images_and_video.rst @@ -539,4 +539,3 @@ Writes the next video frame :param image: The written frame The functions/methods write the specified image to video file. It must have the same size as has been specified when opening the video writer. - diff --git a/modules/highgui/include/opencv2/highgui/ios.h b/modules/highgui/include/opencv2/highgui/ios.h index a78fbf72c7..a7f0395d71 100644 --- a/modules/highgui/include/opencv2/highgui/ios.h +++ b/modules/highgui/include/opencv2/highgui/ios.h @@ -46,4 +46,4 @@ UIImage* MatToUIImage(const cv::Mat& image); void UIImageToMat(const UIImage* image, - cv::Mat& m, bool alphaExist = false); \ No newline at end of file + cv::Mat& m, bool alphaExist = false); diff --git a/modules/highgui/perf/perf_input.cpp b/modules/highgui/perf/perf_input.cpp index 9dbc27ee7d..10ce30a83c 100644 --- a/modules/highgui/perf/perf_input.cpp +++ b/modules/highgui/perf/perf_input.cpp @@ -37,4 +37,4 @@ PERF_TEST_P(VideoCapture_Reading, ReadFile, testing::Values( "highgui/video/big_ SANITY_CHECK(dummy); } -#endif // BUILD_WITH_VIDEO_INPUT_SUPPORT \ No newline at end of file +#endif // BUILD_WITH_VIDEO_INPUT_SUPPORT diff --git a/modules/highgui/src/cap_avfoundation.mm b/modules/highgui/src/cap_avfoundation.mm index c7471e2e86..71777f8750 100644 --- a/modules/highgui/src/cap_avfoundation.mm +++ b/modules/highgui/src/cap_avfoundation.mm @@ -1325,4 +1325,3 @@ bool CvVideoWriter_AVFoundation::writeFrame(const IplImage* iplimage) { } } - diff --git a/modules/highgui/src/cap_ffmpeg_api.hpp b/modules/highgui/src/cap_ffmpeg_api.hpp index f492a25521..e7a956063c 100644 --- a/modules/highgui/src/cap_ffmpeg_api.hpp +++ b/modules/highgui/src/cap_ffmpeg_api.hpp @@ -96,4 +96,3 @@ typedef int (*Read_InputMediaStream_FFMPEG_Plugin)(struct InputMediaStream_FFMPE #endif #endif - diff --git a/modules/highgui/src/cap_ios_abstract_camera.mm b/modules/highgui/src/cap_ios_abstract_camera.mm index 38e1c12e68..a77e200a82 100644 --- a/modules/highgui/src/cap_ios_abstract_camera.mm +++ b/modules/highgui/src/cap_ios_abstract_camera.mm @@ -491,4 +491,3 @@ } @end - diff --git a/modules/highgui/src/cap_ios_video_camera.mm b/modules/highgui/src/cap_ios_video_camera.mm index ac85f79ee5..99f8a75ae6 100644 --- a/modules/highgui/src/cap_ios_video_camera.mm +++ b/modules/highgui/src/cap_ios_video_camera.mm @@ -388,7 +388,7 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;}; - (CVPixelBufferRef) pixelBufferFromCGImage: (CGImageRef) image { - + CGSize frameSize = CGSizeMake(CGImageGetWidth(image), CGImageGetHeight(image)); NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:NO], kCVPixelBufferCGImageCompatibilityKey, @@ -399,23 +399,23 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;}; frameSize.height, kCVPixelFormatType_32ARGB, (CFDictionaryRef) CFBridgingRetain(options), &pxbuffer); NSParameterAssert(status == kCVReturnSuccess && pxbuffer != NULL); - + CVPixelBufferLockBaseAddress(pxbuffer, 0); void *pxdata = CVPixelBufferGetBaseAddress(pxbuffer); - - + + CGColorSpaceRef rgbColorSpace = CGColorSpaceCreateDeviceRGB(); CGContextRef context = CGBitmapContextCreate(pxdata, frameSize.width, frameSize.height, 8, 4*frameSize.width, rgbColorSpace, kCGImageAlphaPremultipliedFirst); - + CGContextDrawImage(context, CGRectMake(0, 0, CGImageGetWidth(image), CGImageGetHeight(image)), image); CGColorSpaceRelease(rgbColorSpace); CGContextRelease(context); - + CVPixelBufferUnlockBaseAddress(pxbuffer, 0); - + return pxbuffer; } @@ -616,4 +616,3 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;}; } @end - diff --git a/modules/highgui/src/cap_libv4l.cpp b/modules/highgui/src/cap_libv4l.cpp index 6027caec26..3fd6dd59ad 100644 --- a/modules/highgui/src/cap_libv4l.cpp +++ b/modules/highgui/src/cap_libv4l.cpp @@ -14,7 +14,7 @@ It has been tested with the motempl sample program First Patch: August 24, 2004 Travis Wood TravisOCV@tkwood.com For Release: OpenCV-Linux Beta4 opencv-0.9.6 Tested On: LMLBT44 with 8 video inputs -Problems? Post your questions at answers.opencv.org, +Problems? Post your questions at answers.opencv.org, Report bugs at code.opencv.org, Submit your fixes at https://github.com/Itseez/opencv/ Patched Comments: diff --git a/modules/highgui/src/cap_msmf.cpp b/modules/highgui/src/cap_msmf.cpp index 76b9a215c5..df52f04bdf 100644 --- a/modules/highgui/src/cap_msmf.cpp +++ b/modules/highgui/src/cap_msmf.cpp @@ -3026,7 +3026,7 @@ double CvCaptureFile_MSMF::getProperty(int property_id) return ((double)captureFormats[captureFormatIndex].MF_MT_FRAME_RATE_NUMERATOR) / ((double)captureFormats[captureFormatIndex].MF_MT_FRAME_RATE_DENOMINATOR); } - + return -1; } @@ -3062,7 +3062,7 @@ IplImage* CvCaptureFile_MSMF::retrieveFrame(int) if(RIOut && size == RIOut->getSize()) { - videoInput::processPixels(RIOut->getpPixels(), (unsigned char*)frame->imageData, width, + videoInput::processPixels(RIOut->getpPixels(), (unsigned char*)frame->imageData, width, height, bytes, false, verticalFlip); } @@ -3532,4 +3532,4 @@ CvVideoWriter* cvCreateVideoWriter_MSMF( const char* filename, int fourcc, return NULL; } -#endif \ No newline at end of file +#endif diff --git a/modules/highgui/src/cap_qtkit.mm b/modules/highgui/src/cap_qtkit.mm index 02afb9bf54..8a7b3d84ec 100644 --- a/modules/highgui/src/cap_qtkit.mm +++ b/modules/highgui/src/cap_qtkit.mm @@ -411,9 +411,9 @@ int CvCaptureCAM::startCaptureDevice(int cameraNum) { void CvCaptureCAM::setWidthHeight() { NSAutoreleasePool* localpool = [[NSAutoreleasePool alloc] init]; - + [mCaptureSession stopRunning]; - + NSDictionary* pixelBufferOptions = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithDouble:1.0*width], (id)kCVPixelBufferWidthKey, [NSNumber numberWithDouble:1.0*height], (id)kCVPixelBufferHeightKey, @@ -422,9 +422,9 @@ void CvCaptureCAM::setWidthHeight() { nil]; [mCaptureDecompressedVideoOutput setPixelBufferAttributes:pixelBufferOptions]; - + [mCaptureSession startRunning]; - + grabFrame(60); [localpool drain]; } @@ -1044,4 +1044,3 @@ bool CvVideoWriter_QT::writeFrame(const IplImage* image) { return 1; } - diff --git a/modules/highgui/src/cap_v4l.cpp b/modules/highgui/src/cap_v4l.cpp index b4461ff25f..045c6f889c 100644 --- a/modules/highgui/src/cap_v4l.cpp +++ b/modules/highgui/src/cap_v4l.cpp @@ -14,7 +14,7 @@ It has been tested with the motempl sample program First Patch: August 24, 2004 Travis Wood TravisOCV@tkwood.com For Release: OpenCV-Linux Beta4 opencv-0.9.6 Tested On: LMLBT44 with 8 video inputs -Problems? Post your questions at answers.opencv.org, +Problems? Post your questions at answers.opencv.org, Report bugs at code.opencv.org, Submit your fixes at https://github.com/Itseez/opencv/ Patched Comments: diff --git a/modules/highgui/src/cap_ximea.cpp b/modules/highgui/src/cap_ximea.cpp index b14c113e81..7292727b76 100644 --- a/modules/highgui/src/cap_ximea.cpp +++ b/modules/highgui/src/cap_ximea.cpp @@ -218,7 +218,7 @@ void CvCaptureCAM_XIMEA::resetCvImage() default : return; } - } + } cvZero(frame); } /**********************************************************************************/ @@ -348,4 +348,4 @@ int CvCaptureCAM_XIMEA::getBpp() } } -/**********************************************************************************/ \ No newline at end of file +/**********************************************************************************/ diff --git a/modules/highgui/src/files_Qt/Milky/README.txt b/modules/highgui/src/files_Qt/Milky/README.txt index df2a2e83f4..01ab431457 100644 --- a/modules/highgui/src/files_Qt/Milky/README.txt +++ b/modules/highgui/src/files_Qt/Milky/README.txt @@ -16,4 +16,4 @@ The license does not permit the following uses: You may not use, or allow anyone else to use the icons to create pornographic, libelous, obscene, or defamatory material. -All icon files are provided "as is". You agree not to hold IconEden.com liable for any damages that may occur due to use, or inability to use, icons or image data from IconEden.com. \ No newline at end of file +All icon files are provided "as is". You agree not to hold IconEden.com liable for any damages that may occur due to use, or inability to use, icons or image data from IconEden.com. diff --git a/modules/highgui/src/grfmt_bmp.cpp b/modules/highgui/src/grfmt_bmp.cpp index 5f1083e435..131e84eca5 100644 --- a/modules/highgui/src/grfmt_bmp.cpp +++ b/modules/highgui/src/grfmt_bmp.cpp @@ -563,4 +563,3 @@ bool BmpEncoder::write( const Mat& img, const std::vector& ) } } - diff --git a/modules/highgui/src/ios_conversions.mm b/modules/highgui/src/ios_conversions.mm index 7295743c58..fa6208a17f 100644 --- a/modules/highgui/src/ios_conversions.mm +++ b/modules/highgui/src/ios_conversions.mm @@ -44,21 +44,21 @@ #include "precomp.hpp" UIImage* MatToUIImage(const cv::Mat& image) { - + NSData *data = [NSData dataWithBytes:image.data length:image.elemSize()*image.total()]; - + CGColorSpaceRef colorSpace; - + if (image.elemSize() == 1) { colorSpace = CGColorSpaceCreateDeviceGray(); } else { colorSpace = CGColorSpaceCreateDeviceRGB(); } - + CGDataProviderRef provider = CGDataProviderCreateWithCFData((__bridge CFDataRef)data); - + // Creating CGImage from cv::Mat CGImageRef imageRef = CGImageCreate(image.cols, image.rows, @@ -73,14 +73,14 @@ UIImage* MatToUIImage(const cv::Mat& image) { false, kCGRenderingIntentDefault ); - - + + // Getting UIImage from CGImage UIImage *finalImage = [UIImage imageWithCGImage:imageRef]; CGImageRelease(imageRef); CGDataProviderRelease(provider); CGColorSpaceRelease(colorSpace); - + return finalImage; } @@ -114,4 +114,4 @@ void UIImageToMat(const UIImage* image, image.CGImage); CGContextRelease(contextRef); CGColorSpaceRelease(colorSpace); -} \ No newline at end of file +} diff --git a/modules/highgui/src/window_QT.cpp b/modules/highgui/src/window_QT.cpp index 42fe502d4f..2b7775bd82 100644 --- a/modules/highgui/src/window_QT.cpp +++ b/modules/highgui/src/window_QT.cpp @@ -2474,7 +2474,7 @@ void DefaultViewPort::saveView() if (!fileName.isEmpty()) //save the picture { QString extension = fileName.right(3); - + // Create a new pixmap to render the viewport into QPixmap viewportPixmap(viewport()->size()); viewport()->render(&viewportPixmap); diff --git a/modules/highgui/test/test_fourcc.cpp b/modules/highgui/test/test_fourcc.cpp index 584b8c5964..82f699b098 100644 --- a/modules/highgui/test/test_fourcc.cpp +++ b/modules/highgui/test/test_fourcc.cpp @@ -112,4 +112,4 @@ TEST(Highgui_dshow, fourcc_conversion) EXPECT_EQ(fourcc, (unsigned long)(unsigned)fourccFromParam); } -} \ No newline at end of file +} diff --git a/modules/highgui/test/test_main.cpp b/modules/highgui/test/test_main.cpp index 363b54161e..4727b9565c 100644 --- a/modules/highgui/test/test_main.cpp +++ b/modules/highgui/test/test_main.cpp @@ -1,4 +1,3 @@ #include "test_precomp.hpp" CV_TEST_MAIN("highgui") - diff --git a/modules/highgui/test/test_positioning.cpp b/modules/highgui/test/test_positioning.cpp index 3968393536..edc8dcf42a 100644 --- a/modules/highgui/test/test_positioning.cpp +++ b/modules/highgui/test/test_positioning.cpp @@ -220,4 +220,4 @@ void CV_VideoRandomPositioningTest::run(int) #if BUILD_WITH_VIDEO_INPUT_SUPPORT && defined HAVE_FFMPEG TEST (Highgui_Video, seek_progressive) { CV_VideoProgressivePositioningTest test; test.safe_run(); } TEST (Highgui_Video, seek_random) { CV_VideoRandomPositioningTest test; test.safe_run(); } -#endif \ No newline at end of file +#endif diff --git a/modules/imgproc/doc/filtering.rst b/modules/imgproc/doc/filtering.rst index ee3dd2f6cd..7a1211d61b 100755 --- a/modules/imgproc/doc/filtering.rst +++ b/modules/imgproc/doc/filtering.rst @@ -1570,4 +1570,3 @@ is equivalent to .. seealso:: :ocv:func:`cartToPolar` - diff --git a/modules/imgproc/doc/geometric_transformations.rst b/modules/imgproc/doc/geometric_transformations.rst index ba8b3f6817..c94178f6cc 100644 --- a/modules/imgproc/doc/geometric_transformations.rst +++ b/modules/imgproc/doc/geometric_transformations.rst @@ -682,5 +682,3 @@ The function is similar to where ``undistort()`` is an approximate iterative algorithm that estimates the normalized original point coordinates out of the normalized distorted point coordinates ("normalized" means that the coordinates do not depend on the camera matrix). The function can be used for both a stereo camera head or a monocular camera (when R is empty). - - diff --git a/modules/imgproc/perf/perf_cornerEigenValsAndVecs.cpp b/modules/imgproc/perf/perf_cornerEigenValsAndVecs.cpp index 0e19da53a3..5a323cc2ab 100644 --- a/modules/imgproc/perf/perf_cornerEigenValsAndVecs.cpp +++ b/modules/imgproc/perf/perf_cornerEigenValsAndVecs.cpp @@ -37,4 +37,4 @@ PERF_TEST_P(Img_BlockSize_ApertureSize_BorderType, cornerEigenValsAndVecs, extractChannel(dst, l1, 0); SANITY_CHECK(l1, 2e-5); -} \ No newline at end of file +} diff --git a/modules/imgproc/perf/perf_cornerHarris.cpp b/modules/imgproc/perf/perf_cornerHarris.cpp index 1568100cd3..832845e7e7 100644 --- a/modules/imgproc/perf/perf_cornerHarris.cpp +++ b/modules/imgproc/perf/perf_cornerHarris.cpp @@ -36,4 +36,4 @@ PERF_TEST_P(Img_BlockSize_ApertureSize_k_BorderType, cornerHarris, TEST_CYCLE() cornerHarris(src, dst, blockSize, apertureSize, k, borderType); SANITY_CHECK(dst, 2e-5); -} \ No newline at end of file +} diff --git a/modules/imgproc/perf/perf_filter2d.cpp b/modules/imgproc/perf/perf_filter2d.cpp index e228e3385c..cfce852b71 100644 --- a/modules/imgproc/perf/perf_filter2d.cpp +++ b/modules/imgproc/perf/perf_filter2d.cpp @@ -72,5 +72,3 @@ PERF_TEST_P( Image_KernelSize, GaborFilter2d, SANITY_CHECK(filteredImage, 1e-3); } - - diff --git a/modules/imgproc/perf/perf_warp.cpp b/modules/imgproc/perf/perf_warp.cpp index e958a7e963..146528b6bb 100644 --- a/modules/imgproc/perf/perf_warp.cpp +++ b/modules/imgproc/perf/perf_warp.cpp @@ -221,4 +221,3 @@ PERF_TEST(Transform, getPerspectiveTransform) SANITY_CHECK(transformCoefficient, 1e-5); } - diff --git a/modules/imgproc/src/morph.cpp b/modules/imgproc/src/morph.cpp index 384972c70f..96b4bbef8a 100644 --- a/modules/imgproc/src/morph.cpp +++ b/modules/imgproc/src/morph.cpp @@ -1139,134 +1139,134 @@ private: #if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7) static bool IPPMorphReplicate(int op, const Mat &src, Mat &dst, const Mat &kernel, const Point &anchor) { - int type = src.type(); - const Mat* _src = &src; - Mat temp; - if( src.data == dst.data ) - { - src.copyTo(temp); - _src = &temp; - } - //DEPRECATED. Allocates and initializes morphology state structure for erosion or dilation operation. - typedef IppStatus (CV_STDCALL* ippiMorphologyInitAllocFunc)(int, const void*, IppiSize, IppiPoint, IppiMorphState **); - ippiMorphologyInitAllocFunc ippInitAllocFunc = - type == CV_8UC1 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_8u_C1R : - type == CV_8UC3 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_8u_C3R : - type == CV_8UC4 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_8u_C4R : - type == CV_32FC1 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_32f_C1R : - type == CV_32FC3 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_32f_C3R : - type == CV_32FC4 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_32f_C4R : - 0; - typedef IppStatus (CV_STDCALL* ippiMorphologyBorderReplicateFunc)(const void*, int, void *, int, IppiSize, IppiBorderType, IppiMorphState *); - ippiMorphologyBorderReplicateFunc ippFunc = 0; - switch( op ) - { - case MORPH_DILATE: - { - ippFunc = - type == CV_8UC1 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_8u_C1R : - type == CV_8UC3 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_8u_C3R : - type == CV_8UC4 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_8u_C4R : - type == CV_32FC1 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_32f_C1R : - type == CV_32FC3 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_32f_C3R : - type == CV_32FC4 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_32f_C4R : - 0; - break; - } - case MORPH_ERODE: - { - ippFunc = - type == CV_8UC1 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_8u_C1R : - type == CV_8UC3 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_8u_C3R : - type == CV_8UC4 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_8u_C4R : - type == CV_32FC1 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_32f_C1R : - type == CV_32FC3 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_32f_C3R : - type == CV_32FC4 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_32f_C4R : - 0; - break; - } - } - if( ippFunc && ippInitAllocFunc) - { - IppiMorphState* pState; - IppiSize roiSize = {src.cols, src.rows}; - IppiSize kernelSize = {kernel.cols, kernel.rows}; - IppiPoint point = {anchor.x, anchor.y}; - if( ippInitAllocFunc( roiSize.width, kernel.data, kernelSize, point, &pState ) < 0 ) - return false; - bool is_ok = ippFunc( _src->data, _src->step[0], dst.data, dst.step[0], roiSize, ippBorderRepl, pState ) >= 0; - ippiMorphologyFree(pState); - return is_ok; - } - return false; + int type = src.type(); + const Mat* _src = &src; + Mat temp; + if( src.data == dst.data ) + { + src.copyTo(temp); + _src = &temp; + } + //DEPRECATED. Allocates and initializes morphology state structure for erosion or dilation operation. + typedef IppStatus (CV_STDCALL* ippiMorphologyInitAllocFunc)(int, const void*, IppiSize, IppiPoint, IppiMorphState **); + ippiMorphologyInitAllocFunc ippInitAllocFunc = + type == CV_8UC1 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_8u_C1R : + type == CV_8UC3 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_8u_C3R : + type == CV_8UC4 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_8u_C4R : + type == CV_32FC1 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_32f_C1R : + type == CV_32FC3 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_32f_C3R : + type == CV_32FC4 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_32f_C4R : + 0; + typedef IppStatus (CV_STDCALL* ippiMorphologyBorderReplicateFunc)(const void*, int, void *, int, IppiSize, IppiBorderType, IppiMorphState *); + ippiMorphologyBorderReplicateFunc ippFunc = 0; + switch( op ) + { + case MORPH_DILATE: + { + ippFunc = + type == CV_8UC1 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_8u_C1R : + type == CV_8UC3 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_8u_C3R : + type == CV_8UC4 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_8u_C4R : + type == CV_32FC1 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_32f_C1R : + type == CV_32FC3 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_32f_C3R : + type == CV_32FC4 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_32f_C4R : + 0; + break; + } + case MORPH_ERODE: + { + ippFunc = + type == CV_8UC1 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_8u_C1R : + type == CV_8UC3 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_8u_C3R : + type == CV_8UC4 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_8u_C4R : + type == CV_32FC1 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_32f_C1R : + type == CV_32FC3 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_32f_C3R : + type == CV_32FC4 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_32f_C4R : + 0; + break; + } + } + if( ippFunc && ippInitAllocFunc) + { + IppiMorphState* pState; + IppiSize roiSize = {src.cols, src.rows}; + IppiSize kernelSize = {kernel.cols, kernel.rows}; + IppiPoint point = {anchor.x, anchor.y}; + if( ippInitAllocFunc( roiSize.width, kernel.data, kernelSize, point, &pState ) < 0 ) + return false; + bool is_ok = ippFunc( _src->data, _src->step[0], dst.data, dst.step[0], roiSize, ippBorderRepl, pState ) >= 0; + ippiMorphologyFree(pState); + return is_ok; + } + return false; } static bool IPPMorphOp(int op, InputArray _src, OutputArray _dst, - InputArray _kernel, - const Point &anchor, int iterations, - int borderType, const Scalar &borderValue) + InputArray _kernel, + const Point &anchor, int iterations, + int borderType, const Scalar &borderValue) { - Mat src = _src.getMat(), kernel = _kernel.getMat(); - if( !( src.depth() == CV_8U || src.depth() == CV_32F ) || ( iterations > 1 ) || - !( borderType == cv::BORDER_REPLICATE || (borderType == cv::BORDER_CONSTANT && borderValue == morphologyDefaultBorderValue()) ) - || !( op == MORPH_DILATE || op == MORPH_ERODE) ) - return false; - if( borderType == cv::BORDER_CONSTANT ) - { - int x, y; - for( y = 0; y < kernel.rows; y++ ) - { - if( kernel.at(y, anchor.x) != 0 ) - continue; - for( x = 0; x < kernel.cols; x++ ) - { - if( kernel.at(y,x) != 0 ) - return false; - } - } - for( x = 0; y < kernel.cols; x++ ) - { - if( kernel.at(anchor.y, x) != 0 ) - continue; - for( y = 0; y < kernel.rows; y++ ) - { - if( kernel.at(y,x) != 0 ) - return false; - } - } + Mat src = _src.getMat(), kernel = _kernel.getMat(); + if( !( src.depth() == CV_8U || src.depth() == CV_32F ) || ( iterations > 1 ) || + !( borderType == cv::BORDER_REPLICATE || (borderType == cv::BORDER_CONSTANT && borderValue == morphologyDefaultBorderValue()) ) + || !( op == MORPH_DILATE || op == MORPH_ERODE) ) + return false; + if( borderType == cv::BORDER_CONSTANT ) + { + int x, y; + for( y = 0; y < kernel.rows; y++ ) + { + if( kernel.at(y, anchor.x) != 0 ) + continue; + for( x = 0; x < kernel.cols; x++ ) + { + if( kernel.at(y,x) != 0 ) + return false; + } + } + for( x = 0; y < kernel.cols; x++ ) + { + if( kernel.at(anchor.y, x) != 0 ) + continue; + for( y = 0; y < kernel.rows; y++ ) + { + if( kernel.at(y,x) != 0 ) + return false; + } + } - } - Size ksize = kernel.data ? kernel.size() : Size(3,3); - Point normanchor = normalizeAnchor(anchor, ksize); + } + Size ksize = kernel.data ? kernel.size() : Size(3,3); + Point normanchor = normalizeAnchor(anchor, ksize); - CV_Assert( normanchor.inside(Rect(0, 0, ksize.width, ksize.height)) ); + CV_Assert( normanchor.inside(Rect(0, 0, ksize.width, ksize.height)) ); - _dst.create( src.size(), src.type() ); - Mat dst = _dst.getMat(); + _dst.create( src.size(), src.type() ); + Mat dst = _dst.getMat(); - if( iterations == 0 || kernel.rows*kernel.cols == 1 ) - { - src.copyTo(dst); - return true; - } + if( iterations == 0 || kernel.rows*kernel.cols == 1 ) + { + src.copyTo(dst); + return true; + } - if( !kernel.data ) - { - kernel = getStructuringElement(MORPH_RECT, Size(1+iterations*2,1+iterations*2)); - normanchor = Point(iterations, iterations); - iterations = 1; - } - else if( iterations > 1 && countNonZero(kernel) == kernel.rows*kernel.cols ) - { - normanchor = Point(normanchor.x*iterations, normanchor.y*iterations); - kernel = getStructuringElement(MORPH_RECT, - Size(ksize.width + (iterations-1)*(ksize.width-1), - ksize.height + (iterations-1)*(ksize.height-1)), - normanchor); - iterations = 1; - } + if( !kernel.data ) + { + kernel = getStructuringElement(MORPH_RECT, Size(1+iterations*2,1+iterations*2)); + normanchor = Point(iterations, iterations); + iterations = 1; + } + else if( iterations > 1 && countNonZero(kernel) == kernel.rows*kernel.cols ) + { + normanchor = Point(normanchor.x*iterations, normanchor.y*iterations); + kernel = getStructuringElement(MORPH_RECT, + Size(ksize.width + (iterations-1)*(ksize.width-1), + ksize.height + (iterations-1)*(ksize.height-1)), + normanchor); + iterations = 1; + } - return IPPMorphReplicate( op, src, dst, kernel, normanchor ); + return IPPMorphReplicate( op, src, dst, kernel, normanchor ); } #endif @@ -1277,8 +1277,8 @@ static void morphOp( int op, InputArray _src, OutputArray _dst, { #if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7) - if( IPPMorphOp(op, _src, _dst, _kernel, anchor, iterations, borderType, borderValue) ) - return; + if( IPPMorphOp(op, _src, _dst, _kernel, anchor, iterations, borderType, borderValue) ) + return; #endif Mat src = _src.getMat(), kernel = _kernel.getMat(); diff --git a/modules/imgproc/src/sumpixels.cpp b/modules/imgproc/src/sumpixels.cpp index 4ee941762a..229bbcb8c6 100644 --- a/modules/imgproc/src/sumpixels.cpp +++ b/modules/imgproc/src/sumpixels.cpp @@ -239,49 +239,49 @@ void cv::integral( InputArray _src, OutputArray _sum, OutputArray _sqsum, Output sdepth = CV_MAT_DEPTH(sdepth); #if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7) - if( ( depth == CV_8U ) && ( !_tilted.needed() ) ) - { - if( sdepth == CV_32F ) - { - if( cn == 1 ) - { - IppiSize srcRoiSize = ippiSize( src.cols, src.rows ); - _sum.create( isize, CV_MAKETYPE( sdepth, cn ) ); - sum = _sum.getMat(); - if( _sqsum.needed() ) - { - _sqsum.create( isize, CV_MAKETYPE( CV_64F, cn ) ); - sqsum = _sqsum.getMat(); - ippiSqrIntegral_8u32f64f_C1R( (const Ipp8u*)src.data, src.step, (Ipp32f*)sum.data, sum.step, (Ipp64f*)sqsum.data, sqsum.step, srcRoiSize, 0, 0 ); - } - else - { - ippiIntegral_8u32f_C1R( (const Ipp8u*)src.data, src.step, (Ipp32f*)sum.data, sum.step, srcRoiSize, 0 ); - } - return; - } - } - if( sdepth == CV_32S ) - { - if( cn == 1 ) - { - IppiSize srcRoiSize = ippiSize( src.cols, src.rows ); - _sum.create( isize, CV_MAKETYPE( sdepth, cn ) ); - sum = _sum.getMat(); - if( _sqsum.needed() ) - { - _sqsum.create( isize, CV_MAKETYPE( CV_64F, cn ) ); - sqsum = _sqsum.getMat(); - ippiSqrIntegral_8u32s64f_C1R( (const Ipp8u*)src.data, src.step, (Ipp32s*)sum.data, sum.step, (Ipp64f*)sqsum.data, sqsum.step, srcRoiSize, 0, 0 ); - } - else - { - ippiIntegral_8u32s_C1R( (const Ipp8u*)src.data, src.step, (Ipp32s*)sum.data, sum.step, srcRoiSize, 0 ); - } - return; - } - } - } + if( ( depth == CV_8U ) && ( !_tilted.needed() ) ) + { + if( sdepth == CV_32F ) + { + if( cn == 1 ) + { + IppiSize srcRoiSize = ippiSize( src.cols, src.rows ); + _sum.create( isize, CV_MAKETYPE( sdepth, cn ) ); + sum = _sum.getMat(); + if( _sqsum.needed() ) + { + _sqsum.create( isize, CV_MAKETYPE( CV_64F, cn ) ); + sqsum = _sqsum.getMat(); + ippiSqrIntegral_8u32f64f_C1R( (const Ipp8u*)src.data, src.step, (Ipp32f*)sum.data, sum.step, (Ipp64f*)sqsum.data, sqsum.step, srcRoiSize, 0, 0 ); + } + else + { + ippiIntegral_8u32f_C1R( (const Ipp8u*)src.data, src.step, (Ipp32f*)sum.data, sum.step, srcRoiSize, 0 ); + } + return; + } + } + if( sdepth == CV_32S ) + { + if( cn == 1 ) + { + IppiSize srcRoiSize = ippiSize( src.cols, src.rows ); + _sum.create( isize, CV_MAKETYPE( sdepth, cn ) ); + sum = _sum.getMat(); + if( _sqsum.needed() ) + { + _sqsum.create( isize, CV_MAKETYPE( CV_64F, cn ) ); + sqsum = _sqsum.getMat(); + ippiSqrIntegral_8u32s64f_C1R( (const Ipp8u*)src.data, src.step, (Ipp32s*)sum.data, sum.step, (Ipp64f*)sqsum.data, sqsum.step, srcRoiSize, 0, 0 ); + } + else + { + ippiIntegral_8u32s_C1R( (const Ipp8u*)src.data, src.step, (Ipp32s*)sum.data, sum.step, srcRoiSize, 0 ); + } + return; + } + } + } #endif _sum.create( isize, CV_MAKETYPE(sdepth, cn) ); diff --git a/modules/imgproc/test/test_approxpoly.cpp b/modules/imgproc/test/test_approxpoly.cpp index d087d541e1..c4973c31e6 100644 --- a/modules/imgproc/test/test_approxpoly.cpp +++ b/modules/imgproc/test/test_approxpoly.cpp @@ -356,4 +356,3 @@ _exit_: } TEST(Imgproc_ApproxPoly, accuracy) { CV_ApproxPolyTest test; test.safe_run(); } - diff --git a/modules/imgproc/test/test_convhull.cpp b/modules/imgproc/test/test_convhull.cpp index 19f536a944..cae75d0cb0 100644 --- a/modules/imgproc/test/test_convhull.cpp +++ b/modules/imgproc/test/test_convhull.cpp @@ -1700,4 +1700,3 @@ TEST(Imgproc_ContourPerimeterSlice, accuracy) { CV_PerimeterAreaSliceTest test; TEST(Imgproc_FitEllipse, small) { CV_FitEllipseSmallTest test; test.safe_run(); } /* End of file. */ - diff --git a/modules/imgproc/test/test_distancetransform.cpp b/modules/imgproc/test/test_distancetransform.cpp index 9ce9c6c423..dd3c2e8b41 100644 --- a/modules/imgproc/test/test_distancetransform.cpp +++ b/modules/imgproc/test/test_distancetransform.cpp @@ -283,5 +283,3 @@ void CV_DisTransTest::prepare_to_validation( int /*test_case_idx*/ ) TEST(Imgproc_DistanceTransform, accuracy) { CV_DisTransTest test; test.safe_run(); } - - diff --git a/modules/imgproc/test/test_filter.cpp b/modules/imgproc/test/test_filter.cpp index 6bf529b0e7..efbad99749 100644 --- a/modules/imgproc/test/test_filter.cpp +++ b/modules/imgproc/test/test_filter.cpp @@ -1886,4 +1886,3 @@ protected: }; TEST(Imgproc_Filtering, supportedFormats) { CV_FilterSupportedFormatsTest test; test.safe_run(); } - diff --git a/modules/imgproc/test/test_thresh.cpp b/modules/imgproc/test/test_thresh.cpp index 30a760da5c..f59fec19e1 100644 --- a/modules/imgproc/test/test_thresh.cpp +++ b/modules/imgproc/test/test_thresh.cpp @@ -318,4 +318,3 @@ void CV_ThreshTest::prepare_to_validation( int /*test_case_idx*/ ) } TEST(Imgproc_Threshold, accuracy) { CV_ThreshTest test; test.safe_run(); } - diff --git a/modules/imgproc/test/test_watershed.cpp b/modules/imgproc/test/test_watershed.cpp index 52cb37a4fc..0edb18e02e 100644 --- a/modules/imgproc/test/test_watershed.cpp +++ b/modules/imgproc/test/test_watershed.cpp @@ -130,4 +130,3 @@ void CV_WatershedTest::run( int /* start_from */) } TEST(Imgproc_Watershed, regression) { CV_WatershedTest test; test.safe_run(); } - diff --git a/modules/java/android_test/.gitignore b/modules/java/android_test/.gitignore index 2d406cbbcc..a21956836e 100644 --- a/modules/java/android_test/.gitignore +++ b/modules/java/android_test/.gitignore @@ -4,4 +4,4 @@ build.xml local.properties proguard-project.txt project.properties -default.properties \ No newline at end of file +default.properties diff --git a/modules/java/android_test/AndroidManifest.xml b/modules/java/android_test/AndroidManifest.xml index e261e2d706..dfe25fff08 100644 --- a/modules/java/android_test/AndroidManifest.xml +++ b/modules/java/android_test/AndroidManifest.xml @@ -4,7 +4,7 @@ android:versionCode="1" android:versionName="1.0"> - + - diff --git a/samples/winrt/ImageManipulations/MainPage.xaml b/samples/winrt/ImageManipulations/MainPage.xaml index e0ed0d79c1..66ce5715f9 100644 --- a/samples/winrt/ImageManipulations/MainPage.xaml +++ b/samples/winrt/ImageManipulations/MainPage.xaml @@ -10,7 +10,7 @@ //********************************************************* --> - - diff --git a/samples/winrt/ImageManipulations/MediaCapture.vcxproj b/samples/winrt/ImageManipulations/MediaCapture.vcxproj index b8b8990e28..a0f8c84f9b 100644 --- a/samples/winrt/ImageManipulations/MediaCapture.vcxproj +++ b/samples/winrt/ImageManipulations/MediaCapture.vcxproj @@ -307,4 +307,4 @@ - \ No newline at end of file + diff --git a/samples/winrt/ImageManipulations/MediaExtensions/Common/AsyncCB.h b/samples/winrt/ImageManipulations/MediaExtensions/Common/AsyncCB.h index 04ff69ed8a..3321b47c95 100644 --- a/samples/winrt/ImageManipulations/MediaExtensions/Common/AsyncCB.h +++ b/samples/winrt/ImageManipulations/MediaExtensions/Common/AsyncCB.h @@ -3,7 +3,7 @@ ////////////////////////////////////////////////////////////////////////// // AsyncCallback [template] // -// Description: +// Description: // Helper class that routes IMFAsyncCallback::Invoke calls to a class // method on the parent class. // @@ -24,7 +24,7 @@ template class AsyncCallback : public IMFAsyncCallback { -public: +public: typedef HRESULT (T::*InvokeFn)(IMFAsyncResult *pAsyncResult); AsyncCallback(T *pParent, InvokeFn fn) : m_pParent(pParent), m_pInvokeFn(fn) @@ -32,13 +32,13 @@ public: } // IUnknown - STDMETHODIMP_(ULONG) AddRef() { + STDMETHODIMP_(ULONG) AddRef() { // Delegate to parent class. - return m_pParent->AddRef(); + return m_pParent->AddRef(); } - STDMETHODIMP_(ULONG) Release() { + STDMETHODIMP_(ULONG) Release() { // Delegate to parent class. - return m_pParent->Release(); + return m_pParent->Release(); } STDMETHODIMP QueryInterface(REFIID iid, void** ppv) { diff --git a/samples/winrt/ImageManipulations/MediaExtensions/Common/BufferLock.h b/samples/winrt/ImageManipulations/MediaExtensions/Common/BufferLock.h index 92de15eacc..1c47deabd0 100644 --- a/samples/winrt/ImageManipulations/MediaExtensions/Common/BufferLock.h +++ b/samples/winrt/ImageManipulations/MediaExtensions/Common/BufferLock.h @@ -99,4 +99,3 @@ private: IMFMediaBuffer *m_pBuffer; IMF2DBuffer *m_p2DBuffer; }; - diff --git a/samples/winrt/ImageManipulations/MediaExtensions/Common/CritSec.h b/samples/winrt/ImageManipulations/MediaExtensions/Common/CritSec.h index d5ea05bfd9..88851f9f03 100644 --- a/samples/winrt/ImageManipulations/MediaExtensions/Common/CritSec.h +++ b/samples/winrt/ImageManipulations/MediaExtensions/Common/CritSec.h @@ -20,13 +20,13 @@ public: DeleteCriticalSection(&m_criticalSection); } - _Acquires_lock_(m_criticalSection) + _Acquires_lock_(m_criticalSection) void Lock() { EnterCriticalSection(&m_criticalSection); } - _Releases_lock_(m_criticalSection) + _Releases_lock_(m_criticalSection) void Unlock() { LeaveCriticalSection(&m_criticalSection); @@ -36,7 +36,7 @@ public: ////////////////////////////////////////////////////////////////////////// // AutoLock -// Description: Provides automatic locking and unlocking of a +// Description: Provides automatic locking and unlocking of a // of a critical section. // // Note: The AutoLock object must go out of scope before the CritSec. @@ -47,16 +47,16 @@ class AutoLock private: CritSec *m_pCriticalSection; public: - _Acquires_lock_(m_pCriticalSection) + _Acquires_lock_(m_pCriticalSection) AutoLock(CritSec& crit) { m_pCriticalSection = &crit; m_pCriticalSection->Lock(); } - _Releases_lock_(m_pCriticalSection) + _Releases_lock_(m_pCriticalSection) ~AutoLock() { - m_pCriticalSection->Unlock(); + m_pCriticalSection->Unlock(); } }; diff --git a/samples/winrt/ImageManipulations/MediaExtensions/Common/LinkList.h b/samples/winrt/ImageManipulations/MediaExtensions/Common/LinkList.h index c67c0f2ca9..3657b3d7c5 100644 --- a/samples/winrt/ImageManipulations/MediaExtensions/Common/LinkList.h +++ b/samples/winrt/ImageManipulations/MediaExtensions/Common/LinkList.h @@ -13,9 +13,9 @@ #pragma once // Notes: -// -// The List class template implements a simple double-linked list. -// It uses STL's copy semantics. +// +// The List class template implements a simple double-linked list. +// It uses STL's copy semantics. // There are two versions of the Clear() method: // Clear(void) clears the list w/out cleaning up the object. @@ -90,7 +90,7 @@ public: private: const Node *pNode; - POSITION(Node *p) : pNode(p) + POSITION(Node *p) : pNode(p) { } }; @@ -123,7 +123,7 @@ protected: } Node *pAfter = pBefore->next; - + pBefore->next = pNode; pAfter->prev = pNode; @@ -336,12 +336,12 @@ public: } HRESULT GetItemPos(POSITION pos, T *ppItem) - { + { if (pos.pNode) { return GetItem(pos.pNode, ppItem); } - else + else { return E_FAIL; } @@ -359,7 +359,7 @@ public: } } - // Remove an item at a position. + // Remove an item at a position. // The item is returns in ppItem, unless ppItem is nullptr. // NOTE: This method invalidates the POSITION object. HRESULT Remove(POSITION& pos, T *ppItem) @@ -390,7 +390,7 @@ public: class ComAutoRelease { -public: +public: void operator()(IUnknown *p) { if (p) @@ -399,10 +399,10 @@ public: } } }; - + class MemDelete { -public: +public: void operator()(void *p) { if (p) @@ -416,9 +416,9 @@ public: // ComPtrList class // Derived class that makes it safer to store COM pointers in the List<> class. // It automatically AddRef's the pointers that are inserted onto the list -// (unless the insertion method fails). +// (unless the insertion method fails). // -// T must be a COM interface type. +// T must be a COM interface type. // example: ComPtrList // // NULLABLE: If true, client can insert nullptr pointers. This means GetItem can @@ -487,7 +487,7 @@ protected: HRESULT RemoveItem(Node *pNode, Ptr *ppItem) { // ppItem can be nullptr, but we need to get the - // item so that we can release it. + // item so that we can release it. // If ppItem is not nullptr, we will AddRef it on the way out. diff --git a/samples/winrt/ImageManipulations/MediaExtensions/Common/OpQueue.h b/samples/winrt/ImageManipulations/MediaExtensions/Common/OpQueue.h index dd0813be30..73f3042ce3 100644 --- a/samples/winrt/ImageManipulations/MediaExtensions/Common/OpQueue.h +++ b/samples/winrt/ImageManipulations/MediaExtensions/Common/OpQueue.h @@ -219,4 +219,4 @@ HRESULT OpQueue::ProcessQueueAsync(IMFAsyncResult *pResult) return hr; } -#pragma warning( pop ) \ No newline at end of file +#pragma warning( pop ) diff --git a/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvImageManipulations.idl b/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvImageManipulations.idl index 120ef7dbb4..37235a092d 100644 --- a/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvImageManipulations.idl +++ b/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvImageManipulations.idl @@ -4,8 +4,8 @@ import "Windows.Media.idl"; namespace OcvTransform { - [version(NTDDI_WIN8)] - runtimeclass OcvImageManipulations + [version(NTDDI_WIN8)] + runtimeclass OcvImageManipulations { - } -} \ No newline at end of file + } +} diff --git a/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.cpp b/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.cpp index bf98128158..538f353f5e 100644 --- a/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.cpp +++ b/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.cpp @@ -130,7 +130,7 @@ HRESULT OcvImageManipulations::SetProperties(ABI::Windows::Foundation::Collectio } } - return hr; + return hr; } // IMFTransform methods. Refer to the Media Foundation SDK documentation for details. @@ -1333,16 +1333,16 @@ HRESULT OcvImageManipulations::OnProcessOutput(IMFMediaBuffer *pIn, IMFMediaBuff const int mHistSize[] = {25}; const float baseRabge[] = {0.f,256.f}; const float* ranges[] = {baseRabge}; - - const cv::Scalar mColorsY[] = { cv::Scalar(76), cv::Scalar(149), cv::Scalar(29) }; - const cv::Scalar mColorsUV[] = { cv::Scalar(84, 255), cv::Scalar(43, 21), cv::Scalar(255, 107) }; - cv::Mat OutputY(m_imageHeightInPixels, m_imageWidthInPixels, CV_8UC1, pDest, lDestStride); - cv::Mat OutputUV(m_imageHeightInPixels/2, m_imageWidthInPixels/2, - CV_8UC2, pDest+m_imageHeightInPixels*lDestStride, lDestStride); + const cv::Scalar mColorsY[] = { cv::Scalar(76), cv::Scalar(149), cv::Scalar(29) }; + const cv::Scalar mColorsUV[] = { cv::Scalar(84, 255), cv::Scalar(43, 21), cv::Scalar(255, 107) }; + + cv::Mat OutputY(m_imageHeightInPixels, m_imageWidthInPixels, CV_8UC1, pDest, lDestStride); + cv::Mat OutputUV(m_imageHeightInPixels/2, m_imageWidthInPixels/2, + CV_8UC2, pDest+m_imageHeightInPixels*lDestStride, lDestStride); cv::Mat BgrFrame; - InputFrame.copyTo(OutputFrame); + InputFrame.copyTo(OutputFrame); cv::cvtColor(InputFrame, BgrFrame, cv::COLOR_YUV420sp2BGR); int thikness = (int) (BgrFrame.cols / (mHistSizeNum + 10) / 5); @@ -1357,20 +1357,20 @@ HRESULT OcvImageManipulations::OnProcessOutput(IMFMediaBuffer *pIn, IMFMediaBuff cv::normalize(hist, hist, BgrFrame.rows/2, 0, cv::NORM_INF); for(int h=0; h(h); - cv::line(OutputY, mP1, mP2, mColorsY[c], thikness); + cv::line(OutputY, mP1, mP2, mColorsY[c], thikness); - // Draw on UV planes + // Draw on UV planes mP1.x /= 2; mP1.y /= 2; - mP2.x /= 2; + mP2.x /= 2; mP2.y /= 2; - cv::line(OutputUV, mP1, mP2, mColorsUV[c], thikness/2); + cv::line(OutputUV, mP1, mP2, mColorsUV[c], thikness/2); } - } + } } break; default: break; @@ -1426,7 +1426,7 @@ HRESULT OcvImageManipulations::UpdateFormatInfo() } // Calculate the image size for YUV NV12 image(not including padding) - m_cbImageSize = (m_imageHeightInPixels + m_imageHeightInPixels/2)*m_imageWidthInPixels; + m_cbImageSize = (m_imageHeightInPixels + m_imageHeightInPixels/2)*m_imageWidthInPixels; } done: @@ -1483,4 +1483,3 @@ HRESULT GetDefaultStride(IMFMediaType *pType, LONG *plStride) } return hr; } - diff --git a/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.def b/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.def index 0b801908c5..453349adf5 100644 --- a/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.def +++ b/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.def @@ -1,4 +1,4 @@ EXPORTS DllCanUnloadNow PRIVATE DllGetActivationFactory PRIVATE - DllGetClassObject PRIVATE \ No newline at end of file + DllGetClassObject PRIVATE diff --git a/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.h b/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.h index 118f6e432b..9162593fc0 100644 --- a/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.h +++ b/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.h @@ -244,4 +244,4 @@ private: IMFAttributes *m_pAttributes; }; -#endif \ No newline at end of file +#endif diff --git a/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.vcxproj b/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.vcxproj index fbe768cc93..54c0ce40ab 100644 --- a/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.vcxproj +++ b/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.vcxproj @@ -316,4 +316,4 @@ - \ No newline at end of file + diff --git a/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/dllmain.cpp b/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/dllmain.cpp index d11bceaf07..701e7d416a 100644 --- a/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/dllmain.cpp +++ b/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/dllmain.cpp @@ -17,7 +17,7 @@ using namespace Microsoft::WRL; namespace Microsoft { namespace Samples { - ActivatableClass(OcvImageManipulations); + ActivatableClass(OcvImageManipulations); }} BOOL WINAPI DllMain( _In_ HINSTANCE hInstance, _In_ DWORD dwReason, _In_opt_ LPVOID lpReserved ) @@ -47,7 +47,7 @@ HRESULT WINAPI DllGetActivationFactory( _In_ HSTRING activatibleClassId, _Outptr HRESULT WINAPI DllCanUnloadNow() { - auto &module = Microsoft::WRL::Module::GetModule(); + auto &module = Microsoft::WRL::Module::GetModule(); return (module.Terminate()) ? S_OK : S_FALSE; } diff --git a/samples/winrt/ImageManipulations/Package.appxmanifest b/samples/winrt/ImageManipulations/Package.appxmanifest index 9d63dea7cc..b66e01465e 100644 --- a/samples/winrt/ImageManipulations/Package.appxmanifest +++ b/samples/winrt/ImageManipulations/Package.appxmanifest @@ -33,4 +33,4 @@ - \ No newline at end of file + diff --git a/samples/winrt/ImageManipulations/common/LayoutAwarePage.cpp b/samples/winrt/ImageManipulations/common/LayoutAwarePage.cpp index 9449fbead3..07092bb745 100644 --- a/samples/winrt/ImageManipulations/common/LayoutAwarePage.cpp +++ b/samples/winrt/ImageManipulations/common/LayoutAwarePage.cpp @@ -85,21 +85,21 @@ void LayoutAwarePage::DefaultViewModel::set(IObservableMap^ va /// Event data describing the conditions that led to the event. void LayoutAwarePage::OnLoaded(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) { - this->StartLayoutUpdates(sender, e); + this->StartLayoutUpdates(sender, e); - // Keyboard and mouse navigation only apply when occupying the entire window - if (this->ActualHeight == Window::Current->Bounds.Height && - this->ActualWidth == Window::Current->Bounds.Width) - { - // Listen to the window directly so focus isn't required - _acceleratorKeyEventToken = Window::Current->CoreWindow->Dispatcher->AcceleratorKeyActivated += - ref new TypedEventHandler(this, - &LayoutAwarePage::CoreDispatcher_AcceleratorKeyActivated); - _pointerPressedEventToken = Window::Current->CoreWindow->PointerPressed += - ref new TypedEventHandler(this, - &LayoutAwarePage::CoreWindow_PointerPressed); - _navigationShortcutsRegistered = true; - } + // Keyboard and mouse navigation only apply when occupying the entire window + if (this->ActualHeight == Window::Current->Bounds.Height && + this->ActualWidth == Window::Current->Bounds.Width) + { + // Listen to the window directly so focus isn't required + _acceleratorKeyEventToken = Window::Current->CoreWindow->Dispatcher->AcceleratorKeyActivated += + ref new TypedEventHandler(this, + &LayoutAwarePage::CoreDispatcher_AcceleratorKeyActivated); + _pointerPressedEventToken = Window::Current->CoreWindow->PointerPressed += + ref new TypedEventHandler(this, + &LayoutAwarePage::CoreWindow_PointerPressed); + _navigationShortcutsRegistered = true; + } } /// @@ -109,13 +109,13 @@ void LayoutAwarePage::OnLoaded(Object^ sender, Windows::UI::Xaml::RoutedEventArg /// Event data describing the conditions that led to the event. void LayoutAwarePage::OnUnloaded(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) { - if (_navigationShortcutsRegistered) - { - Window::Current->CoreWindow->Dispatcher->AcceleratorKeyActivated -= _acceleratorKeyEventToken; - Window::Current->CoreWindow->PointerPressed -= _pointerPressedEventToken; - _navigationShortcutsRegistered = false; - } - StopLayoutUpdates(sender, e); + if (_navigationShortcutsRegistered) + { + Window::Current->CoreWindow->Dispatcher->AcceleratorKeyActivated -= _acceleratorKeyEventToken; + Window::Current->CoreWindow->PointerPressed -= _pointerPressedEventToken; + _navigationShortcutsRegistered = false; + } + StopLayoutUpdates(sender, e); } #pragma region Navigation support diff --git a/samples/winrt/ImageManipulations/common/StandardStyles.xaml b/samples/winrt/ImageManipulations/common/StandardStyles.xaml index 7c3d238776..b4edc81f44 100644 --- a/samples/winrt/ImageManipulations/common/StandardStyles.xaml +++ b/samples/winrt/ImageManipulations/common/StandardStyles.xaml @@ -15,7 +15,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> - + @@ -399,7 +399,7 @@ - +