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

Merge pull request #9458 from csukuangfj:fix-doc

This commit is contained in:
Alexander Alekhin
2017-09-15 19:35:01 +00:00
5 changed files with 192 additions and 4 deletions
+15
View File
@@ -865,6 +865,13 @@ obtained. For example, the function can be used to compute horizontal and vertic
raster image. In case of REDUCE_MAX and REDUCE_MIN , the output image should have the same type as the source one.
In case of REDUCE_SUM and REDUCE_AVG , the output may have a larger element bit-depth to preserve accuracy.
And multi-channel arrays are also supported in these two reduction modes.
The following code demonstrates its usage for a single channel matrix.
@snippet snippets/core_reduce.cpp example
And the following code demonstrates its usage for a two-channel matrix.
@snippet snippets/core_reduce.cpp example2
@param src input 2D matrix.
@param dst output vector. Its size and type is defined by dim and dtype parameters.
@param dim dimension index along which the matrix is reduced. 0 means that the matrix is reduced to
@@ -884,6 +891,10 @@ elements of i-th input array are treated as mv[i].channels()-element vectors.
The function cv::split does the reverse operation. If you need to shuffle channels in some other
advanced way, use cv::mixChannels.
The following example shows how to merge 3 single channel matrices into a single 3-channel matrix.
@snippet snippets/core_merge.cpp example
@param mv input array of matrices to be merged; all the matrices in mv must have the same
size and the same depth.
@param count number of input matrices when mv is a plain C array; it must be greater than zero.
@@ -907,6 +918,10 @@ The function cv::split splits a multi-channel array into separate single-channel
\f[\texttt{mv} [c](I) = \texttt{src} (I)_c\f]
If you need to extract a single channel or do some other sophisticated channel permutation, use
mixChannels .
The following example demonstrates how to split a 3-channel matrix into 3 single channel matrices.
@snippet snippets/core_split.cpp example
@param src input multi-channel array.
@param mvbegin output array; the number of arrays must match src.channels(); the arrays themselves are
reallocated, if needed.
+4 -4
View File
@@ -392,14 +392,14 @@ public:
FAIL_MEMORY_CORRUPTION_BEGIN=-7,
FAIL_MEMORY_CORRUPTION_END=-8,
// the tested function (or test ifself) do not deallocate some memory
// the tested function (or test itself) do not deallocate some memory
FAIL_MEMORY_LEAK=-9,
// the tested function returned invalid object, e.g. matrix, containing NaNs,
// structure with NULL or out-of-range fields (while it should not)
FAIL_INVALID_OUTPUT=-10,
// the tested function returned valid object, but it does not match to
// the tested function returned valid object, but it does not match
// the original (or produced by the test) object
FAIL_MISMATCH=-11,
@@ -407,7 +407,7 @@ public:
// but it differs too much from the original (or produced by the test) object
FAIL_BAD_ACCURACY=-12,
// the tested function hung. Sometimes, can be determined by unexpectedly long
// the tested function hung. Sometimes, it can be determined by unexpectedly long
// processing time (in this case there should be possibility to interrupt such a function
FAIL_HANG=-13,
@@ -448,7 +448,7 @@ public:
std::vector<std::string> data_search_subdir;
protected:
// these are allocated within a test to try keep them valid in case of stack corruption
// these are allocated within a test to try to keep them valid in case of stack corruption
RNG rng;
// information about the current test