I have a problem with cvInitMatHeader, could you give me an example?
cvInitMatHeader(IntPtr, int32, int32, MAT_DEPTH, IntPtr, int32);
I have a array(3*3) at the 5th parameter, whose type is int, how can I change the int array(3*3) to IntPtr.
And, I can not understand the 6th parameter. If the array is 3*3, what the 6th parameter is?
Best regards!
cvInitMatHeader
Re: cvInitMatHeader
If you have an array "int[,] arr" and you wants to convert it to a matrix, consider the following call:
mat.Ptr will return the header for the matrix. If you are interested on how this is done, you can look into the source code of the matrix constructor.
Matrix<int> mat = new Matrix<int>(arr);
mat.Ptr will return the header for the matrix. If you are interested on how this is done, you can look into the source code of the matrix constructor.

 Posts: 10
 Joined: Thu Oct 23, 2008 1:51 am
Re: cvInitMatHeader
canming wrote:If you have an array "int[,] arr" and you wants to convert it to a matrix, consider the following call:Matrix<int> mat = new Matrix<int>(arr);
mat.Ptr will return the header for the matrix. If you are interested on how this is done, you can look into the source code of the matrix constructor.
Thanks for your help. I had fixed my problem.
Best wish to you!
Who is online
Users browsing this forum: josefbauer, Yahoo [Bot] and 2 guests