Merge remote-tracking branch 'upstream/3.4' into merge-3.4
authorAlexander Alekhin <alexander.alekhin@intel.com>
Tue, 7 Aug 2018 17:09:27 +0000 (20:09 +0300)
committerAlexander Alekhin <alexander.alekhin@intel.com>
Tue, 7 Aug 2018 17:12:10 +0000 (20:12 +0300)
1  2 
cmake/OpenCVDetectCUDA.cmake
modules/core/src/utils/filesystem.cpp
modules/core/test/test_mat.cpp
modules/imgproc/include/opencv2/imgproc.hpp
modules/ml/src/svm.cpp
modules/stitching/src/matchers.cpp
modules/videoio/src/cap_v4l.cpp
samples/CMakeLists.txt

Simple merge
@@@ -469,7 -469,32 +469,32 @@@ cv::String getCacheDirectory(const char
          {
              if (utils::fs::isDirectory(default_cache_path))
              {
-                 default_cache_path = utils::fs::join(default_cache_path, utils::fs::join("opencv", CV_VERSION));
+                 cv::String default_cache_path_base = utils::fs::join(default_cache_path, "opencv");
 -                default_cache_path = utils::fs::join(default_cache_path_base, "3.4.x" CV_VERSION_STATUS);
++                default_cache_path = utils::fs::join(default_cache_path_base, "4.0" CV_VERSION_STATUS);
+                 if (utils::getConfigurationParameterBool("OPENCV_CACHE_SHOW_CLEANUP_MESSAGE", true)
+                     && !utils::fs::isDirectory(default_cache_path))
+                 {
+                     std::vector<cv::String> existedCacheDirs;
+                     try
+                     {
+                         utils::fs::glob_relative(default_cache_path_base, "*", existedCacheDirs, false, true);
+                     }
+                     catch (...)
+                     {
+                         // ignore
+                     }
+                     if (!existedCacheDirs.empty())
+                     {
+                         CV_LOG_WARNING(NULL, "Creating new OpenCV cache directory: " << default_cache_path);
+                         CV_LOG_WARNING(NULL, "There are several neighbour directories, probably created by old OpenCV versions.");
+                         CV_LOG_WARNING(NULL, "Feel free to cleanup these unused directories:");
+                         for (size_t i = 0; i < existedCacheDirs.size(); i++)
+                         {
+                             CV_LOG_WARNING(NULL, "  - " << existedCacheDirs[i]);
+                         }
+                         CV_LOG_WARNING(NULL, "Note: This message is showed only once.");
+                     }
+                 }
                  if (sub_directory_name && sub_directory_name[0] != '\0')
                      default_cache_path = utils::fs::join(default_cache_path, cv::String(sub_directory_name) + native_separator);
                  if (!utils::fs::createDirectories(default_cache_path))
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge