How to store complex numbers in OpenCV matrix?

末鹿安然 提交于 2019-12-11 03:25:59

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!