mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
Merge branch '2.4'
This commit is contained in:
@@ -219,7 +219,31 @@ TermCriteria
|
||||
------------
|
||||
.. ocv:class:: TermCriteria
|
||||
|
||||
Template class defining termination criteria for iterative algorithms.
|
||||
The class defining termination criteria for iterative algorithms. You can initialize it by default constructor and then override any parameters, or the structure may be fully initialized using the advanced variant of the constructor.
|
||||
|
||||
TermCriteria::TermCriteria
|
||||
--------------------------
|
||||
The constructors.
|
||||
|
||||
.. ocv:function:: TermCriteria::TermCriteria()
|
||||
|
||||
.. ocv:function:: TermCriteria::TermCriteria(int type, int maxCount, double epsilon)
|
||||
|
||||
.. ocv:function:: TermCriteria::TermCriteria(const CvTermCriteria& criteria)
|
||||
|
||||
:param type: The type of termination criteria: ``TermCriteria::COUNT``, ``TermCriteria::EPS`` or ``TermCriteria::COUNT`` + ``TermCriteria::EPS``.
|
||||
|
||||
:param maxCount: The maximum number of iterations or elements to compute.
|
||||
|
||||
:param epsilon: The desired accuracy or change in parameters at which the iterative algorithm stops.
|
||||
|
||||
:param criteria: Termination criteria in the deprecated ``CvTermCriteria`` format.
|
||||
|
||||
TermCriteria::operator CvTermCriteria
|
||||
-------------------------------------
|
||||
Converts to the deprecated ``CvTermCriteria`` format.
|
||||
|
||||
.. ocv:function:: TermCriteria::operator CvTermCriteria() const
|
||||
|
||||
Matx
|
||||
----
|
||||
|
||||
@@ -245,7 +245,6 @@ Calculates the width and height of a text string.
|
||||
The function ``getTextSize`` calculates and returns the size of a box that contains the specified text.
|
||||
That is, the following code renders some text, the tight box surrounding it, and the baseline: ::
|
||||
|
||||
// Use "y" to show that the baseLine is about
|
||||
string text = "Funny text inside the box";
|
||||
int fontFace = FONT_HERSHEY_SCRIPT_SIMPLEX;
|
||||
double fontScale = 2;
|
||||
|
||||
@@ -2037,10 +2037,10 @@ public:
|
||||
//! default constructor
|
||||
TermCriteria();
|
||||
//! full constructor
|
||||
TermCriteria(int _type, int _maxCount, double _epsilon);
|
||||
TermCriteria(int type, int maxCount, double epsilon);
|
||||
//! conversion from CvTermCriteria
|
||||
TermCriteria(const CvTermCriteria& criteria);
|
||||
//! conversion from CvTermCriteria
|
||||
//! conversion to CvTermCriteria
|
||||
operator CvTermCriteria() const;
|
||||
|
||||
int type; //!< the type of termination criteria: COUNT, EPS or COUNT + EPS
|
||||
|
||||
@@ -6,7 +6,7 @@ using namespace perf;
|
||||
using std::tr1::make_tuple;
|
||||
using std::tr1::get;
|
||||
|
||||
#define TYPICAL_MAT_TYPES_ADWEIGHTED CV_8UC1, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32SC4
|
||||
#define TYPICAL_MAT_TYPES_ADWEIGHTED CV_8UC1, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1
|
||||
#define TYPICAL_MATS_ADWEIGHTED testing::Combine(testing::Values(szVGA, sz720p, sz1080p), testing::Values(TYPICAL_MAT_TYPES_ADWEIGHTED))
|
||||
|
||||
PERF_TEST_P(Size_MatType, addWeighted, TYPICAL_MATS_ADWEIGHTED)
|
||||
|
||||
@@ -6,7 +6,7 @@ using namespace perf;
|
||||
using std::tr1::make_tuple;
|
||||
using std::tr1::get;
|
||||
|
||||
#define TYPICAL_MAT_SIZES_CORE_ARITHM TYPICAL_MAT_SIZES
|
||||
#define TYPICAL_MAT_SIZES_CORE_ARITHM ::szVGA, ::sz720p, ::sz1080p
|
||||
#define TYPICAL_MAT_TYPES_CORE_ARITHM CV_8UC1, CV_8SC1, CV_16SC1, CV_16SC2, CV_16SC3, CV_16SC4, CV_8UC4, CV_32SC1, CV_32FC1
|
||||
#define TYPICAL_MATS_CORE_ARITHM testing::Combine( testing::Values( TYPICAL_MAT_SIZES_CORE_ARITHM ), testing::Values( TYPICAL_MAT_TYPES_CORE_ARITHM ) )
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ PERF_TEST_P(Size_MatType, bitwise_not, TYPICAL_MATS_BITW_ARITHM)
|
||||
cv::Mat c = Mat(sz, type);
|
||||
|
||||
declare.in(a, WARMUP_RNG).out(c);
|
||||
declare.time(100);
|
||||
declare.iterations(200);
|
||||
|
||||
TEST_CYCLE() cv::bitwise_not(a, c);
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ typedef perf::TestBaseWithParam<Size_MatType_CmpType_t> Size_MatType_CmpType;
|
||||
|
||||
PERF_TEST_P( Size_MatType_CmpType, compare,
|
||||
testing::Combine(
|
||||
testing::Values(TYPICAL_MAT_SIZES),
|
||||
testing::Values(::perf::szVGA, ::perf::sz1080p),
|
||||
testing::Values(CV_8UC1, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1),
|
||||
testing::ValuesIn(CmpType::all())
|
||||
)
|
||||
|
||||
@@ -29,6 +29,7 @@ PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo,
|
||||
Mat src(sz, CV_MAKETYPE(depthSrc, channels));
|
||||
randu(src, 0, 255);
|
||||
Mat dst(sz, CV_MAKETYPE(depthDst, channels));
|
||||
declare.iterations(500);
|
||||
|
||||
TEST_CYCLE() src.convertTo(dst, depthDst, alpha);
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ PERF_TEST_P(Size_MatType_NormType, normalize,
|
||||
|
||||
PERF_TEST_P(Size_MatType_NormType, normalize_mask,
|
||||
testing::Combine(
|
||||
testing::Values(TYPICAL_MAT_SIZES),
|
||||
testing::Values(::perf::szVGA, ::perf::sz1080p),
|
||||
testing::Values(TYPICAL_MAT_TYPES),
|
||||
testing::Values((int)NORM_INF, (int)NORM_L1, (int)NORM_L2)
|
||||
)
|
||||
@@ -192,6 +192,7 @@ PERF_TEST_P( Size_MatType, normalize_minmax, TYPICAL_MATS )
|
||||
Mat dst(sz, matType);
|
||||
|
||||
declare.in(src, WARMUP_RNG).out(dst);
|
||||
declare.time(30);
|
||||
|
||||
TEST_CYCLE() normalize(src, dst, 20., 100., NORM_MINMAX);
|
||||
|
||||
|
||||
@@ -1975,6 +1975,14 @@ void cv::transpose( InputArray _src, OutputArray _dst )
|
||||
_dst.create(src.cols, src.rows, src.type());
|
||||
Mat dst = _dst.getMat();
|
||||
|
||||
// handle the case of single-column/single-row matrices, stored in STL vectors.
|
||||
if( src.rows != dst.cols || src.cols != dst.rows )
|
||||
{
|
||||
CV_Assert( src.size() == dst.size() && (src.cols == 1 || src.rows == 1) );
|
||||
src.copyTo(dst);
|
||||
return;
|
||||
}
|
||||
|
||||
if( dst.data == src.data )
|
||||
{
|
||||
TransposeInplaceFunc func = transposeInplaceTab[esz];
|
||||
|
||||
Reference in New Issue
Block a user