In OpenCv in order to load the intrisinc parameters from an xml file i use:
CvMat *intrinsic = (CvMat*)cvLoad("Intrinsics.xml");
how it would be in EmguCV?
loading intrisinc parameters
Re: loading intrisinc parameters
To load an OpenCV format XML matrix file, you can do
I am writing it in C# syntax, it should be easy to translation it to Manage C++.
Code: Select all
IntPtr mat = CvInvoke.cvLoad("Intrinsics.xml", IntPtr.Zero, null, IntPtr.Zero);
Matrix<double> intrinsicMatrix = new Matrix<double>(3, 3);
CvInvoke.cvCopy(mat, intrinsicMatrix, IntPtr.Zero);
CvInvoke.cvRelease(ref mat);
Re: loading intrisinc parameters
I rewrote it to c++/cli but have some problems.
In this line i get error: cannot convert parameter 3 from 'int' to 'System::String ^'
So i convert it to
next problem in line:
in this line i get error: error C2664: 'Emgu::CV::Matrix<TDepth>::Matrix(cli::array<Type> ^)' : cannot convert parameter 1 from 'Emgu::CV::Matrix<TDepth> ^' to 'cli::array<Type> ^'
so it obvious that the code can't be compiled
And in the line
CvInvoke.cvRelease(ref mat); in c++/cli i don't have cvRelease method
Please help me to deal with this.
Code: Select all
IntPtr mat = CvInvoke::cvLoad("Intrinsics.xml", IntPtr::Zero, NULL, IntPtr::Zero);
So i convert it to
Code: Select all
IntPtr mat = CvInvoke::cvLoad("Intrinsics.xml", IntPtr::Zero, NULL.ToString(), IntPtr::Zero);
Code: Select all
Matrix<double> intrinsincMatrix = gcnew Matrix<double>(3, 3);
so it obvious that the code
Code: Select all
CvInvoke::cvCopy(mat, intrinsicMatrix, IntPtr.Zero);
And in the line
CvInvoke.cvRelease(ref mat); in c++/cli i don't have cvRelease method
Please help me to deal with this.
Re: loading intrisinc parameters
CvMat *mat = (CvMat*)cvLoad("Intrinsics.xml");
Matrix<double>^ intrinsicMatrix = gcnew Matrix<double>(3, 3);
cvCopy(mat, intrinsicMatrix.Ptr.ToPointer());
cvReleaseMat(& mat);[/code]
Matrix<double>^ intrinsicMatrix = gcnew Matrix<double>(3, 3);
cvCopy(mat, intrinsicMatrix.Ptr.ToPointer());
cvReleaseMat(& mat);[/code]