OpenCV学习笔记(4)——mixChannels函数
来源:互联网 发布:新闻联播视频制作软件 编辑:程序博客网 时间:2024/05/23 17:39
函数原型:
void mixChannels(const Mat* src,int nsrc,Mat* dst ,int ndst,const int* fromTo,size_t npairs);函数功能:
mixChannels主要就是把输入的矩阵(或矩阵数组)的某些通道拆分复制给对应的输出矩阵(或矩阵数组)的某些通道中,其中的对应关系就由fromTo参数指定.
参数说明:
src– Input array or vector of matrices. All the matrices must have the same size and the same depth.
输入矩阵,可以为一个也可以为多个,但是矩阵必须有相同的大小和深度.
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 outputchannel 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 areindexed 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, whenfromTo[k*2] is negative, the corresponding output channel is filled with zero .
设置输入矩阵的通道对应输出矩阵的通道,规则如下:首先用数字标记输入矩阵的各个通道。输入矩阵个数可能多于一个并且每个矩阵的通道可能不一样,第一个输入矩阵的通道标记范围为:0 ~ src[0].channels()-1,第二个输入矩阵的通道标记范围为:src[0].channels() ~ src[0].channels()+src[1].channels()-1,以此类推;其次输出矩阵也用同样的规则标记,第一个输出矩阵的通道标记范围为:0 ~ dst[0].channels()-1,第二个输入矩阵的通道标记范围为:dst[0].channels()~ dst[0].channels()+dst[1].channels()-1,以此类推;最后,数组fromTo的第一个元素即fromTo[0]应该填入输入矩阵的某个通道标记,而fromTo的第二个元素即fromTo[1]应该填入输出矩阵的某个通道标记,这样函数就会把输入矩阵的fromTo[0]通道里面的数据复制给输出矩阵的fromTo[1]通道。fromTo后面的元素也是这个道理,总之就是一个输入矩阵的通道标记后面必须跟着个输出矩阵的通道标记。
npairs– Number of index pairs in fromTo.
即参数fromTo中的有几组输入输出通道关系,其实就是参数fromTo的数组元素个数除以2.
来源:http://www.cnblogs.com/ruic/archive/2015/10/31/4926254.html
- OpenCV学习笔记(4)——mixChannels函数
- opencv函数之mixChannels
- OpenCV之mixChannels()函数使用说明
- OpenCV中对mixChannels函数的理解
- [OpenCV基础] OpenCV中对mixChannels函数的理解
- opencv 之 mixChannels
- opencv 之 mixChannels
- Opencv.mixChannels用法
- opencv 之 mixChannels
- opencv之mixChannels/inRange
- Opencv学习笔记——cvSmooth函数
- openCV学习笔记(4)--cvSmooth函数
- OpenCV学习笔记(2)—— CV_Assert 函数
- OpenCV学习笔记(5)——normalize函数
- mixChannels()函数测试
- opencv中mixChannels的使用方法
- OpenCV 函数学习笔记
- OpenCV学习笔记(三十七)——实用函数、系统函数、宏core
- yii2框架关于log的配置
- 一天一道leetcode3
- 数组编程:array_reduce array_map array_walk
- 新的一天开始了
- getLocationOnScreen; View.getLocationInWindow(int[] location)
- OpenCV学习笔记(4)——mixChannels函数
- CC2530 zigbee 全信道扫描
- Css3变换和过渡
- Mockito使用指南
- Intellij IDEA基本配置
- hdu 6085 bitset优化
- sqlserver中like模糊查询如何区分大小写
- js中 ||的意思,js中 o = o || {};是什么意思呢?
- webpack-vue全家桶之实现border-1px