Merge pull request #2781 from ilya-lavrenov:tapi_meanstddev
authorAlexander Alekhin <alexander.alekhin@itseez.com>
Sat, 31 May 2014 18:50:44 +0000 (22:50 +0400)
committerOpenCV Buildbot <buildbot@opencv.org>
Sat, 31 May 2014 18:50:44 +0000 (22:50 +0400)
26 files changed:
3rdparty/ippicv/downloader.cmake
cmake/OpenCVFindIPP.cmake
cmake/OpenCVGenConfig.cmake
cmake/templates/OpenCVConfig.cmake.in
data/haarcascades/haarcascade_licence_plate_rus_16stages.xml [new file with mode: 0644]
modules/core/doc/clustering.rst
modules/core/perf/opencl/perf_arithm.cpp
modules/core/perf/opencl/perf_matop.cpp
modules/core/src/copy.cpp
modules/core/src/dxt.cpp
modules/core/src/matrix.cpp
modules/core/src/ocl.cpp
modules/core/src/opencl/repeat.cl [new file with mode: 0644]
modules/features2d/test/test_keypoints.cpp
modules/features2d/test/test_rotation_and_scale_invariance.cpp
modules/imgproc/perf/opencl/perf_matchTemplate.cpp
modules/imgproc/perf/opencl/perf_pyramid.cpp
modules/imgproc/perf/perf_cvt_color.cpp
modules/imgproc/perf/perf_floodfill.cpp [new file with mode: 0644]
modules/imgproc/src/corner.cpp
modules/imgproc/src/sumpixels.cpp
modules/legacy/src/calibfilter.cpp
modules/objdetect/doc/cascade_classification.rst
modules/objdetect/include/opencv2/objdetect.hpp
modules/python/src2/cv2.cpp
modules/video/src/lkpyramid.cpp

index 38e6c7b..3715214 100644 (file)
@@ -59,12 +59,11 @@ function(_icv_downloader)
   
   if(NOT EXISTS "${OPENCV_ICV_PACKAGE_ARCHIVE}")
     if(NOT DEFINED OPENCV_ICV_URL)
-      if(NOT DEFINED ENV{OPENCV_ICV_URL})
-        # TODO Specify default URL after ICV publishing
-        message(STATUS "ICV: downloading URL is not specified, skip downloading")
-        return()
+      if(DEFINED ENV{OPENCV_ICV_URL})
+        set(OPENCV_ICV_URL $ENV{OPENCV_ICV_URL})
+      else()
+        set(OPENCV_ICV_URL "http://sourceforge.net/projects/opencvlibrary/files/3rdparty/ippicv")
       endif()
-      set(OPENCV_ICV_URL $ENV{OPENCV_ICV_URL})
     endif()
   
     file(MAKE_DIRECTORY ${OPENCV_ICV_PACKAGE_ARCHIVE_DIR})
index fd8346a..036f598 100644 (file)
@@ -126,7 +126,18 @@ macro(ipp_detect_version)
 
   macro(_ipp_add_library name)
     if (EXISTS ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
-      list(APPEND IPP_LIBRARIES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
+      add_library(ipp${name} STATIC IMPORTED)
+      set_target_properties(ipp${name} PROPERTIES
+        IMPORTED_LINK_INTERFACE_LIBRARIES ""
+        IMPORTED_LOCATION ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
+      )
+      list(APPEND IPP_LIBRARIES ipp${name})
+      # CMake doesn't support "install(TARGETS ipp${name} " command with imported targets
+      install(FILES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
+              DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
+      string(TOUPPER ${name} uname)
+      set(IPP${uname}_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${OPENCV_3P_LIB_INSTALL_PATH}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}" CACHE INTERNAL "" FORCE)
+      set(IPP${uname}_LOCATION_PATH "${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}" CACHE INTERNAL "" FORCE)
     else()
       message(STATUS "Can't find IPP library: ${name} at ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}")
     endif()
index cdf418e..220772a 100644 (file)
@@ -83,6 +83,14 @@ endif()
 
 export(TARGETS ${OpenCVModules_TARGETS} FILE "${CMAKE_BINARY_DIR}/OpenCVModules${modules_file_suffix}.cmake")
 
+if(TARGET ippicv)
+  set(USE_IPPICV TRUE)
+  file(RELATIVE_PATH INSTALL_PATH_RELATIVE_IPPICV ${CMAKE_BINARY_DIR} ${IPPICV_LOCATION_PATH})
+else()
+  set(USE_IPPICV FALSE)
+  set(INSTALL_PATH_RELATIVE_IPPICV "non-existed-path")
+endif()
+
 configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/OpenCVConfig.cmake" @ONLY)
 #support for version checking when finding opencv. find_package(OpenCV 2.3.1 EXACT) should now work.
 configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/OpenCVConfig-version.cmake" @ONLY)
@@ -98,9 +106,6 @@ if(INSTALL_TO_MANGLED_PATHS)
   set(OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE}\"")
 endif()
 
-configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" @ONLY)
-configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake" @ONLY)
-
 if(UNIX) # ANDROID configuration is created here also
   #http://www.vtk.org/Wiki/CMake/Tutorials/Packaging reference
   # For a command "find_package(<name> [major[.minor]] [EXACT] [REQUIRED|QUIET])"
@@ -108,6 +113,15 @@ if(UNIX) # ANDROID configuration is created here also
   #                <prefix>/(share|lib)/cmake/<name>*/                     (U)
   #                <prefix>/(share|lib)/<name>*/                           (U)
   #                <prefix>/(share|lib)/<name>*/(cmake|CMake)/             (U)
+  if(USE_IPPICV)
+    if(INSTALL_TO_MANGLED_PATHS)
+      file(RELATIVE_PATH INSTALL_PATH_RELATIVE_IPPICV "${CMAKE_INSTALL_PREFIX}/${OPENCV_CONFIG_INSTALL_PATH}-${OPENCV_VERSION}/" ${IPPICV_INSTALL_PATH})
+    else()
+      file(RELATIVE_PATH INSTALL_PATH_RELATIVE_IPPICV "${CMAKE_INSTALL_PREFIX}/${OPENCV_CONFIG_INSTALL_PATH}/" ${IPPICV_INSTALL_PATH})
+    endif()
+  endif()
+  configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" @ONLY)
+  configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake" @ONLY)
   if(INSTALL_TO_MANGLED_PATHS)
     install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}-${OPENCV_VERSION}/ COMPONENT dev)
     install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}-${OPENCV_VERSION}/ COMPONENT dev)
@@ -131,6 +145,13 @@ if(WIN32)
   set(OpenCV2_INCLUDE_DIRS_CONFIGCMAKE "\"\"")
 
   exec_program(mkdir ARGS "-p \"${CMAKE_BINARY_DIR}/win-install/\"" OUTPUT_VARIABLE RET_VAL)
+  if(USE_IPPICV)
+    if(BUILD_SHARED_LIBS)
+      file(RELATIVE_PATH INSTALL_PATH_RELATIVE_IPPICV "${CMAKE_INSTALL_PREFIX}/${OpenCV_INSTALL_BINARIES_PREFIX}lib" ${IPPICV_INSTALL_PATH})
+    else()
+      file(RELATIVE_PATH INSTALL_PATH_RELATIVE_IPPICV "${CMAKE_INSTALL_PREFIX}/${OpenCV_INSTALL_BINARIES_PREFIX}staticlib" ${IPPICV_INSTALL_PATH})
+    endif()
+  endif()
   configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" @ONLY)
   configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" @ONLY)
   if(BUILD_SHARED_LIBS)
index edc0264..24a9374 100644 (file)
@@ -49,6 +49,18 @@ if(NOT DEFINED OpenCV_MODULES_SUFFIX)
   endif()
 endif()
 
+if(@USE_IPPICV@) # value is defined by package builder
+  if(NOT TARGET ippicv)
+    if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_PATH_RELATIVE_IPPICV@")
+      add_library(ippicv STATIC IMPORTED)
+      set_target_properties(ippicv PROPERTIES
+        IMPORTED_LINK_INTERFACE_LIBRARIES ""
+        IMPORTED_LOCATION "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_PATH_RELATIVE_IPPICV@"
+      )
+    endif()
+  endif()
+endif()
+
 if(NOT TARGET opencv_core)
   include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${OpenCV_MODULES_SUFFIX}.cmake)
 endif()
diff --git a/data/haarcascades/haarcascade_licence_plate_rus_16stages.xml b/data/haarcascades/haarcascade_licence_plate_rus_16stages.xml
new file mode 100644 (file)
index 0000000..576c9e8
--- /dev/null
@@ -0,0 +1,1404 @@
+<?xml version="1.0"?>\r
+<opencv_storage>\r
+<!-- Automatically converted from haarcascade2, window size = 64x16 -->\r
+<haarcascade_pltzzz64x16_16STG type_id="opencv-haar-classifier">\r
+  <size>\r
+    64 16</size>\r
+  <stages>\r
+    <_>\r
+      <!-- stage 0 -->\r
+      <trees>\r
+        <_>\r
+          <!-- tree 0 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  32 2 8 6 -1.</_>\r
+                <_>\r
+                  32 4 8 2 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>1.6915600746870041e-002</threshold>\r
+            <left_val>-9.5547717809677124e-001</left_val>\r
+            <right_val>8.9129137992858887e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 1 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  0 4 6 10 -1.</_>\r
+                <_>\r
+                  3 4 3 10 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>2.4228349328041077e-002</threshold>\r
+            <left_val>-9.2089319229125977e-001</left_val>\r
+            <right_val>8.8723921775817871e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 2 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  55 0 8 6 -1.</_>\r
+                <_>\r
+                  55 0 4 3 2.</_>\r
+                <_>\r
+                  59 3 4 3 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-1.0168660432100296e-002</threshold>\r
+            <left_val>8.8940089941024780e-001</left_val>\r
+            <right_val>-7.7847331762313843e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 3 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  44 7 4 9 -1.</_>\r
+                <_>\r
+                  44 10 4 3 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>2.0863260142505169e-003</threshold>\r
+            <left_val>-8.7998157739639282e-001</left_val>\r
+            <right_val>5.8651781082153320e-001</right_val></_></_></trees>\r
+      <stage_threshold>-2.0683259963989258e+000</stage_threshold>\r
+      <parent>-1</parent>\r
+      <next>-1</next></_>\r
+    <_>\r
+      <!-- stage 1 -->\r
+      <trees>\r
+        <_>\r
+          <!-- tree 0 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  29 1 16 4 -1.</_>\r
+                <_>\r
+                  29 3 16 2 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>2.9062159359455109e-002</threshold>\r
+            <left_val>-8.7765061855316162e-001</left_val>\r
+            <right_val>8.5373121500015259e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 1 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  0 5 9 8 -1.</_>\r
+                <_>\r
+                  3 5 3 8 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>2.3903399705886841e-002</threshold>\r
+            <left_val>-9.2079448699951172e-001</left_val>\r
+            <right_val>7.5155001878738403e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 2 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  44 0 20 14 -1.</_>\r
+                <_>\r
+                  44 0 10 7 2.</_>\r
+                <_>\r
+                  54 7 10 7 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-3.5404648631811142e-002</threshold>\r
+            <left_val>6.7834627628326416e-001</left_val>\r
+            <right_val>-9.0937072038650513e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 3 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  41 7 6 9 -1.</_>\r
+                <_>\r
+                  43 7 2 9 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>6.2988721765577793e-003</threshold>\r
+            <left_val>-8.1054258346557617e-001</left_val>\r
+            <right_val>5.8985030651092529e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 4 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  0 4 21 4 -1.</_>\r
+                <_>\r
+                  7 4 7 4 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>3.4959490876644850e-003</threshold>\r
+            <left_val>-9.7632282972335815e-001</left_val>\r
+            <right_val>4.5473039150238037e-001</right_val></_></_></trees>\r
+      <stage_threshold>-1.6632349491119385e+000</stage_threshold>\r
+      <parent>0</parent>\r
+      <next>-1</next></_>\r
+    <_>\r
+      <!-- stage 2 -->\r
+      <trees>\r
+        <_>\r
+          <!-- tree 0 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  31 2 11 6 -1.</_>\r
+                <_>\r
+                  31 4 11 2 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>2.3864099755883217e-002</threshold>\r
+            <left_val>-9.3137168884277344e-001</left_val>\r
+            <right_val>8.2478952407836914e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 1 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  56 3 6 11 -1.</_>\r
+                <_>\r
+                  59 3 3 11 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-2.5775209069252014e-002</threshold>\r
+            <left_val>8.5526448488235474e-001</left_val>\r
+            <right_val>-8.7574672698974609e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 2 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  32 14 32 2 -1.</_>\r
+                <_>\r
+                  32 15 32 1 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-1.0646049864590168e-002</threshold>\r
+            <left_val>8.5167151689529419e-001</left_val>\r
+            <right_val>-6.7789041996002197e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 3 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  0 2 8 14 -1.</_>\r
+                <_>\r
+                  4 2 4 14 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>2.7000989764928818e-002</threshold>\r
+            <left_val>-8.0041092634201050e-001</left_val>\r
+            <right_val>6.4893317222595215e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 4 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  19 0 22 6 -1.</_>\r
+                <_>\r
+                  19 0 11 3 2.</_>\r
+                <_>\r
+                  30 3 11 3 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>5.2989721298217773e-003</threshold>\r
+            <left_val>-9.5342522859573364e-001</left_val>\r
+            <right_val>5.0140267610549927e-001</right_val></_></_></trees>\r
+      <stage_threshold>-1.3346730470657349e+000</stage_threshold>\r
+      <parent>1</parent>\r
+      <next>-1</next></_>\r
+    <_>\r
+      <!-- stage 3 -->\r
+      <trees>\r
+        <_>\r
+          <!-- tree 0 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  56 0 6 6 -1.</_>\r
+                <_>\r
+                  56 0 3 3 2.</_>\r
+                <_>\r
+                  59 3 3 3 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-6.9233630783855915e-003</threshold>\r
+            <left_val>8.2654470205307007e-001</left_val>\r
+            <right_val>-8.5396027565002441e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 1 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  32 0 14 12 -1.</_>\r
+                <_>\r
+                  32 0 7 6 2.</_>\r
+                <_>\r
+                  39 6 7 6 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>1.2539249658584595e-001</threshold>\r
+            <left_val>-1.2996139936149120e-002</left_val>\r
+            <right_val>-3.2377028808593750e+003</right_val></_></_>\r
+        <_>\r
+          <!-- tree 2 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  2 1 43 4 -1.</_>\r
+                <_>\r
+                  2 3 43 2 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>6.3474893569946289e-002</threshold>\r
+            <left_val>-6.4648061990737915e-001</left_val>\r
+            <right_val>8.2302427291870117e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 3 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  34 10 30 5 -1.</_>\r
+                <_>\r
+                  44 10 10 5 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>4.2217150330543518e-002</threshold>\r
+            <left_val>-7.5190877914428711e-001</left_val>\r
+            <right_val>6.3705182075500488e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 4 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  0 9 9 5 -1.</_>\r
+                <_>\r
+                  3 9 3 5 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>2.0000640302896500e-002</threshold>\r
+            <left_val>-6.2077498435974121e-001</left_val>\r
+            <right_val>6.1317932605743408e-001</right_val></_></_></trees>\r
+      <stage_threshold>-1.6521669626235962e+000</stage_threshold>\r
+      <parent>2</parent>\r
+      <next>-1</next></_>\r
+    <_>\r
+      <!-- stage 4 -->\r
+      <trees>\r
+        <_>\r
+          <!-- tree 0 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  2 1 43 6 -1.</_>\r
+                <_>\r
+                  2 3 43 2 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>9.2297486960887909e-002</threshold>\r
+            <left_val>-7.2764229774475098e-001</left_val>\r
+            <right_val>8.0554759502410889e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 1 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  53 4 9 8 -1.</_>\r
+                <_>\r
+                  56 4 3 8 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>2.7613969519734383e-002</threshold>\r
+            <left_val>-7.0769268274307251e-001</left_val>\r
+            <right_val>7.3315787315368652e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 2 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  36 4 14 8 -1.</_>\r
+                <_>\r
+                  36 4 7 4 2.</_>\r
+                <_>\r
+                  43 8 7 4 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>1.2465449981391430e-002</threshold>\r
+            <left_val>-8.4359270334243774e-001</left_val>\r
+            <right_val>5.7046437263488770e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 3 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  14 14 49 2 -1.</_>\r
+                <_>\r
+                  14 15 49 1 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-2.3886829614639282e-002</threshold>\r
+            <left_val>8.2656508684158325e-001</left_val>\r
+            <right_val>-5.2783298492431641e-001</right_val></_></_></trees>\r
+      <stage_threshold>-1.4523630142211914e+000</stage_threshold>\r
+      <parent>3</parent>\r
+      <next>-1</next></_>\r
+    <_>\r
+      <!-- stage 5 -->\r
+      <trees>\r
+        <_>\r
+          <!-- tree 0 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  0 5 4 9 -1.</_>\r
+                <_>\r
+                  2 5 2 9 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>1.8821349367499352e-002</threshold>\r
+            <left_val>-8.1122857332229614e-001</left_val>\r
+            <right_val>6.9127470254898071e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 1 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  21 1 38 4 -1.</_>\r
+                <_>\r
+                  21 3 38 2 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>6.1703320592641830e-002</threshold>\r
+            <left_val>-7.6482647657394409e-001</left_val>\r
+            <right_val>6.4212161302566528e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 2 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  44 12 18 3 -1.</_>\r
+                <_>\r
+                  53 12 9 3 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-1.6298670321702957e-002</threshold>\r
+            <left_val>5.0207728147506714e-001</left_val>\r
+            <right_val>-8.4020161628723145e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 3 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  10 4 9 3 -1.</_>\r
+                <_>\r
+                  13 4 3 3 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-4.9458951689302921e-003</threshold>\r
+            <left_val>6.1991941928863525e-001</left_val>\r
+            <right_val>-6.1633539199829102e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 4 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  40 4 10 4 -1.</_>\r
+                <_>\r
+                  45 4 5 4 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-5.1894597709178925e-003</threshold>\r
+            <left_val>4.4975179433822632e-001</left_val>\r
+            <right_val>-8.0651968717575073e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 5 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  17 14 47 2 -1.</_>\r
+                <_>\r
+                  17 15 47 1 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-1.8824130296707153e-002</threshold>\r
+            <left_val>6.1992841958999634e-001</left_val>\r
+            <right_val>-5.5643159151077271e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 6 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  8 5 4 7 -1.</_>\r
+                <_>\r
+                  10 5 2 7 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>5.6571601890027523e-003</threshold>\r
+            <left_val>-4.8346561193466187e-001</left_val>\r
+            <right_val>6.8647360801696777e-001</right_val></_></_></trees>\r
+      <stage_threshold>-2.2358059883117676e+000</stage_threshold>\r
+      <parent>4</parent>\r
+      <next>-1</next></_>\r
+    <_>\r
+      <!-- stage 6 -->\r
+      <trees>\r
+        <_>\r
+          <!-- tree 0 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  56 0 6 6 -1.</_>\r
+                <_>\r
+                  56 0 3 3 2.</_>\r
+                <_>\r
+                  59 3 3 3 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-9.1503243893384933e-003</threshold>\r
+            <left_val>6.8174481391906738e-001</left_val>\r
+            <right_val>-7.7866071462631226e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 1 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  0 0 6 6 -1.</_>\r
+                <_>\r
+                  0 0 3 3 2.</_>\r
+                <_>\r
+                  3 3 3 3 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>7.4933180585503578e-003</threshold>\r
+            <left_val>-6.8696027994155884e-001</left_val>\r
+            <right_val>6.6913938522338867e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 2 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  13 4 48 2 -1.</_>\r
+                <_>\r
+                  29 4 16 2 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>4.5296419411897659e-002</threshold>\r
+            <left_val>-7.3576509952545166e-001</left_val>\r
+            <right_val>5.9453499317169189e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 3 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  42 1 6 15 -1.</_>\r
+                <_>\r
+                  42 6 6 5 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>1.1669679544866085e-002</threshold>\r
+            <left_val>-8.4733831882476807e-001</left_val>\r
+            <right_val>4.5461329817771912e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 4 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  30 8 3 5 -1.</_>\r
+                <_>\r
+                  31 8 1 5 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>2.5769430212676525e-003</threshold>\r
+            <left_val>-5.8270388841629028e-001</left_val>\r
+            <right_val>7.7900522947311401e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 5 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  55 10 8 6 -1.</_>\r
+                <_>\r
+                  55 13 8 3 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-1.4139170525595546e-003</threshold>\r
+            <left_val>4.5126929879188538e-001</left_val>\r
+            <right_val>-9.0696328878402710e-001</right_val></_></_></trees>\r
+      <stage_threshold>-1.8782069683074951e+000</stage_threshold>\r
+      <parent>5</parent>\r
+      <next>-1</next></_>\r
+    <_>\r
+      <!-- stage 7 -->\r
+      <trees>\r
+        <_>\r
+          <!-- tree 0 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  4 6 4 7 -1.</_>\r
+                <_>\r
+                  6 6 2 7 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-5.3149578161537647e-003</threshold>\r
+            <left_val>6.5218788385391235e-001</left_val>\r
+            <right_val>-7.9464268684387207e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 1 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  56 3 6 8 -1.</_>\r
+                <_>\r
+                  59 3 3 8 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-2.2906960919499397e-002</threshold>\r
+            <left_val>6.6433382034301758e-001</left_val>\r
+            <right_val>-7.3633247613906860e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 2 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  37 2 4 6 -1.</_>\r
+                <_>\r
+                  37 4 4 2 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>9.4887977465987206e-003</threshold>\r
+            <left_val>-8.2612031698226929e-001</left_val>\r
+            <right_val>4.9333500862121582e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 3 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  0 10 30 6 -1.</_>\r
+                <_>\r
+                  0 12 30 2 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>4.5138411223888397e-002</threshold>\r
+            <left_val>-5.4704028367996216e-001</left_val>\r
+            <right_val>7.6927912235260010e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 4 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  0 4 21 12 -1.</_>\r
+                <_>\r
+                  7 4 7 12 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>2.5049019604921341e-002</threshold>\r
+            <left_val>-8.6739641427993774e-001</left_val>\r
+            <right_val>5.2807968854904175e-001</right_val></_></_></trees>\r
+      <stage_threshold>-1.0597369670867920e+000</stage_threshold>\r
+      <parent>6</parent>\r
+      <next>-1</next></_>\r
+    <_>\r
+      <!-- stage 8 -->\r
+      <trees>\r
+        <_>\r
+          <!-- tree 0 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  44 0 1 14 -1.</_>\r
+                <_>\r
+                  44 7 1 7 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>6.6414438188076019e-003</threshold>\r
+            <left_val>-7.7290147542953491e-001</left_val>\r
+            <right_val>6.9723731279373169e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 1 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  54 3 4 3 -1.</_>\r
+                <_>\r
+                  56 3 2 3 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>2.4703629314899445e-003</threshold>\r
+            <left_val>-7.4289917945861816e-001</left_val>\r
+            <right_val>6.6825848817825317e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 2 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  32 0 30 6 -1.</_>\r
+                <_>\r
+                  32 0 15 3 2.</_>\r
+                <_>\r
+                  47 3 15 3 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-2.2910499945282936e-002</threshold>\r
+            <left_val>4.3986389040946960e-001</left_val>\r
+            <right_val>-9.0588808059692383e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 3 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  0 8 9 7 -1.</_>\r
+                <_>\r
+                  3 8 3 7 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>3.4193221479654312e-002</threshold>\r
+            <left_val>-6.9507479667663574e-001</left_val>\r
+            <right_val>6.2501090764999390e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 4 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  30 10 3 3 -1.</_>\r
+                <_>\r
+                  31 10 1 3 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>1.5060020377859473e-003</threshold>\r
+            <left_val>-6.8670761585235596e-001</left_val>\r
+            <right_val>8.2241541147232056e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 5 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  21 3 24 4 -1.</_>\r
+                <_>\r
+                  29 3 8 4 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>1.9838380467263050e-005</threshold>\r
+            <left_val>-9.2727631330490112e-001</left_val>\r
+            <right_val>6.4723730087280273e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 6 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  42 3 12 6 -1.</_>\r
+                <_>\r
+                  46 3 4 6 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-2.2170299416757189e-005</threshold>\r
+            <left_val>5.6555831432342529e-001</left_val>\r
+            <right_val>-9.6788132190704346e-001</right_val></_></_></trees>\r
+      <stage_threshold>-1.4993519783020020e+000</stage_threshold>\r
+      <parent>7</parent>\r
+      <next>-1</next></_>\r
+    <_>\r
+      <!-- stage 9 -->\r
+      <trees>\r
+        <_>\r
+          <!-- tree 0 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  56 9 6 6 -1.</_>\r
+                <_>\r
+                  59 9 3 6 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-1.1395259760320187e-002</threshold>\r
+            <left_val>7.1383631229400635e-001</left_val>\r
+            <right_val>-8.7429678440093994e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 1 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  6 4 1 6 -1.</_>\r
+                <_>\r
+                  6 7 1 3 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-2.1864590235054493e-003</threshold>\r
+            <left_val>8.5311782360076904e-001</left_val>\r
+            <right_val>-6.4777731895446777e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 2 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  0 0 12 4 -1.</_>\r
+                <_>\r
+                  0 0 6 2 2.</_>\r
+                <_>\r
+                  6 2 6 2 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>2.3193720262497663e-003</threshold>\r
+            <left_val>-7.6411879062652588e-001</left_val>\r
+            <right_val>7.1867972612380981e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 3 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  43 12 18 2 -1.</_>\r
+                <_>\r
+                  52 12 9 2 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-7.9916073009371758e-003</threshold>\r
+            <left_val>6.6442942619323730e-001</left_val>\r
+            <right_val>-7.9540950059890747e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 4 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  9 5 2 8 -1.</_>\r
+                <_>\r
+                  10 5 1 8 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>1.4212740352377295e-003</threshold>\r
+            <left_val>-6.3904231786727905e-001</left_val>\r
+            <right_val>7.5050598382949829e-001</right_val></_></_></trees>\r
+      <stage_threshold>-8.4829801321029663e-001</stage_threshold>\r
+      <parent>8</parent>\r
+      <next>-1</next></_>\r
+    <_>\r
+      <!-- stage 10 -->\r
+      <trees>\r
+        <_>\r
+          <!-- tree 0 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  1 9 6 3 -1.</_>\r
+                <_>\r
+                  3 9 2 3 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>6.4091659151017666e-003</threshold>\r
+            <left_val>-8.8425230979919434e-001</left_val>\r
+            <right_val>9.9953681230545044e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 1 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  56 8 2 8 -1.</_>\r
+                <_>\r
+                  56 12 2 4 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-6.3316390151157975e-004</threshold>\r
+            <left_val>8.3822172880172729e-001</left_val>\r
+            <right_val>-9.8322170972824097e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 2 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  24 2 6 13 -1.</_>\r
+                <_>\r
+                  26 2 2 13 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-6.4947169448714703e-005</threshold>\r
+            <left_val>1.</left_val>\r
+            <right_val>-9.1822808980941772e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 3 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  33 7 24 4 -1.</_>\r
+                <_>\r
+                  41 7 8 4 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>5.3404141217470169e-003</threshold>\r
+            <left_val>-9.4317251443862915e-001</left_val>\r
+            <right_val>9.0425151586532593e-001</right_val></_></_></trees>\r
+      <stage_threshold>-6.0007210820913315e-002</stage_threshold>\r
+      <parent>9</parent>\r
+      <next>-1</next></_>\r
+    <_>\r
+      <!-- stage 11 -->\r
+      <trees>\r
+        <_>\r
+          <!-- tree 0 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  1 1 57 4 -1.</_>\r
+                <_>\r
+                  1 3 57 2 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>1.0755469650030136e-001</threshold>\r
+            <left_val>-7.1647202968597412e-001</left_val>\r
+            <right_val>8.7827038764953613e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 1 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  0 2 6 14 -1.</_>\r
+                <_>\r
+                  3 2 3 14 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>3.1668949872255325e-002</threshold>\r
+            <left_val>-8.7051069736480713e-001</left_val>\r
+            <right_val>5.8807212114334106e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 2 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  52 3 6 10 -1.</_>\r
+                <_>\r
+                  54 3 2 10 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-1.0572380386292934e-002</threshold>\r
+            <left_val>6.2438100576400757e-001</left_val>\r
+            <right_val>-7.4027371406555176e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 3 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  1 14 61 2 -1.</_>\r
+                <_>\r
+                  1 15 61 1 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-2.7396259829401970e-002</threshold>\r
+            <left_val>8.9776748418807983e-001</left_val>\r
+            <right_val>-5.2986758947372437e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 4 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  28 0 11 12 -1.</_>\r
+                <_>\r
+                  28 4 11 4 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>2.5918649509549141e-002</threshold>\r
+            <left_val>-8.6482518911361694e-001</left_val>\r
+            <right_val>5.3121817111968994e-001</right_val></_></_></trees>\r
+      <stage_threshold>-9.6125108003616333e-001</stage_threshold>\r
+      <parent>10</parent>\r
+      <next>-1</next></_>\r
+    <_>\r
+      <!-- stage 12 -->\r
+      <trees>\r
+        <_>\r
+          <!-- tree 0 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  22 1 41 4 -1.</_>\r
+                <_>\r
+                  22 3 41 2 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>7.1039132773876190e-002</threshold>\r
+            <left_val>-7.5719678401947021e-001</left_val>\r
+            <right_val>7.5645631551742554e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 1 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  41 6 6 8 -1.</_>\r
+                <_>\r
+                  43 6 2 8 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>7.6241148635745049e-003</threshold>\r
+            <left_val>-7.9783838987350464e-001</left_val>\r
+            <right_val>7.1733069419860840e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 2 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  50 9 14 5 -1.</_>\r
+                <_>\r
+                  57 9 7 5 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-2.7092639356851578e-002</threshold>\r
+            <left_val>6.0071170330047607e-001</left_val>\r
+            <right_val>-8.4794402122497559e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 3 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  4 1 12 5 -1.</_>\r
+                <_>\r
+                  10 1 6 5 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-8.1267888890579343e-004</threshold>\r
+            <left_val>5.9364068508148193e-001</left_val>\r
+            <right_val>-8.9295238256454468e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 4 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  37 9 3 3 -1.</_>\r
+                <_>\r
+                  38 9 1 3 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>8.3705072756856680e-004</threshold>\r
+            <left_val>-6.4887362718582153e-001</left_val>\r
+            <right_val>7.8537952899932861e-001</right_val></_></_></trees>\r
+      <stage_threshold>-1.0618970394134521e+000</stage_threshold>\r
+      <parent>11</parent>\r
+      <next>-1</next></_>\r
+    <_>\r
+      <!-- stage 13 -->\r
+      <trees>\r
+        <_>\r
+          <!-- tree 0 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  54 0 10 6 -1.</_>\r
+                <_>\r
+                  54 0 5 3 2.</_>\r
+                <_>\r
+                  59 3 5 3 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-9.7556859254837036e-003</threshold>\r
+            <left_val>7.6982218027114868e-001</left_val>\r
+            <right_val>-8.5293501615524292e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 1 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  47 0 6 11 -1.</_>\r
+                <_>\r
+                  49 0 2 11 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-8.6617246270179749e-003</threshold>\r
+            <left_val>8.4029090404510498e-001</left_val>\r
+            <right_val>-7.1949690580368042e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 2 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  19 2 20 2 -1.</_>\r
+                <_>\r
+                  19 3 20 1 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>1.6897840425372124e-002</threshold>\r
+            <left_val>-5.3601992130279541e-001</left_val>\r
+            <right_val>9.5484441518783569e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 3 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  14 4 6 11 -1.</_>\r
+                <_>\r
+                  17 4 3 11 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>4.7526158596156165e-005</threshold>\r
+            <left_val>-7.6412862539291382e-001</left_val>\r
+            <right_val>7.5398761034011841e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 4 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  31 9 33 2 -1.</_>\r
+                <_>\r
+                  42 9 11 2 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>6.5607670694589615e-003</threshold>\r
+            <left_val>-9.9346441030502319e-001</left_val>\r
+            <right_val>6.4864277839660645e-001</right_val></_></_></trees>\r
+      <stage_threshold>-7.3307347297668457e-001</stage_threshold>\r
+      <parent>12</parent>\r
+      <next>-1</next></_>\r
+    <_>\r
+      <!-- stage 14 -->\r
+      <trees>\r
+        <_>\r
+          <!-- tree 0 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  6 1 53 6 -1.</_>\r
+                <_>\r
+                  6 3 53 2 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>1.0103269666433334e-001</threshold>\r
+            <left_val>-7.3275578022003174e-001</left_val>\r
+            <right_val>8.4619927406311035e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 1 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  49 9 4 6 -1.</_>\r
+                <_>\r
+                  49 9 2 3 2.</_>\r
+                <_>\r
+                  51 12 2 3 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-2.8920811018906534e-004</threshold>\r
+            <left_val>7.1564781665802002e-001</left_val>\r
+            <right_val>-8.8221758604049683e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 2 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  0 9 30 7 -1.</_>\r
+                <_>\r
+                  10 9 10 7 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>1.0838840156793594e-002</threshold>\r
+            <left_val>-8.7420248985290527e-001</left_val>\r
+            <right_val>6.0648679733276367e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 3 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  40 4 6 2 -1.</_>\r
+                <_>\r
+                  42 4 2 2 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>5.0803890917450190e-004</threshold>\r
+            <left_val>-9.0554022789001465e-001</left_val>\r
+            <right_val>6.4213967323303223e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 4 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  1 9 6 1 -1.</_>\r
+                <_>\r
+                  3 9 2 1 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>2.3357039317488670e-003</threshold>\r
+            <left_val>-9.2574918270111084e-001</left_val>\r
+            <right_val>8.6384928226470947e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 5 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  47 3 4 10 -1.</_>\r
+                <_>\r
+                  47 8 4 5 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>8.0239427916239947e-005</threshold>\r
+            <left_val>-9.9618428945541382e-001</left_val>\r
+            <right_val>9.5355111360549927e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 6 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  31 5 30 11 -1.</_>\r
+                <_>\r
+                  41 5 10 11 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>3.2030208967626095e-003</threshold>\r
+            <left_val>-1.</left_val>\r
+            <right_val>1.0001050233840942e+000</right_val></_></_>\r
+        <_>\r
+          <!-- tree 7 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  0 0 2 1 -1.</_>\r
+                <_>\r
+                  1 0 1 1 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>0.</threshold>\r
+            <left_val>0.</left_val>\r
+            <right_val>-1.</right_val></_></_>\r
+        <_>\r
+          <!-- tree 8 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  21 3 42 5 -1.</_>\r
+                <_>\r
+                  35 3 14 5 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>2.6143440045416355e-003</threshold>\r
+            <left_val>-1.</left_val>\r
+            <right_val>1.0002139806747437e+000</right_val></_></_>\r
+        <_>\r
+          <!-- tree 9 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  0 0 2 1 -1.</_>\r
+                <_>\r
+                  1 0 1 1 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>0.</threshold>\r
+            <left_val>0.</left_val>\r
+            <right_val>-1.</right_val></_></_>\r
+        <_>\r
+          <!-- tree 10 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  8 5 30 9 -1.</_>\r
+                <_>\r
+                  8 8 30 3 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-7.0475979009643197e-004</threshold>\r
+            <left_val>1.</left_val>\r
+            <right_val>-9.9976968765258789e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 11 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  3 12 33 3 -1.</_>\r
+                <_>\r
+                  14 12 11 3 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>2.1271279547363520e-003</threshold>\r
+            <left_val>-9.9694627523422241e-001</left_val>\r
+            <right_val>1.0002720355987549e+000</right_val></_></_>\r
+        <_>\r
+          <!-- tree 12 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  0 0 3 2 -1.</_>\r
+                <_>\r
+                  1 0 1 2 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-2.4224430671893060e-004</threshold>\r
+            <left_val>1.</left_val>\r
+            <right_val>-1.</right_val></_></_>\r
+        <_>\r
+          <!-- tree 13 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  46 4 3 8 -1.</_>\r
+                <_>\r
+                  47 4 1 8 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>7.4700301047414541e-004</threshold>\r
+            <left_val>-9.9108231067657471e-001</left_val>\r
+            <right_val>9.9941182136535645e-001</right_val></_></_></trees>\r
+      <stage_threshold>-1.0991690158843994e+000</stage_threshold>\r
+      <parent>13</parent>\r
+      <next>-1</next></_>\r
+    <_>\r
+      <!-- stage 15 -->\r
+      <trees>\r
+        <_>\r
+          <!-- tree 0 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  1 2 6 5 -1.</_>\r
+                <_>\r
+                  3 2 2 5 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>1.7227890202775598e-003</threshold>\r
+            <left_val>-9.3608891963958740e-001</left_val>\r
+            <right_val>8.7251222133636475e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 1 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  0 3 18 5 -1.</_>\r
+                <_>\r
+                  6 3 6 5 3.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>2.7599320746958256e-003</threshold>\r
+            <left_val>-9.9757021665573120e-001</left_val>\r
+            <right_val>1.0000289678573608e+000</right_val></_></_>\r
+        <_>\r
+          <!-- tree 2 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  3 1 6 14 -1.</_>\r
+                <_>\r
+                  6 1 3 14 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-8.9444358309265226e-005</threshold>\r
+            <left_val>1.</left_val>\r
+            <right_val>-9.9264812469482422e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 3 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  3 6 2 10 -1.</_>\r
+                <_>\r
+                  3 11 2 5 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-2.7962020249105990e-004</threshold>\r
+            <left_val>8.2833290100097656e-001</left_val>\r
+            <right_val>-9.8444151878356934e-001</right_val></_></_>\r
+        <_>\r
+          <!-- tree 4 -->\r
+          <_>\r
+            <!-- root node -->\r
+            <feature>\r
+              <rects>\r
+                <_>\r
+                  42 0 4 6 -1.</_>\r
+                <_>\r
+                  42 0 2 3 2.</_>\r
+                <_>\r
+                  44 3 2 3 2.</_></rects>\r
+              <tilted>0</tilted></feature>\r
+            <threshold>-2.7560539820115082e-005</threshold>\r
+            <left_val>1.</left_val>\r
+            <right_val>-9.9543339014053345e-001</right_val></_></_></trees>\r
+      <stage_threshold>-9.1314977407455444e-001</stage_threshold>\r
+      <parent>14</parent>\r
+      <next>-1</next></_></stages></haarcascade_pltzzz64x16_16STG>\r
+</opencv_storage>\r
index dc9b287..fd40475 100644 (file)
@@ -15,7 +15,15 @@ Finds centers of clusters and groups input samples around the clusters.
 
     :param samples: Floating-point matrix of input samples, one row per sample.
 
-    :param data: Data for clustering.
+    :param data: Data for clustering. An array of N-Dimensional points with float coordinates is needed. Examples of this array can be:
+
+           * ``Mat points(count, 2, CV_32F);``
+
+           * ``Mat points(count, 1, CV_32FC2);``
+
+           * ``Mat points(1, count, CV_32FC2);``
+
+           * ``std::vector<cv::Point2f> points(sampleCount);``
 
     :param cluster_count: Number of clusters to split the set by.
 
index 1fb9265..f6ad607 100644 (file)
@@ -738,6 +738,26 @@ CV_ENUM(NormType, NORM_INF, NORM_L1, NORM_L2)
 typedef std::tr1::tuple<Size, MatType, NormType> NormParams;
 typedef TestBaseWithParam<NormParams> NormFixture;
 
+OCL_PERF_TEST_P(NormFixture, Norm1Arg,
+                ::testing::Combine(OCL_PERF_ENUM(OCL_SIZE_1, OCL_SIZE_2, OCL_SIZE_3),
+                                   OCL_TEST_TYPES_134, NormType::all()))
+{
+    const NormParams params = GetParam();
+    const Size srcSize = get<0>(params);
+    const int type = get<1>(params);
+    const int normType = get<2>(params);
+
+    checkDeviceMaxMemoryAllocSize(srcSize, type);
+
+    UMat src1(srcSize, type);
+    double res;
+    declare.in(src1, WARMUP_RNG);
+
+    OCL_TEST_CYCLE() res = cv::norm(src1, normType);
+
+    SANITY_CHECK(res, 1e-5, ERROR_RELATIVE);
+}
+
 OCL_PERF_TEST_P(NormFixture, Norm,
                 ::testing::Combine(OCL_PERF_ENUM(OCL_SIZE_1, OCL_SIZE_2, OCL_SIZE_3),
                                    OCL_TEST_TYPES_134, NormType::all()))
@@ -910,6 +930,24 @@ OCL_PERF_TEST_P(NormalizeFixture, Normalize,
     SANITY_CHECK(dst, 5e-2);
 }
 
+OCL_PERF_TEST_P(NormalizeFixture, NormalizeWithMask,
+                ::testing::Combine(OCL_TEST_SIZES, OCL_PERF_ENUM(CV_8UC1, CV_32FC1),
+                                   NormalizeModes::all()))
+{
+    const NormalizeParams params = GetParam();
+    const Size srcSize = get<0>(params);
+    const int type = get<1>(params), mode = get<2>(params);
+
+    checkDeviceMaxMemoryAllocSize(srcSize, type);
+
+    UMat src(srcSize, type), mask(srcSize, CV_8UC1), dst(srcSize, type);
+    declare.in(src, mask, WARMUP_RNG).out(dst);
+
+    OCL_TEST_CYCLE() cv::normalize(src, dst, 10, 110, mode, -1, mask);
+
+    SANITY_CHECK(dst, 5e-2);
+}
+
 ///////////// ConvertScaleAbs ////////////////////////
 
 typedef Size_MatType ConvertScaleAbsFixture;
index 51605b9..9bb3755 100644 (file)
@@ -122,6 +122,29 @@ OCL_PERF_TEST_P(CopyToFixture, CopyToWithMask,
     SANITY_CHECK(dst);
 }
 
+OCL_PERF_TEST_P(CopyToFixture, CopyToWithMaskUninit,
+                ::testing::Combine(OCL_PERF_ENUM(OCL_SIZE_1, OCL_SIZE_2, OCL_SIZE_3), OCL_TEST_TYPES))
+{
+    const Size_MatType_t params = GetParam();
+    const Size srcSize = get<0>(params);
+    const int type = get<1>(params);
+
+    checkDeviceMaxMemoryAllocSize(srcSize, type);
+
+    UMat src(srcSize, type), dst, mask(srcSize, CV_8UC1);
+    declare.in(src, mask, WARMUP_RNG);
+
+    for ( ;  next(); )
+    {
+        dst.release();
+        startTimer();
+        src.copyTo(dst, mask);
+        stopTimer();
+    }
+
+    SANITY_CHECK(dst);
+}
+
 } } // namespace cvtest::ocl
 
 #endif // HAVE_OPENCL
index be93577..4fbc593 100644 (file)
@@ -758,16 +758,28 @@ void flip( InputArray _src, OutputArray _dst, int flip_mode )
 
 static bool ocl_repeat(InputArray _src, int ny, int nx, OutputArray _dst)
 {
+    if (ny == 1 && nx == 1)
+    {
+        _src.copyTo(_dst);
+        return true;
+    }
+
+    int type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type),
+            rowsPerWI = ocl::Device::getDefault().isIntel() ? 4 : 1,
+            kercn = std::min(ocl::predictOptimalVectorWidth(_src, _dst), 4);
+
+    ocl::Kernel k("repeat", ocl::core::repeat_oclsrc,
+                  format("-D T=%s -D nx=%d -D ny=%d -D rowsPerWI=%d -D cn=%d",
+                         ocl::memopTypeToStr(CV_MAKE_TYPE(depth, kercn)),
+                         nx, ny, rowsPerWI, kercn));
+    if (k.empty())
+        return false;
+
     UMat src = _src.getUMat(), dst = _dst.getUMat();
+    k.args(ocl::KernelArg::ReadOnly(src, cn, kercn), ocl::KernelArg::WriteOnlyNoSize(dst));
 
-    for (int y = 0; y < ny; ++y)
-        for (int x = 0; x < nx; ++x)
-        {
-            Rect roi(x * src.cols, y * src.rows, src.cols, src.rows);
-            UMat hdr(dst, roi);
-            src.copyTo(hdr);
-        }
-    return true;
+    size_t globalsize[] = { src.cols * cn / kercn, (src.rows + rowsPerWI - 1) / rowsPerWI };
+    return k.run(2, globalsize, NULL, false);
 }
 
 #endif
index e86dd2d..d4ece37 100644 (file)
@@ -2897,7 +2897,7 @@ static void IDCT_64f(const double* src, int src_step, double* dft_src, double* d
 
 namespace cv
 {
-#if defined HAVE_IPP && IPP_VERSION_MAJOR >= 7 && !defined HAVE_IPP_ICV_ONLY
+#if defined HAVE_IPP && IPP_VERSION_MAJOR >= 7
 
 typedef IppStatus (CV_STDCALL * ippiDCTFunc)(const Ipp32f*, int, Ipp32f*, int, const void*, Ipp8u*);
 typedef IppStatus (CV_STDCALL * ippiDCTInitAlloc)(void**, IppiSize, IppHintAlgorithm);
@@ -3050,7 +3050,7 @@ void cv::dct( InputArray _src0, OutputArray _dst, int flags )
     _dst.create( src.rows, src.cols, type );
     Mat dst = _dst.getMat();
 
-#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7) && !defined HAVE_IPP_ICV_ONLY
+#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
     bool row = (flags & DCT_ROWS) != 0;
     if (src.type() == CV_32F)
     {
index 6c6832a..0b99872 100644 (file)
@@ -3643,9 +3643,9 @@ static IppFlipFunc getFlipFunc(int depth)
     CV_SUPPRESS_DEPRECATED_START
     return
             depth == CV_8U || depth == CV_8S ? (IppFlipFunc)ippsFlip_8u_I :
-            /*depth == CV_16U || depth == CV_16S ? (IppFlipFunc)ippsFlip_16u_I :
+            depth == CV_16U || depth == CV_16S ? (IppFlipFunc)ippsFlip_16u_I :
             depth == CV_32S || depth == CV_32F ? (IppFlipFunc)ippsFlip_32f_I :
-            depth == CV_64F ? (IppFlipFunc)ippsFlip_64f_I : */0;
+            depth == CV_64F ? (IppFlipFunc)ippsFlip_64f_I : 0;
     CV_SUPPRESS_DEPRECATED_END
 }
 
@@ -3700,7 +3700,7 @@ template<typename T> static void sort_( const Mat& src, Mat& dst, int flags )
 #endif
         {
 #ifdef USE_IPP_SORT
-            if (depth != CV_8U)
+            if (depth == CV_8U)
                 setIppErrorStatus();
 #endif
             std::sort( ptr, ptr + len );
index bbe87fa..b580df1 100644 (file)
@@ -4406,8 +4406,8 @@ String kernelToStr(InputArray _kernel, int ddepth, const char * name)
             CV_Assert(src.isMat() || src.isUMat()); \
             int ctype = src.type(), ccn = CV_MAT_CN(ctype); \
             Size csize = src.size(); \
-            cols.push_back(ccn * src.size().width); \
-            if (ctype != type || csize != ssize) \
+            cols.push_back(ccn * csize.width); \
+            if (ctype != type) \
                 return 1; \
             offsets.push_back(src.offset()); \
             steps.push_back(src.step()); \
diff --git a/modules/core/src/opencl/repeat.cl b/modules/core/src/opencl/repeat.cl
new file mode 100644 (file)
index 0000000..21be121
--- /dev/null
@@ -0,0 +1,47 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+// Copyright (C) 2014, Itseez, Inc., all rights reserved.
+// Third party copyrights are property of their respective owners.
+
+#if cn != 3
+#define loadpix(addr) *(__global const T *)(addr)
+#define storepix(val, addr)  *(__global T *)(addr) = val
+#define TSIZE (int)sizeof(T)
+#else
+#define loadpix(addr) vload3(0, (__global const T1 *)(addr))
+#define storepix(val, addr) vstore3(val, 0, (__global T1 *)(addr))
+#define TSIZE ((int)sizeof(T1)*3)
+#endif
+
+__kernel void repeat(__global const uchar * srcptr, int src_step, int src_offset, int src_rows, int src_cols,
+                     __global uchar * dstptr, int dst_step, int dst_offset)
+{
+    int x = get_global_id(0);
+    int y0 = get_global_id(1) * rowsPerWI;
+
+    if (x < src_cols)
+    {
+        int src_index = mad24(y0, src_step, mad24(x, (int)sizeof(T), src_offset));
+        int dst_index0 = mad24(y0, dst_step, mad24(x, (int)sizeof(T), dst_offset));
+
+        for (int y = y0, y1 = min(src_rows, y0 + rowsPerWI); y < y1; ++y, src_index += src_step, dst_index0 += dst_step)
+        {
+            T srcelem = loadpix(srcptr + src_index);
+
+            #pragma unroll
+            for (int ey = 0; ey < ny; ++ey)
+            {
+                int dst_index = mad24(ey * src_rows, dst_step, dst_index0);
+
+                #pragma unroll
+                for (int ex = 0; ex < nx; ++ex)
+                {
+                    storepix(srcelem, dstptr + dst_index);
+                    dst_index = mad24(src_cols, (int)sizeof(T), dst_index);
+                }
+            }
+        }
+    }
+}
index 2a7f24e..6f9a7e1 100644 (file)
@@ -167,13 +167,15 @@ TEST(Features2d_Detector_Keypoints_Dense, validation)
     test.safe_run();
 }
 
-TEST(Features2d_Detector_Keypoints_KAZE, validation)
+// FIXIT #2807 Crash on Windows 7 x64 MSVS 2012, Linux Fedora 19 x64 with GCC 4.8.2, Linux Ubuntu 14.04 LTS x64 with GCC 4.8.2
+TEST(Features2d_Detector_Keypoints_KAZE, DISABLED_validation)
 {
     CV_FeatureDetectorKeypointsTest test(Algorithm::create<FeatureDetector>("Feature2D.KAZE"));
     test.safe_run();
 }
 
-TEST(Features2d_Detector_Keypoints_AKAZE, validation)
+// FIXIT #2807 Crash on Windows 7 x64 MSVS 2012, Linux Fedora 19 x64 with GCC 4.8.2, Linux Ubuntu 14.04 LTS x64 with GCC 4.8.2
+TEST(Features2d_Detector_Keypoints_AKAZE, DISABLED_validation)
 {
     CV_FeatureDetectorKeypointsTest test_kaze(cv::Ptr<FeatureDetector>(new cv::AKAZE(cv::AKAZE::DESCRIPTOR_KAZE)));
     test_kaze.safe_run();
index 07123be..69ba6f0 100644 (file)
@@ -652,7 +652,8 @@ TEST(Features2d_ScaleInvariance_Detector_BRISK, regression)
     test.safe_run();
 }
 
-TEST(Features2d_ScaleInvariance_Detector_KAZE, regression)
+// FIXIT #2807 Crash on Windows 7 x64 MSVS 2012, Linux Fedora 19 x64 with GCC 4.8.2, Linux Ubuntu 14.04 LTS x64 with GCC 4.8.2
+TEST(Features2d_ScaleInvariance_Detector_KAZE, DISABLED_regression)
 {
     DetectorScaleInvarianceTest test(Algorithm::create<FeatureDetector>("Feature2D.KAZE"),
         0.08f,
@@ -660,13 +661,15 @@ TEST(Features2d_ScaleInvariance_Detector_KAZE, regression)
     test.safe_run();
 }
 
-TEST(Features2d_ScaleInvariance_Detector_AKAZE, regression)
+// FIXIT #2807 Crash on Windows 7 x64 MSVS 2012, Linux Fedora 19 x64 with GCC 4.8.2, Linux Ubuntu 14.04 LTS x64 with GCC 4.8.2
+TEST(Features2d_ScaleInvariance_Detector_AKAZE, DISABLED_regression)
 {
     DetectorScaleInvarianceTest test(Algorithm::create<FeatureDetector>("Feature2D.AKAZE"),
         0.08f,
         0.49f);
     test.safe_run();
 }
+
 //TEST(Features2d_ScaleInvariance_Detector_ORB, regression)
 //{
 //    DetectorScaleInvarianceTest test(Algorithm::create<FeatureDetector>("Feature2D.ORB"),
index 721b45a..1ee7367 100644 (file)
@@ -9,25 +9,24 @@ namespace ocl {
 
 CV_ENUM(MethodType, TM_SQDIFF, TM_SQDIFF_NORMED, TM_CCORR, TM_CCORR_NORMED, TM_CCOEFF, TM_CCOEFF_NORMED)
 
-typedef std::tr1::tuple<Size, Size, MethodType> ImgSize_TmplSize_Method_t;
-typedef TestBaseWithParam<ImgSize_TmplSize_Method_t> ImgSize_TmplSize_Method;
+typedef std::tr1::tuple<Size, Size, MethodType, MatType> ImgSize_TmplSize_Method_MatType_t;
+typedef TestBaseWithParam<ImgSize_TmplSize_Method_MatType_t> ImgSize_TmplSize_Method_MatType;
 
-OCL_PERF_TEST_P(ImgSize_TmplSize_Method, MatchTemplate,
+OCL_PERF_TEST_P(ImgSize_TmplSize_Method_MatType, MatchTemplate,
         ::testing::Combine(
-            testing::Values(szSmall128, cv::Size(320, 240),
-                            cv::Size(640, 480), cv::Size(800, 600),
-                            cv::Size(1024, 768), cv::Size(1280, 1024)),
-            testing::Values(cv::Size(12, 12), cv::Size(28, 9),
-                            cv::Size(8, 30), cv::Size(16, 16)),
-            MethodType::all()
+            testing::Values(cv::Size(640, 480), cv::Size(1280, 1024)),
+            testing::Values(cv::Size(11, 11), cv::Size(16, 16), cv::Size(41, 41)),
+            MethodType::all(),
+            testing::Values(CV_8UC1, CV_8UC3, CV_32FC1, CV_32FC3)
             )
         )
 {
-    const ImgSize_TmplSize_Method_t params = GetParam();
+    const ImgSize_TmplSize_Method_MatType_t params = GetParam();
     const Size imgSz = get<0>(params), tmplSz = get<1>(params);
     const int method = get<2>(params);
+    int type = get<3>(GetParam());
 
-    UMat img(imgSz, CV_8UC1), tmpl(tmplSz, CV_8UC1);
+    UMat img(imgSz, type), tmpl(tmplSz, type);
     UMat result(imgSz - tmplSz + Size(1, 1), CV_32F);
 
     declare.in(img, tmpl, WARMUP_RNG).out(result);
@@ -41,13 +40,9 @@ OCL_PERF_TEST_P(ImgSize_TmplSize_Method, MatchTemplate,
     double eps = isNormed ? 3e-2
         : 255 * 255 * tmpl.total() * 1e-4;
 
-    if (isNormed)
-        SANITY_CHECK(result, eps, ERROR_RELATIVE);
-    else
-        SANITY_CHECK(result, eps);
+    SANITY_CHECK(result, eps, ERROR_RELATIVE);
 }
 
-
 /////////// matchTemplate (performance tests from 2.4) ////////////////////////
 
 typedef Size_MatType CV_TM_CCORRFixture;
@@ -91,4 +86,4 @@ OCL_PERF_TEST_P(CV_TM_CCORR_NORMEDFixture, matchTemplate,
 
 } }
 
-#endif // HAVE_OPENCL
+#endif // HAVE_OPENCL
\ No newline at end of file
index 5975845..8bbc318 100644 (file)
@@ -95,7 +95,7 @@ OCL_PERF_TEST_P(PyrUpFixture, PyrUp,
     UMat src(srcSize, type), dst(dstSize, type);
     declare.in(src, WARMUP_RNG).out(dst);
 
-    OCL_TEST_CYCLE() cv::pyrDown(src, dst);
+    OCL_TEST_CYCLE() cv::pyrUp(src, dst);
 
     SANITY_CHECK(dst, eps);
 }
index 4ec4647..f2da6ce 100644 (file)
@@ -248,7 +248,7 @@ PERF_TEST_P(Size_CvtMode, cvtColor8u,
             )
 {
     Size sz = get<0>(GetParam());
-    int mode = get<1>(GetParam());
+    int _mode = get<1>(GetParam()), mode = _mode;
     ChPair ch = getConversionInfo(mode);
     mode %= COLOR_COLORCVT_MAX;
 
@@ -261,7 +261,11 @@ PERF_TEST_P(Size_CvtMode, cvtColor8u,
     int runs = sz.width <= 320 ? 100 : 5;
     TEST_CYCLE_MULTIRUN(runs) cvtColor(src, dst, mode, ch.dcn);
 
+#if defined(__APPLE__) && defined(HAVE_IPP)
+    SANITY_CHECK(dst, _mode == CX_BGRA2HLS_FULL ? 2 : 1);
+#else
     SANITY_CHECK(dst, 1);
+#endif
 }
 
 typedef std::tr1::tuple<Size, CvtModeBayer> Size_CvtMode_Bayer_t;
diff --git a/modules/imgproc/perf/perf_floodfill.cpp b/modules/imgproc/perf/perf_floodfill.cpp
new file mode 100644 (file)
index 0000000..5c72acf
--- /dev/null
@@ -0,0 +1,73 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+// Copyright (C) 2014, Itseez, Inc., all rights reserved.
+// Third party copyrights are property of their respective owners.
+
+#include "perf_precomp.hpp"
+
+using namespace std;
+using namespace cv;
+using namespace perf;
+using namespace testing;
+using std::tr1::make_tuple;
+using std::tr1::get;
+
+typedef std::tr1::tuple<string, Point, int, int, int, int> Size_Source_Fl_t;
+typedef perf::TestBaseWithParam<Size_Source_Fl_t> Size_Source_Fl;
+
+PERF_TEST_P(Size_Source_Fl, floodFill1, Combine(
+    testing::Values("cv/shared/fruits.png", "cv/optflow/RubberWhale1.png"), //images
+            testing::Values(Point(120, 82), Point(200, 140)), //seed points
+            testing::Values(4,8), //connectivity
+            testing::Values((int)IMREAD_COLOR, (int)IMREAD_GRAYSCALE), //color image, or not
+            testing::Values(0, 1, 2), //use fixed(1), gradient (2) or simple(0) mode
+            testing::Values((int)CV_8U, (int)CV_32F, (int)CV_32S) //image depth
+            ))
+{
+    //test given image(s)
+    string filename = getDataPath(get<0>(GetParam()));
+    Point pseed;
+    pseed = get<1>(GetParam());
+
+    int connectivity = get<2>(GetParam());
+    int colorType = get<3>(GetParam());
+    int modeType = get<4>(GetParam());
+    int imdepth = get<5>(GetParam());
+
+    Mat image0 = imread(filename, colorType);
+
+    Scalar newval, loVal, upVal;
+    if (modeType == 0)
+    {
+        loVal = Scalar(0, 0, 0);
+        upVal = Scalar(0, 0, 0);
+    }
+    else
+    {
+        loVal = Scalar(4, 4, 4);
+        upVal = Scalar(20, 20, 20);
+    }
+    int newMaskVal = 255;  //base mask for floodfill type
+    int flags = connectivity + (newMaskVal << 8) + (modeType == 1 ? FLOODFILL_FIXED_RANGE : 0);
+
+    int b = 152;//(unsigned)theRNG() & 255;
+    int g = 136;//(unsigned)theRNG() & 255;
+    int r = 53;//(unsigned)theRNG() & 255;
+    newval = (colorType == IMREAD_COLOR) ? Scalar(b, g, r) : Scalar(r*0.299 + g*0.587 + b*0.114);
+
+    Rect outputRect = Rect();
+    Mat source = Mat();
+
+    for (;  next(); )
+    {
+        image0.convertTo(source, imdepth);
+        startTimer();
+        cv::floodFill(source, pseed, newval, &outputRect, loVal, upVal, flags);
+        stopTimer();
+    }
+    EXPECT_EQ(image0.cols, source.cols);
+    EXPECT_EQ(image0.rows, source.rows);
+    SANITY_CHECK_NOTHING();
+}
index 200c316..eeb20fb 100644 (file)
@@ -460,7 +460,7 @@ void cv::cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockSize, in
     Mat src = _src.getMat();
     _dst.create( src.size(), CV_32FC1 );
     Mat dst = _dst.getMat();
-#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) && (IPP_VERSION_MAJOR >= 8)
+#if defined(HAVE_IPP) && (IPP_VERSION_MAJOR >= 8)
     typedef IppStatus (CV_STDCALL * ippiMinEigenValGetBufferSize)(IppiSize, int, int, int*);
     typedef IppStatus (CV_STDCALL * ippiMinEigenVal)(const void*, int, Ipp32f*, int, IppiSize, IppiKernelType, int, int, Ipp8u*);
     IppiKernelType kerType;
@@ -544,7 +544,7 @@ void cv::cornerHarris( InputArray _src, OutputArray _dst, int blockSize, int ksi
             scale *= 2.0;
         if (depth == CV_8U)
             scale *= 255.0;
-        scale = std::pow(scale, -4.0f);
+        scale = std::pow(scale, -4.0);
 
         if (ippiHarrisCornerGetBufferSize(roisize, masksize, blockSize, datatype, cn, &bufsize) >= 0)
         {
index ac8ee8c..111e6b6 100755 (executable)
@@ -364,7 +364,7 @@ void cv::integral( InputArray _src, OutputArray _sum, OutputArray _sqsum, Output
         sqsum = _sqsum.getMat();
     };
 
-#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7) && !defined HAVE_IPP_ICV_ONLY
+#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) // Disabled on ICV due invalid results
     if( ( depth == CV_8U ) && ( sdepth == CV_32F || sdepth == CV_32S ) && ( !_tilted.needed() ) && ( !_sqsum.needed() || sqdepth == CV_64F ) && ( cn == 1 ) )
     {
         IppStatus status = ippStsErr;
index 99e9ec7..9bcf035 100644 (file)
@@ -333,12 +333,6 @@ void CvCalibFilter::Stop( bool calibrate )
                                    points[0],points[1],
                                    buffer,
                                    &stereo);
-
-                for( i = 0; i < 9; i++ )
-                {
-                    stereo.fundMatr[i] = stereo.fundMatr[i];
-                }
-
             }
 
         }
index 11c9906..680ac65 100644 (file)
@@ -86,9 +86,11 @@ Detects objects of different sizes in the input image. The detected objects are
 
 .. ocv:function:: void CascadeClassifier::detectMultiScale( InputArray image, vector<Rect>& objects, double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size(), Size maxSize=Size())
 .. ocv:function:: void CascadeClassifier::detectMultiScale( InputArray image, vector<Rect>& objects, vector<int>& numDetections, double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size(), Size maxSize=Size())
+.. ocv:function:: void CascadeClassifier::detectMultiScale( InputArray image, std::vector<Rect>& objects, std::vector<int>& rejectLevels, std::vector<double>& levelWeights, double scaleFactor = 1.1, int minNeighbors = 3, int flags = 0, Size minSize = Size(), Size maxSize = Size(), bool outputRejectLevels = false )
 
 .. ocv:pyfunction:: cv2.CascadeClassifier.detectMultiScale(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]]) -> objects
-.. ocv:pyfunction:: cv2.CascadeClassifier.detectMultiScale(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize[, outputRejectLevels]]]]]]) -> objects, rejectLevels, levelWeights
+.. ocv:pyfunction:: cv2.CascadeClassifier.detectMultiScale2(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]]) -> objects, numDetections
+.. ocv:pyfunction:: cv2.CascadeClassifier.detectMultiScale3(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize[, outputRejectLevels]]]]]]) -> objects, rejectLevels, levelWeights
 
 .. ocv:cfunction:: CvSeq* cvHaarDetectObjects( const CvArr* image, CvHaarClassifierCascade* cascade, CvMemStorage* storage, double scale_factor=1.1, int min_neighbors=3, int flags=0, CvSize min_size=cvSize(0,0), CvSize max_size=cvSize(0,0) )
 
@@ -110,6 +112,8 @@ Detects objects of different sizes in the input image. The detected objects are
 
     :param maxSize: Maximum possible object size. Objects larger than that are ignored.
 
+    :param outputRejectLevels: Boolean. If ``True``, it returns the rejectLevels and levelWeights. Default value is ``False``.
+
 The function is parallelized with the TBB library.
 
 .. note::
index 5f2a627..d62e529 100644 (file)
@@ -189,7 +189,7 @@ public:
                           Size minSize = Size(),
                           Size maxSize = Size() );
 
-    CV_WRAP void detectMultiScale( InputArray image,
+    CV_WRAP_AS(detectMultiScale2) void detectMultiScale( InputArray image,
                           CV_OUT std::vector<Rect>& objects,
                           CV_OUT std::vector<int>& numDetections,
                           double scaleFactor=1.1,
@@ -197,7 +197,7 @@ public:
                           Size minSize=Size(),
                           Size maxSize=Size() );
 
-    CV_WRAP void detectMultiScale( InputArray image,
+    CV_WRAP_AS(detectMultiScale3) void detectMultiScale( InputArray image,
                                   CV_OUT std::vector<Rect>& objects,
                                   CV_OUT std::vector<int>& rejectLevels,
                                   CV_OUT std::vector<double>& levelWeights,
index 1372ff9..340242f 100644 (file)
@@ -999,19 +999,18 @@ template<>
 bool pyopencv_to(PyObject *o, cv::flann::IndexParams& p, const char *name)
 {
     (void)name;
-    bool ok = false;
-    PyObject* keys = PyObject_CallMethod(o,(char*)"keys",0);
-    PyObject* values = PyObject_CallMethod(o,(char*)"values",0);
-
-    if( keys && values )
-    {
-        int i, n = (int)PyList_GET_SIZE(keys);
-        for( i = 0; i < n; i++ )
-        {
-            PyObject* key = PyList_GET_ITEM(keys, i);
-            PyObject* item = PyList_GET_ITEM(values, i);
-            if( !PyString_Check(key) )
+    bool ok = true;
+    PyObject* key = NULL;
+    PyObject* item = NULL;
+    Py_ssize_t pos = 0;
+
+    if(PyDict_Check(o)) {
+        while(PyDict_Next(o, &pos, &key, &item)) {
+            if( !PyString_Check(key) ) {
+                ok = false;
                 break;
+            }
+
             String k = PyString_AsString(key);
             if( PyString_Check(item) )
             {
@@ -1034,14 +1033,14 @@ bool pyopencv_to(PyObject *o, cv::flann::IndexParams& p, const char *name)
                 p.setDouble(k, value);
             }
             else
+            {
+                ok = false;
                 break;
+            }
         }
-        ok = i == n && !PyErr_Occurred();
     }
 
-    Py_XDECREF(keys);
-    Py_XDECREF(values);
-    return ok;
+    return ok && !PyErr_Occurred();
 }
 
 template<>
index 4f0f313..3e93939 100644 (file)
@@ -895,8 +895,8 @@ namespace cv
             int pitchAlign = (int)ocl::Device::getDefault().imagePitchAlignment();
             if (pitchAlign>0)
             {
-                prevPyr[0] = UMat(prevImg.rows,(prevImg.cols+pitchAlign-1)&(-pitchAlign),prevImg.type()).colRange(0,prevImg.cols);
-                nextPyr[0] = UMat(nextImg.rows,(nextImg.cols+pitchAlign-1)&(-pitchAlign),nextImg.type()).colRange(0,nextImg.cols);
+                prevPyr[0] = UMat(prevImg.rows,(prevImg.cols+pitchAlign-1)&(-pitchAlign),CV_32FC1).colRange(0,prevImg.cols);
+                nextPyr[0] = UMat(nextImg.rows,(nextImg.cols+pitchAlign-1)&(-pitchAlign),CV_32FC1).colRange(0,nextImg.cols);
                 for (int level = 1; level <= maxLevel; ++level)
                 {
                     int cols,rows;