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:
@@ -45,9 +45,14 @@
|
||||
#ifndef OPENCV_CORE_EIGEN_HPP
|
||||
#define OPENCV_CORE_EIGEN_HPP
|
||||
|
||||
#ifndef EIGEN_WORLD_VERSION
|
||||
#error "Wrong usage of OpenCV's Eigen utility header. Include Eigen's headers first. See https://github.com/opencv/opencv/issues/17366"
|
||||
#endif
|
||||
|
||||
#include "opencv2/core.hpp"
|
||||
|
||||
#if EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION >= 3
|
||||
#if EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION >= 3 \
|
||||
&& defined(CV_CXX11) && defined(CV_CXX_STD_ARRAY)
|
||||
#include <unsupported/Eigen/CXX11/Tensor>
|
||||
#define OPENCV_EIGEN_TENSOR_SUPPORT
|
||||
#endif // EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION >= 3
|
||||
@@ -157,7 +162,7 @@ Eigen::TensorMap<Eigen::Tensor<float, 3, Eigen::RowMajor>> a_tensormap = cv2eige
|
||||
\endcode
|
||||
*/
|
||||
template <typename _Tp> static inline
|
||||
Eigen::TensorMap<Eigen::Tensor<_Tp, 3, Eigen::RowMajor>> cv2eigen_tensormap(const cv::InputArray &src)
|
||||
Eigen::TensorMap<Eigen::Tensor<_Tp, 3, Eigen::RowMajor>> cv2eigen_tensormap(InputArray src)
|
||||
{
|
||||
Mat mat = src.getMat();
|
||||
CV_CheckTypeEQ(mat.type(), CV_MAKETYPE(traits::Type<_Tp>::value, mat.channels()), "");
|
||||
|
||||
@@ -436,12 +436,20 @@ public:
|
||||
*/
|
||||
CV_WRAP void writeComment(const String& comment, bool append = false);
|
||||
|
||||
void startWriteStruct(const String& name, int flags, const String& typeName);
|
||||
void endWriteStruct();
|
||||
/** @brief Starts to write a nested structure (sequence or a mapping).
|
||||
@param name name of the structure (if it's a member of parent mapping, otherwise it should be empty
|
||||
@param flags type of the structure (FileNode::MAP or FileNode::SEQ (both with optional FileNode::FLOW)).
|
||||
@param typeName usually an empty string
|
||||
*/
|
||||
CV_WRAP void startWriteStruct(const String& name, int flags, const String& typeName=String());
|
||||
|
||||
/** @brief Finishes writing nested structure (should pair startWriteStruct())
|
||||
*/
|
||||
CV_WRAP void endWriteStruct();
|
||||
|
||||
/** @brief Returns the normalized object name for the specified name of a file.
|
||||
@param filename Name of a file
|
||||
@returns The normalized object name.
|
||||
@param filename Name of a file
|
||||
@returns The normalized object name.
|
||||
*/
|
||||
static String getDefaultObjectName(const String& filename);
|
||||
|
||||
|
||||
@@ -62,6 +62,12 @@ static bool ipp_countNonZero( Mat &src, int &res )
|
||||
{
|
||||
CV_INSTRUMENT_REGION_IPP();
|
||||
|
||||
#if defined __APPLE__ || (defined _MSC_VER && defined _M_IX86)
|
||||
// see https://github.com/opencv/opencv/issues/17453
|
||||
if (src.dims <= 2 && src.step > 520000)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
#if IPP_VERSION_X100 < 201801
|
||||
// Poor performance of SSE42
|
||||
if(cv::ipp::getIppTopFeatures() == ippCPUID_SSE42)
|
||||
|
||||
@@ -276,4 +276,23 @@ INSTANTIATE_TEST_CASE_P(Core, CountNonZeroND,
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
typedef testing::TestWithParam<tuple<int, cv::Size> > CountNonZeroBig;
|
||||
|
||||
TEST_P(CountNonZeroBig, /**/)
|
||||
{
|
||||
const int type = get<0>(GetParam());
|
||||
const Size sz = get<1>(GetParam());
|
||||
|
||||
EXPECT_EQ(0, cv::countNonZero(cv::Mat::zeros(sz, type)));
|
||||
EXPECT_EQ(sz.area(), cv::countNonZero(cv::Mat::ones(sz, type)));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Core, CountNonZeroBig,
|
||||
testing::Combine(
|
||||
testing::Values(CV_8UC1, CV_32FC1),
|
||||
testing::Values(Size(1, 524190), Size(524190, 1), Size(3840, 2160))
|
||||
)
|
||||
);
|
||||
|
||||
}} // namespace
|
||||
|
||||
Reference in New Issue
Block a user