mixChannelside
Copies specified channels from input arrays to the specified channels of output arrays.函數
從輸入中拷貝某通道到輸出中特定的通道。spa
C++: void mixChannels(const Mat*src, size_t nsrcs, Mat* dst, size_t ndsts, const int* fromTo, size_t npairs)ci
C++: void mixChannels(const vector<Mat>&src, vector<Mat>&dst, const int*fromTo, size_t npairs)input
C: void cvMixChannels(const CvArr**src, int src_count, CvArr** dst, int dst_count, const int* from_to, int pair_count)原型
函數原型。it
Parametersio
src– Input array or vector of matrices. All the matrices must have the same size and thefunction
same depth.dva
輸入矩陣的向量(能夠理解成一隊矩陣),全部矩陣必須有相同的大小和深度。
nsrcs– Number of matrices in src.
輸入矩陣的個數。
dst– Output array or vector of matrices. All the matrices must be allocated. Their size and
depth must be the same as in src[0].
輸出矩陣的向量。全部的矩陣必須事先分配空間(如用create),大小和深度須與輸入矩陣等同。
ndsts– Number of matrices in dst.
輸出矩陣的個數。
fromTo – Array of index pairs specifying which channels are copied and where.
序號對向量,用來決定哪一個通道被拷貝。
fromTo[k*2] is a 0-based index of the input channel in src.
fromTo[k*2+1] is an index of the output channel in dst. The continuous channel numbering is used: the first input image channels are indexed from 0 to src[0].channels()-1 , the second
input image channels are indexed from src[0].channels() to src[0].channels() + src[1].channels()-1, and so on. The same scheme is used for the output image channels. As a special case, when fromTo[k*2] is negative, the corresponding output channel is filled with zero .
上面的大致含義是:偶數下標的用來標識輸入矩陣,奇數下標的用來標識輸出矩陣。若是偶數下標爲負數,那麼相應的輸出矩陣爲零矩陣。
npairs– Number of index pairs in fromTo.
fromTo中的序號對數(兩個算1對)。
The functions mixChannels provide an advanced mechanism for shuffling image channels.
這個函數對圖像通道提供了高級的操做。
若有不當,歡迎指正!