opencvsharp
opencvsharp copied to clipboard
System.TypeInitializationException: The type initializer for 'OpenCvSharp.Internal.NativeMethods'
Summary of your issue
---> System.DllNotFoundException: Unable to load shared library 'OpenCvSharpExtern' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libOpenCvSharpExtern: cannot open shared object file: No such file or directory at OpenCvSharp.Internal.NativeMethods.redirectError(CvErrorCallback errCallback, IntPtr userdata, IntPtr& prevUserdata) at OpenCvSharp.Internal.ExceptionHandler.RegisterExceptionCallback() at OpenCvSharp.Internal.NativeMethods.LoadLibraries(IEnumerable`1 additionalPaths) at OpenCvSharp.Internal.NativeMethods..cctor()
Environment
Ubuntu 18.04.6 LTS i also encounterd the same issue on Mac OS ,, but there is no issue in Windows system
Example code:
string imagePath = Environment.GetEnvironmentVariable("HOME") +"/Pictures/Screenshot.png";
Mat image = Cv2.ImRead(imagePath, ImreadModes.Unchanged);
DetectSensitiveAreas(image);
the error hits on second line
Having the same issue on an up2date M1 Air. Really annoying since I am trying to port some apps to Avalonia to be multiplatform, and now its an OpenCV issue being a show-stopper...