cvInitMatHeader

Ask question on using Emgu CV with C#

cvInitMatHeader

Postby wujinjie746 » Sat Nov 29, 2008 6:49 am

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! :)
wujinjie746
 
Posts: 10
Joined: Thu Oct 23, 2008 1:51 am

Re: cvInitMatHeader

Postby canming » Sat Nov 29, 2008 1:21 pm

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.
canming
Site Admin
 
Posts: 873
Joined: Thu Feb 28, 2008 4:16 pm

Re: cvInitMatHeader

Postby wujinjie746 » Tue Dec 02, 2008 3:47 am

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! :lol:
wujinjie746
 
Posts: 10
Joined: Thu Oct 23, 2008 1:51 am


Return to C# Help

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest