opencvsharp icon indicating copy to clipboard operation
opencvsharp copied to clipboard

Access to OpenCVSharpExtern in 3.0?

Open Tharyn opened this issue 11 years ago • 2 comments

OpenCVSharpExtern.dll is a Native plugin in 3.0.

I compiled everything from the Git repo, in VS 2013 with no issues. I'm moving my existing C++ code from openCV to C#.

My library of interest is photo HDR. I have no problem importing OpenCvSharp and its subs in .net but don't know how to use the extern dll. How can I access its features?

Thanks, Tharyn

.

Tharyn avatar Oct 23 '15 06:10 Tharyn

You can use OpenCvSharpExtern functions through the NativeMethods class. It is public so you can access it everywhere.

IntPtr matPtr = NativeMethods.imgcodecs_imread("foo.jpg", 1);
NativeMethods.imgcodecs_imwrite("bar.png", matPtr, IntPtr.Zero, 0);
NativeMethods.core_Mat_delete(matPtr);

shimat avatar Oct 23 '15 07:10 shimat

Thank you for the quick reply that is just what I was looking for.

Tharyn avatar Oct 23 '15 18:10 Tharyn