问题
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].
My question is how create such complex matrix C, and how to pass A, B matrices values into matrix C.
I came to know that, I can create matrix C as follows:
CvMat* C_Matrix = cvCreateMat(5, 5, CV_64FC2);
But now how to pass values of A & B to matrix C_Matrix?
回答1:
I think you can use merge()
function here, See the Documentation
It says : Composes a multi-channel array from several single-channel arrays.
来源:https://stackoverflow.com/questions/11495316/how-to-store-complex-numbers-in-opencv-matrix