1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge remote-tracking branch 'upstream/3.4' into merge-3.4

This commit is contained in:
Alexander Alekhin
2018-12-18 19:07:43 +00:00
20 changed files with 397 additions and 73 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ namespace cv
//! @{
template<typename _Tp, int _rows, int _cols, int _options, int _maxRows, int _maxCols> static inline
void eigen2cv( const Eigen::Matrix<_Tp, _rows, _cols, _options, _maxRows, _maxCols>& src, Mat& dst )
void eigen2cv( const Eigen::Matrix<_Tp, _rows, _cols, _options, _maxRows, _maxCols>& src, OutputArray dst )
{
if( !(src.Flags & Eigen::RowMajorBit) )
{
@@ -718,7 +718,7 @@ OPENCV_HAL_IMPL_VSX_REDUCE_OP_4(v_float32x4, vec_float4, float, min, vec_min)
inline double v_reduce_sum(const v_float64x2& a)
{
return vec_extract(vec_add(a.val, vec_sld(a.val, a.val, 8)), 0);
return vec_extract(vec_add(a.val, vec_permi(a.val, a.val, 3)), 0);
}
#define OPENCV_HAL_IMPL_VSX_REDUCE_OP_8(_Tpvec, _Tpvec2, scalartype, suffix, func) \
+8
View File
@@ -1257,6 +1257,14 @@ struct Device::Impl
else
vendorID_ = UNKNOWN_VENDOR;
const size_t CV_OPENCL_DEVICE_MAX_WORK_GROUP_SIZE = utils::getConfigurationParameterSizeT("OPENCV_OPENCL_DEVICE_MAX_WORK_GROUP_SIZE", 0);
if (CV_OPENCL_DEVICE_MAX_WORK_GROUP_SIZE > 0)
{
const size_t new_maxWorkGroupSize = std::min(maxWorkGroupSize_, CV_OPENCL_DEVICE_MAX_WORK_GROUP_SIZE);
if (new_maxWorkGroupSize != maxWorkGroupSize_)
CV_LOG_WARNING(NULL, "OpenCL: using workgroup size: " << new_maxWorkGroupSize << " (was " << maxWorkGroupSize_ << ")");
maxWorkGroupSize_ = new_maxWorkGroupSize;
}
#if 0
if (isExtensionSupported("cl_khr_spir"))
{
+24
View File
@@ -3,6 +3,12 @@
// of this distribution and at http://opencv.org/license.html.
#include "test_precomp.hpp"
#ifdef HAVE_EIGEN
#include <Eigen/Core>
#include <Eigen/Dense>
#include "opencv2/core/eigen.hpp"
#endif
namespace opencv_test { namespace {
class Core_ReduceTest : public cvtest::BaseTest
@@ -1962,4 +1968,22 @@ TEST(Core_Vectors, issue_13078_workaround)
ASSERT_EQ(7, ints[3]);
}
#ifdef HAVE_EIGEN
TEST(Core_Eigen, eigen2cv_check_Mat_type)
{
Mat A(4, 4, CV_32FC1, Scalar::all(0));
Eigen::MatrixXf eigen_A;
cv2eigen(A, eigen_A);
Mat_<float> f_mat;
EXPECT_NO_THROW(eigen2cv(eigen_A, f_mat));
EXPECT_EQ(CV_32FC1, f_mat.type());
Mat_<double> d_mat;
EXPECT_ANY_THROW(eigen2cv(eigen_A, d_mat));
//EXPECT_EQ(CV_64FC1, d_mat.type());
}
#endif // HAVE_EIGEN
}} // namespace