renamed "None()" to "noArray()" to avoid conflicts with X11 (ticket #1122)

This commit is contained in:
Vadim Pisarevsky
2011-06-08 06:55:04 +00:00
parent aad9b3219c
commit 2d2b8a496e
21 changed files with 108 additions and 108 deletions

View File

@@ -10,7 +10,7 @@ Clustering
kmeans
------
.. cpp:function:: double kmeans( InputArray samples, int clusterCount, InputOutputArray labels, TermCriteria termcrit, int attempts, int flags, OutputArray centers=None() )
.. cpp:function:: double kmeans( InputArray samples, int clusterCount, InputOutputArray labels, TermCriteria termcrit, int attempts, int flags, OutputArray centers=noArray() )
Finds centers of clusters and groups input samples around the clusters.

View File

@@ -199,7 +199,7 @@ The subset of supported types for each function has been defined from practical
InputArray and OutputArray
--------------------------
Many OpenCV functions process dense 2-dimensional or multi-dimensional numerical arrays. Usually, such functions take cpp:class:`Mat` as parameters, but in some cases it's more convenient to use ``std::vector<>`` (for a point set, for example) or ``Matx<>`` (for 3x3 homography matrix and such). To avoid many duplicates in the API, special "proxy" classes have been introduced. The base "proxy" class is ``InputArray``. It is used for passing read-only arrays on a function input. The derived from ``InputArray`` class ``OutputArray`` is used to specify an output array for a function. Normally, you should not care of those intermediate types (and you should not declare variables of those types explicitly) - it will all just work automatically. You can assume that instead of ``InputArray``/``OutputArray`` you can always use ``Mat``, ``std::vector<>``, ``Matx<>``, ``Vec<>`` or ``Scalar``. When a function has an optional input or output array, and you do not have or do not want one, pass ``cv::None()``.
Many OpenCV functions process dense 2-dimensional or multi-dimensional numerical arrays. Usually, such functions take cpp:class:`Mat` as parameters, but in some cases it's more convenient to use ``std::vector<>`` (for a point set, for example) or ``Matx<>`` (for 3x3 homography matrix and such). To avoid many duplicates in the API, special "proxy" classes have been introduced. The base "proxy" class is ``InputArray``. It is used for passing read-only arrays on a function input. The derived from ``InputArray`` class ``OutputArray`` is used to specify an output array for a function. Normally, you should not care of those intermediate types (and you should not declare variables of those types explicitly) - it will all just work automatically. You can assume that instead of ``InputArray``/``OutputArray`` you can always use ``Mat``, ``std::vector<>``, ``Matx<>``, ``Vec<>`` or ``Scalar``. When a function has an optional input or output array, and you do not have or do not want one, pass ``cv::noArray()``.
Error Handling
--------------

View File

@@ -67,7 +67,7 @@ See Also: :cpp:func:`abs`
add
-------
.. cpp:function:: void add(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=None(), int dtype=-1)
.. cpp:function:: void add(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray(), int dtype=-1)
Computes the per-element sum of two arrays or an array and a scalar.
@@ -166,7 +166,7 @@ See Also:
bitwise_and
-----------
.. cpp:function:: void bitwise_and(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=None())
.. cpp:function:: void bitwise_and(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray())
Calculates the per-element bit-wise conjunction of two arrays or an array and a scalar.
@@ -208,7 +208,7 @@ In case of floating-point arrays, their machine-specific bit representations (us
bitwise_not
-----------
.. cpp:function:: void bitwise_not(InputArray src, OutputArray dst, InputArray mask=None())
.. cpp:function:: void bitwise_not(InputArray src, OutputArray dst, InputArray mask=noArray())
Inverts every bit of an array.
@@ -230,7 +230,7 @@ In case of a floating-point source array, its machine-specific bit representatio
bitwise_or
----------
.. cpp:function:: void bitwise_or(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=None())
.. cpp:function:: void bitwise_or(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray())
Calculates the per-element bit-wise disjunction of two arrays or an array and a scalar.
@@ -273,7 +273,7 @@ The function computes the per-element bit-wise logical disjunction:
bitwise_xor
-----------
.. cpp:function:: void bitwise_xor(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=None())
.. cpp:function:: void bitwise_xor(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray())
Calculates the per-element bit-wise "exclusive or" operation on two arrays or an array and a scalar.
@@ -1513,7 +1513,7 @@ See Also:
mean
----
.. cpp:function:: Scalar mean(InputArray mtx, InputArray mask=None())
.. cpp:function:: Scalar mean(InputArray mtx, InputArray mask=noArray())
Calculates an average (mean) of array elements.
@@ -1540,7 +1540,7 @@ See Also:
meanStdDev
----------
.. cpp:function:: void meanStdDev(InputArray mtx, OutputArray mean, OutputArray stddev, InputArray mask=None())
.. cpp:function:: void meanStdDev(InputArray mtx, OutputArray mean, OutputArray stddev, InputArray mask=noArray())
Calculates mean and standard deviation of array elements.
@@ -1656,7 +1656,7 @@ See Also:
minMaxLoc
---------
.. cpp:function:: void minMaxLoc(InputArray src, double* minVal, double* maxVal=0, Point* minLoc=0, Point* maxLoc=0, InputArray mask=None())
.. cpp:function:: void minMaxLoc(InputArray src, double* minVal, double* maxVal=0, Point* minLoc=0, Point* maxLoc=0, InputArray mask=noArray())
.. cpp:function:: void minMaxLoc(const SparseMat& src, double* minVal, double* maxVal, int* minIdx=0, int* maxIdx=0)
@@ -1824,7 +1824,7 @@ See Also:
mulTransposed
-------------
.. cpp:function:: void mulTransposed(InputArray src, OutputArray dst, bool aTa, InputArray delta=None(), double scale=1, int rtype=-1)
.. cpp:function:: void mulTransposed(InputArray src, OutputArray dst, bool aTa, InputArray delta=noArray(), double scale=1, int rtype=-1)
Calculates the product of a matrix and its transposition.
@@ -1834,7 +1834,7 @@ mulTransposed
:param aTa: Flag specifying the multiplication ordering. See the description below.
:param delta: Optional delta matrix subtracted from ``src`` before the multiplication. When the matrix is empty ( ``delta=None()`` ), it is assumed to be zero, that is, nothing is subtracted. If it has the same size as ``src`` , it is simply subtracted. Otherwise, it is "repeated" (see :cpp:func:`repeat` ) to cover the full ``src`` and then subtracted. Type of the delta matrix, when it is not empty, must be the same as the type of created destination matrix. See the ``rtype`` description.
:param delta: Optional delta matrix subtracted from ``src`` before the multiplication. When the matrix is empty ( ``delta=noArray()`` ), it is assumed to be zero, that is, nothing is subtracted. If it has the same size as ``src`` , it is simply subtracted. Otherwise, it is "repeated" (see :cpp:func:`repeat` ) to cover the full ``src`` and then subtracted. Type of the delta matrix, when it is not empty, must be the same as the type of created destination matrix. See the ``rtype`` description.
:param scale: Optional scale factor for the matrix product.
@@ -1867,9 +1867,9 @@ See Also:
norm
----
.. cpp:function:: double norm(InputArray src1, int normType=NORM_L2, InputArray mask=None())
.. cpp:function:: double norm(InputArray src1, int normType=NORM_L2, InputArray mask=noArray())
.. cpp:function:: double norm(InputArray src1, InputArray src2, int normType, InputArray mask=None())
.. cpp:function:: double norm(InputArray src1, InputArray src2, int normType, InputArray mask=noArray())
.. cpp:function:: double norm( const SparseMat& src, int normType )
@@ -1918,7 +1918,7 @@ A multi-channel source arrays are treated as a single-channel, that is, the resu
normalize
---------
.. cpp:function:: void normalize(const InputArray src, OutputArray dst, double alpha=1, double beta=0, int normType=NORM_L2, int rtype=-1, InputArray mask=None())
.. cpp:function:: void normalize(const InputArray src, OutputArray dst, double alpha=1, double beta=0, int normType=NORM_L2, int rtype=-1, InputArray mask=noArray())
.. cpp:function:: void normalize(const SparseMat& src, SparseMat& dst, double alpha, int normType)
@@ -2938,7 +2938,7 @@ See Also:
subtract
--------
.. cpp:function:: void subtract(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=None(), int dtype=-1)
.. cpp:function:: void subtract(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray(), int dtype=-1)
Calculates the per-element difference between two arrays or array and a scalar.

View File

@@ -1338,7 +1338,7 @@ typedef const _OutputArray& OutputArray;
typedef OutputArray OutputArrayOfArrays;
typedef OutputArray InputOutputArray;
CV_EXPORTS OutputArray None();
CV_EXPORTS OutputArray noArray();
/////////////////////////////////////// Mat ///////////////////////////////////////////
@@ -1659,7 +1659,7 @@ public:
//! sets every matrix element to s
Mat& operator = (const Scalar& s);
//! sets some of the matrix elements to s, according to the mask
Mat& setTo(const Scalar& s, InputArray mask=None());
Mat& setTo(const Scalar& s, InputArray mask=noArray());
//! creates alternative matrix header for the same data, with different
// number of channels and/or different number of rows. see cvReshape.
Mat reshape(int _cn, int _rows=0) const;
@@ -1975,10 +1975,10 @@ CV_EXPORTS void insertImageCOI(InputArray coiimg, CvArr* arr, int coi=-1);
//! adds one matrix to another (dst = src1 + src2)
CV_EXPORTS_W void add(InputArray src1, InputArray src2, OutputArray dst,
InputArray mask=None(), int dtype=-1);
InputArray mask=noArray(), int dtype=-1);
//! subtracts one matrix from another (dst = src1 - src2)
CV_EXPORTS_W void subtract(InputArray src1, InputArray src2, OutputArray dst,
InputArray mask=None(), int dtype=-1);
InputArray mask=noArray(), int dtype=-1);
//! computes element-wise weighted product of the two arrays (dst = scale*src1*src2)
CV_EXPORTS_W void multiply(InputArray src1, InputArray src2,
@@ -2011,25 +2011,25 @@ CV_EXPORTS_W Scalar sum(InputArray src);
//! computes the number of nonzero array elements
CV_EXPORTS_W int countNonZero( InputArray src );
//! computes mean value of selected array elements
CV_EXPORTS_W Scalar mean(InputArray src, InputArray mask=None());
CV_EXPORTS_W Scalar mean(InputArray src, InputArray mask=noArray());
//! computes mean value and standard deviation of all or selected array elements
CV_EXPORTS_W void meanStdDev(InputArray src, OutputArray mean, OutputArray stddev,
InputArray mask=None());
InputArray mask=noArray());
//! computes norm of the selected array part
CV_EXPORTS_W double norm(InputArray src1, int normType=NORM_L2, InputArray mask=None());
CV_EXPORTS_W double norm(InputArray src1, int normType=NORM_L2, InputArray mask=noArray());
//! computes norm of selected part of the difference between two arrays
CV_EXPORTS_W double norm(InputArray src1, InputArray src2,
int normType=NORM_L2, InputArray mask=None());
int normType=NORM_L2, InputArray mask=noArray());
//! scales and shifts array elements so that either the specified norm (alpha) or the minimum (alpha) and maximum (beta) array values get the specified values
CV_EXPORTS_W void normalize( InputArray src, OutputArray dst, double alpha=1, double beta=0,
int norm_type=NORM_L2, int dtype=-1, InputArray mask=None());
int norm_type=NORM_L2, int dtype=-1, InputArray mask=noArray());
//! finds global minimum and maximum array elements and returns their values and their locations
CV_EXPORTS_W void minMaxLoc(InputArray src, CV_OUT double* minVal,
CV_OUT double* maxVal=0, CV_OUT Point* minLoc=0,
CV_OUT Point* maxLoc=0, InputArray mask=None());
CV_OUT Point* maxLoc=0, InputArray mask=noArray());
CV_EXPORTS void minMaxIdx(InputArray src, double* minVal, double* maxVal,
int* minIdx=0, int* maxIdx=0, InputArray mask=None());
int* minIdx=0, int* maxIdx=0, InputArray mask=noArray());
//! transforms 2D matrix to 1D row or column vector by taking sum, minimum, maximum or mean value over all the rows
CV_EXPORTS_W void reduce(InputArray src, OutputArray dst, int dim, int rtype, int dtype=-1);
@@ -2067,16 +2067,16 @@ CV_EXPORTS_W void vconcat(InputArray src, OutputArray dst);
//! computes bitwise conjunction of the two arrays (dst = src1 & src2)
CV_EXPORTS_W void bitwise_and(InputArray src1, InputArray src2,
OutputArray dst, InputArray mask=None());
OutputArray dst, InputArray mask=noArray());
//! computes bitwise disjunction of the two arrays (dst = src1 | src2)
CV_EXPORTS_W void bitwise_or(InputArray src1, InputArray src2,
OutputArray dst, InputArray mask=None());
OutputArray dst, InputArray mask=noArray());
//! computes bitwise exclusive-or of the two arrays (dst = src1 ^ src2)
CV_EXPORTS_W void bitwise_xor(InputArray src1, InputArray src2,
OutputArray dst, InputArray mask=None());
OutputArray dst, InputArray mask=noArray());
//! inverts each bit of array (dst = ~src)
CV_EXPORTS_W void bitwise_not(InputArray src, OutputArray dst,
InputArray mask=None());
InputArray mask=noArray());
//! computes element-wise absolute difference of two arrays (dst = abs(src1 - src2))
CV_EXPORTS_W void absdiff(InputArray src1, InputArray src2, OutputArray dst);
//! set mask elements for those array elements which are within the element-specific bounding box (dst = lowerb <= src && src < upperb)
@@ -2130,7 +2130,7 @@ CV_EXPORTS_W void gemm(InputArray src1, InputArray src2, double alpha,
InputArray src3, double gamma, OutputArray dst, int flags=0);
//! multiplies matrix by its transposition from the left or from the right
CV_EXPORTS_W void mulTransposed( InputArray src, OutputArray dst, bool aTa,
InputArray delta=None(),
InputArray delta=noArray(),
double scale=1, int dtype=-1 );
//! transposes the matrix
CV_EXPORTS_W void transpose(InputArray src, OutputArray dst);
@@ -2331,7 +2331,7 @@ enum
//! clusters the input data using k-Means algorithm
CV_EXPORTS_W double kmeans( InputArray data, int K, CV_OUT InputOutputArray bestLabels,
TermCriteria criteria, int attempts,
int flags, OutputArray centers=None() );
int flags, OutputArray centers=noArray() );
//! returns the thread-local Random number generator
CV_EXPORTS RNG& theRNG();
@@ -3662,18 +3662,18 @@ public:
//! finds the K nearest neighbors of "vec" while looking at Emax (at most) leaves
CV_WRAP int findNearest(InputArray vec, int K, int Emax,
OutputArray neighborsIdx,
OutputArray neighbors=None(),
OutputArray dist=None(),
OutputArray labels=None()) const;
OutputArray neighbors=noArray(),
OutputArray dist=noArray(),
OutputArray labels=noArray()) const;
//! finds all the points from the initial set that belong to the specified box
CV_WRAP void findOrthoRange(InputArray minBounds,
InputArray maxBounds,
OutputArray neighborsIdx,
OutputArray neighbors=None(),
OutputArray labels=None()) const;
OutputArray neighbors=noArray(),
OutputArray labels=noArray()) const;
//! returns vectors with the specified indices
CV_WRAP void getPoints(InputArray idx, OutputArray pts,
OutputArray labels=None()) const;
OutputArray labels=noArray()) const;
//! return a vector with the specified index
const float* getPoint(int ptidx, int* label=0) const;
//! returns the search space dimensionality

View File

@@ -1156,36 +1156,36 @@ void cv::bitwise_not(InputArray a, OutputArray c, InputArray mask)
void cv::max( InputArray src1, InputArray src2, OutputArray dst )
{
binary_op(src1, src2, dst, None(), maxTab, false );
binary_op(src1, src2, dst, noArray(), maxTab, false );
}
void cv::min( InputArray src1, InputArray src2, OutputArray dst )
{
binary_op(src1, src2, dst, None(), minTab, false );
binary_op(src1, src2, dst, noArray(), minTab, false );
}
void cv::max(const Mat& src1, const Mat& src2, Mat& dst)
{
OutputArray _dst(dst);
binary_op(src1, src2, _dst, None(), maxTab, false );
binary_op(src1, src2, _dst, noArray(), maxTab, false );
}
void cv::min(const Mat& src1, const Mat& src2, Mat& dst)
{
OutputArray _dst(dst);
binary_op(src1, src2, _dst, None(), minTab, false );
binary_op(src1, src2, _dst, noArray(), minTab, false );
}
void cv::max(const Mat& src1, double src2, Mat& dst)
{
OutputArray _dst(dst);
binary_op(src1, src2, _dst, None(), maxTab, false );
binary_op(src1, src2, _dst, noArray(), maxTab, false );
}
void cv::min(const Mat& src1, double src2, Mat& dst)
{
OutputArray _dst(dst);
binary_op(src1, src2, _dst, None(), minTab, false );
binary_op(src1, src2, _dst, noArray(), minTab, false );
}
/****************************************************************************************\
@@ -1466,7 +1466,7 @@ void cv::subtract( InputArray src1, InputArray src2, OutputArray dst,
void cv::absdiff( InputArray src1, InputArray src2, OutputArray dst )
{
arithm_op(src1, src2, dst, None(), -1, absdiffTab);
arithm_op(src1, src2, dst, noArray(), -1, absdiffTab);
}
/****************************************************************************************\
@@ -1779,19 +1779,19 @@ static BinaryFunc recipTab[] =
void cv::multiply(InputArray src1, InputArray src2,
OutputArray dst, double scale, int dtype)
{
arithm_op(src1, src2, dst, None(), dtype, mulTab, true, &scale);
arithm_op(src1, src2, dst, noArray(), dtype, mulTab, true, &scale);
}
void cv::divide(InputArray src1, InputArray src2,
OutputArray dst, double scale, int dtype)
{
arithm_op(src1, src2, dst, None(), dtype, divTab, true, &scale);
arithm_op(src1, src2, dst, noArray(), dtype, divTab, true, &scale);
}
void cv::divide(double scale, InputArray src2,
OutputArray dst, int dtype)
{
arithm_op(src2, src2, dst, None(), dtype, recipTab, true, &scale);
arithm_op(src2, src2, dst, noArray(), dtype, recipTab, true, &scale);
}
/****************************************************************************************\
@@ -1944,7 +1944,7 @@ void cv::addWeighted( InputArray src1, double alpha, InputArray src2,
double beta, double gamma, OutputArray dst, int dtype )
{
double scalars[] = {alpha, beta, gamma};
arithm_op(src1, src2, dst, None(), dtype, addWeightedTab, true, scalars);
arithm_op(src1, src2, dst, noArray(), dtype, addWeightedTab, true, scalars);
}

View File

@@ -3639,7 +3639,7 @@ computeSums( const Mat& points, const size_t* ofs, int a, int b, double* sums )
void KDTree::build(InputArray _points, bool _copyData)
{
build(_points, None(), _copyData);
build(_points, noArray(), _copyData);
}

View File

@@ -1435,7 +1435,7 @@ static bool eigen( InputArray _src, OutputArray _evals, OutputArray _evects, boo
bool cv::eigen( InputArray src, OutputArray evals, int lowindex, int highindex )
{
return eigen(src, evals, None(), false, lowindex, highindex);
return eigen(src, evals, noArray(), false, lowindex, highindex);
}
bool cv::eigen( InputArray src, OutputArray evals, OutputArray evects,
@@ -1522,7 +1522,7 @@ void SVD::compute( InputArray a, OutputArray w, OutputArray u, OutputArray vt, i
void SVD::compute( InputArray a, OutputArray w, int flags )
{
_SVDcompute(a, w, None(), None(), flags);
_SVDcompute(a, w, noArray(), noArray(), flags);
}
void SVD::backSubst( InputArray _w, InputArray _u, InputArray _vt,

View File

@@ -1399,7 +1399,7 @@ Mat& _OutputArray::getMatRef(int i) const
}
static _OutputArray _none;
OutputArray None() { return _none; }
OutputArray noArray() { return _none; }
}