如何在OpenCV矩阵中存储复数? [英] How to store complex numbers in OpenCV matrix?
问题描述
我有两个矩阵A和B,其中A& B包含一些实数.现在,我想要一个复数矩阵C,例如:C [0] = A [0] + i B [0].
I have two matrices A and B, where A & B contains some real numbers. Now I want a complex numbered matrix C, such that: C[0] = A[0] + i B[0].
我的问题是如何创建这样的复杂矩阵C,以及如何将A,B矩阵值传递到矩阵C中.
My question is how create such complex matrix C, and how to pass A, B matrices values into matrix C.
我知道,我可以如下创建矩阵C:
I came to know that, I can create matrix C as follows:
CvMat * C_Matrix = cvCreateMat(5,5,CV_64FC2);
CvMat* C_Matrix = cvCreateMat(5, 5, CV_64FC2);
但是现在如何传递A&的值? B到矩阵C_Matrix?
But now how to pass values of A & B to matrix C_Matrix?
推荐答案
I think you can use merge()
function here, See the Documentation
它说:Composes a multi-channel array from several single-channel arrays.
这篇关于如何在OpenCV矩阵中存储复数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!