2

I am trying to integrate ArUco V3 in a Unity project.

Therefore I created a .DLL which is imported as function like :

private static extern void functionName(uint, uint, float, float,float,float,IntPr,float)

The function in the header file is :

void functionName(unsigned int, unsigned int, float, float, float, float, float const*, float)

I am calling it with this method :

aruco::Markerdetector 
aruco::Cameraparameters(CalculateCameraMatrix(float, float, float, float), CalculateDistortionCoefficients(float const*), cvSize(uint, uint))

While running the application, opencv.core an opencvimgproc DLLs are constantly loaded and unloaded.

Is this a problem with the parameters conversion or is there a correlation with the calling convents which where used during compiling OpenCV.

rak007
  • 973
  • 12
  • 26

1 Answers1

2

Could solve the problem by adding the calling conventions to each dll import method separately

 [DllImport("Name", EntryPoint = "EntrypointName", CallingConvention =CallingConvention.Cdecl)]
Ajith
  • 1,447
  • 2
  • 17
  • 31