Merge remote-tracking branch 'upstream/3.4' into merge-3.4
authorAlexander Alekhin <alexander.a.alekhin@gmail.com>
Fri, 12 Feb 2021 21:20:54 +0000 (21:20 +0000)
committerAlexander Alekhin <alexander.a.alekhin@gmail.com>
Fri, 12 Feb 2021 21:34:49 +0000 (21:34 +0000)
12 files changed:
1  2 
modules/core/src/parallel_impl.cpp
modules/imgcodecs/CMakeLists.txt
modules/imgcodecs/src/grfmt_base.cpp
modules/imgcodecs/src/grfmt_jpeg.cpp
modules/imgcodecs/src/loadsave.cpp
modules/stitching/perf/opencl/perf_stitch.cpp
modules/stitching/perf/perf_estimators.cpp
modules/stitching/perf/perf_matchers.cpp
modules/stitching/perf/perf_precomp.hpp
modules/stitching/perf/perf_stich.cpp
platforms/js/build_js.py
samples/python/tutorial_code/ImgTrans/distance_transformation/imageSegmentation.py

Simple merge
Simple merge
Simple merge
Simple merge
@@@ -515,10 -501,17 +482,16 @@@ imread_( const String& filename, int fl
  
      if( decoder->setScale( scale_denom ) > 1 ) // if decoder is JpegDecoder then decoder->setScale always returns 1
      {
 -        resize( *mat, *mat, Size( size.width / scale_denom, size.height / scale_denom ), 0, 0, INTER_LINEAR_EXACT);
 +        resize( mat, mat, Size( size.width / scale_denom, size.height / scale_denom ), 0, 0, INTER_LINEAR_EXACT);
      }
  
 -    if( mat && !mat->empty() && (flags & IMREAD_IGNORE_ORIENTATION) == 0 && flags != IMREAD_UNCHANGED )
+     /// optionally rotate the data if EXIF orientation flag says so
 -        ApplyExifOrientation(decoder->getExifTag(ORIENTATION), *mat);
++    if (!mat.empty() && (flags & IMREAD_IGNORE_ORIENTATION) == 0 && flags != IMREAD_UNCHANGED )
+     {
 -    return hdrtype == LOAD_CVMAT ? (void*)matrix :
 -        hdrtype == LOAD_IMAGE ? (void*)image : (void*)mat;
++        ApplyExifOrientation(decoder->getExifTag(ORIENTATION), mat);
+     }
 +    return true;
  }
  
  
@@@ -643,14 -636,8 +616,8 @@@ Mat imread( const String& filename, in
      Mat img;
  
      /// load the data
 -    imread_( filename, flags, LOAD_MAT, &img );
 +    imread_( filename, flags, img );
  
-     /// optionally rotate the data if EXIF' orientation flag says so
-     if( !img.empty() && (flags & IMREAD_IGNORE_ORIENTATION) == 0 && flags != IMREAD_UNCHANGED )
-     {
-         ApplyExifOrientation(filename, img);
-     }
      /// return a reference to the data
      return img;
  }
@@@ -886,10 -896,19 +853,16 @@@ imdecode_( const Mat& buf, int flags, M
  
      if( decoder->setScale( scale_denom ) > 1 ) // if decoder is JpegDecoder then decoder->setScale always returns 1
      {
 -        resize( *mat, *mat, Size( size.width / scale_denom, size.height / scale_denom ), 0, 0, INTER_LINEAR_EXACT);
 +        resize(mat, mat, Size( size.width / scale_denom, size.height / scale_denom ), 0, 0, INTER_LINEAR_EXACT);
      }
  
 -    if (!mat->empty() && (flags & IMREAD_IGNORE_ORIENTATION) == 0 && flags != IMREAD_UNCHANGED)
+     /// optionally rotate the data if EXIF' orientation flag says so
 -        ApplyExifOrientation(decoder->getExifTag(ORIENTATION), *mat);
++    if (!mat.empty() && (flags & IMREAD_IGNORE_ORIENTATION) == 0 && flags != IMREAD_UNCHANGED)
+     {
 -    decoder.release();
 -
 -    return hdrtype == LOAD_CVMAT ? (void*)matrix :
 -        hdrtype == LOAD_IMAGE ? (void*)image : (void*)mat;
++        ApplyExifOrientation(decoder->getExifTag(ORIENTATION), mat);
+     }
 +    return true;
  }
  
  
@@@ -898,14 -917,8 +871,8 @@@ Mat imdecode( InputArray _buf, int flag
      CV_TRACE_FUNCTION();
  
      Mat buf = _buf.getMat(), img;
 -    imdecode_( buf, flags, LOAD_MAT, &img );
 +    imdecode_( buf, flags, img );
  
-     /// optionally rotate the data if EXIF' orientation flag says so
-     if( !img.empty() && (flags & IMREAD_IGNORE_ORIENTATION) == 0 && flags != IMREAD_UNCHANGED )
-     {
-         ApplyExifOrientation(buf, img);
-     }
      return img;
  }
  
@@@ -915,14 -928,8 +882,8 @@@ Mat imdecode( InputArray _buf, int flag
  
      Mat buf = _buf.getMat(), img;
      dst = dst ? dst : &img;
 -    imdecode_( buf, flags, LOAD_MAT, dst );
 +    imdecode_( buf, flags, *dst );
  
-     /// optionally rotate the data if EXIF' orientation flag says so
-     if( !dst->empty() && (flags & IMREAD_IGNORE_ORIENTATION) == 0 && flags != IMREAD_UNCHANGED )
-     {
-         ApplyExifOrientation(buf, *dst);
-     }
      return *dst;
  }
  
  namespace cv
  {
  
 -static inline Ptr<detail::FeaturesFinder> getFeatureFinder(const std::string& name)
 +static inline Ptr<Feature2D> getFeatureFinder(const std::string& name)
  {
      if (name == "orb")
 -        return makePtr<detail::OrbFeaturesFinder>();
 +        return ORB::create();
- #ifdef HAVE_OPENCV_XFEATURES2D
+ #if defined(HAVE_OPENCV_XFEATURES2D) && defined(OPENCV_ENABLE_NONFREE)
      else if (name == "surf")
 -        return makePtr<detail::SurfFeaturesFinder>();
 +        return xfeatures2d::SURF::create();
  #endif
      else if (name == "akaze")
 -        return makePtr<detail::AKAZEFeaturesFinder>();
 +        return AKAZE::create();
      else
 -        return Ptr<detail::FeaturesFinder>();
 +        return Ptr<Feature2D>();
  }
  
  } // namespace cv
@@@ -15,9 -15,8 +15,9 @@@ using namespace perf
  typedef TestBaseWithParam<string> stitch;
  typedef TestBaseWithParam<int> stitchExposureCompensation;
  typedef TestBaseWithParam<tuple<string, string> > stitchDatasets;
 +typedef TestBaseWithParam<tuple<string, int>> stitchExposureCompMultiFeed;
  
- #ifdef HAVE_OPENCV_XFEATURES2D
+ #if defined(HAVE_OPENCV_XFEATURES2D) && defined(OPENCV_ENABLE_NONFREE)
  #define TEST_DETECTORS testing::Values("surf", "orb", "akaze")
  #else
  #define TEST_DETECTORS testing::Values("orb", "akaze")
Simple merge