I am use Emgu.CV in windows by .Net Core success run. but when run project on linux ubuntu 21.04 with the following code
public static void DetectedMultiFace(string path)
{
var file = new FileStream(path, FileMode.Open);
var bitmap = new Bitmap(file);
Image<Bgr, byte> grayImage = new Image<Bgr, byte>(path);
Rectangle[] rectangles = cascadeClassifier.DetectMultiScale(grayImage, 1.4, 0);
foreach (var item in rectangles)
{
using (Graphics graphics = Graphics.FromImage(bitmap))
{
using (Pen pen = new Pen(Color.Red, 1))
{
graphics.DrawRectangle(pen, item);
}
}
}
}
When it comes to this part "Image<Bgr, byte> grayImage = new Image<Bgr, byte>(path);" show this error
Exception has occurred: CLR/System.TypeInitializationException An exception of type 'System.TypeInitializationException' occurred in Emgu.CV.Platform.NetStandard.dll but was not handled in user code: 'The type initializer for 'Emgu.CV.CvInvoke' threw an exception.' Inner exceptions found, see $exception in variables window for more details. Innermost exception System.DllNotFoundException : Unable to load shared library 'cvextern' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libcvextern: cannot open shared object file: No such file or directory at Emgu.CV.CvInvoke.RedirectError(CvErrorCallback errorHandler, IntPtr userdata, IntPtr prevUserdata) at Emgu.CV.CvInvoke..cctor()