Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Opencv 我需要帮助来理解cv::MixChannel_Opencv_Opencv3.0 - Fatal编程技术网

Opencv 我需要帮助来理解cv::MixChannel

Opencv 我需要帮助来理解cv::MixChannel,opencv,opencv3.0,Opencv,Opencv3.0,我已经对所见的文档进行了一些更正。但我认为需要对参数描述进行一些修正 例如,对于const int*fromTo和const std::vector&fromTo的fromTo的描述是相同的 CV_EXPORTS void mixChannels(const Mat* src, size_t nsrcs, Mat* dst, size_t ndsts, const int* fromTo, size_t npairs); CV_EXPORTS vo

我已经对所见的文档进行了一些更正。但我认为需要对参数描述进行一些修正

例如,对于
const int*fromTo
const std::vector&fromTo
fromTo
的描述是相同的

CV_EXPORTS void mixChannels(const Mat* src, size_t nsrcs, Mat* dst, size_t ndsts,
                        const int* fromTo, size_t npairs);
CV_EXPORTS void mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst,
                        const int* fromTo, size_t npairs);
CV_EXPORTS_W void mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst,
                               const std::vector<int>& fromTo);

Parameters
    src ...
    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 . 
CV_导出无效混音通道(常数Mat*src、大小nsrcs、Mat*dst、大小ndsts、,
const int*fromTo,size\u t npairs);
CV_导出无效混合通道(InputArrayOfArrays src、InputOutputArrayOfArrays dst、,
const int*fromTo,size\u t npairs);
CV_导出W void mixChannels(InputArrayOfArrays src、InputOutputArrayOfArrays dst、,
常量std::vector和fromTo);
参数
src。。。
dst。。。。
fromTo索引对数组,指定复制的通道和位置;fromTo[k*2]
是src中输入通道的基于0的索引,fromTo[k*2+1]是输出通道的索引
dst中的信道;使用连续通道编号:第一个输入图像通道
从0索引到src[0]。通道()-1,第二个输入图像通道被索引
从src[0]。channels()到src[0]。channels()+src[1]。channels()-1,依此类推
方案用于输出图像通道;作为特例,当fromTo[k*2]为
负,相应的输出通道填充为零。
在这件事上我需要一些帮助

任何帮助都将不胜感激。

您为什么将“矩阵数组”或“矩阵向量”更改为“矩阵数组”

关于
fromTo
参数,我将尝试解构该段落

array of index pairs specifying which channels are copied and where;
它将以[in,Out,in,Out,in,Out,…]的形式出现。数组中的每个值都是一个整数,表示其中一个图像中的通道。后面将解释这些整数与实际通道之间的映射

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; 
这只是重复了
fromTo
数组的值在输入和输出之间交替,并且是引用通道的数字

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, 
这解释了编号方案。这个概念非常简单,可能被形式主义所掩盖
src[0]
是第一个输入图像,
src[1]
是第二个输入图像

如果我们有两个分别有三个通道的输入图像,我们只需要将通道命名为:0、1、2、3、4、5。如您所见,第一个映像的通道编号为0、1、2(
0到src[0]。通道()-1
),第二个映像的通道编号为3、4、5(
src[0]。通道()
(即:3)
到src[0]。通道()+src[1]。通道()-1
(即:3+3-1=5))

这是一种奇特的说法,我们只需依次接收每个输入,并在移动到下一幅图像时继续增加通道数

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 .

在输入/输出通道对中,如果存在类似于
-1,3
,则由索引3表示的输出通道将被零填充。

事实上,我似乎非常清楚。在我看来,最终可以通过两种方式改进:

  • 更健谈
  • 更加数学化
  • 我还将留下矩阵的输入数组或向量

    如果
    fromTo
    是一个
    const std::vector
    (索引对),它可能会有用,但我想这会破坏太多的代码


    健谈

    比如:

    fromTo:指定复制哪些通道和位置的索引数组。偶数索引表示src中的from通道,而奇数索引表示dst中的to通道。当偶数索引为负数时,对应的通道用零填充。在多个图像的情况下,第二图像的索引跟随第一图像的索引,依此类推

    数学

    比如:

    fromTo:数组形式为
    \[从^{0}{0},到^{0}{0},…从^{0}{src[0]。通道()-1},到^{0}{src[0]。通道()-1},…,从^{i}{uj},到^{i}{uj},其中:

    • 从是源图像
    • 到是目标映像
    • i是源映像和目标映像在src和dst中的索引
    • j是通道,从0到src[i]。通道()-1
    当from索引为负数时,以下to通道用零填充



    只是一些随意的想法…:D

    我稍后会看一看这个。。但你确定这类问题是关于这个主题的吗?嗨,Miki,谢谢你的回答。我不知道这里是不是合适的平台,但我只是问了一下。我相信
    fromTo
    的描述是正确的。它可能会以某种方式被澄清,但除了一个图表,它将很难用语言来解释。您对描述的特定部分有什么问题吗?谢谢您的详细解释。我编辑了我的问题以便更清楚。