1

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()

K M
  • 11
  • 2
  • Does this answer your question? [Running Emgu.CV on linux](https://stackoverflow.com/questions/63791891/running-emgu-cv-on-linux) – omajid Aug 05 '21 at 23:09
  • thank you for answer but errors are different and file libcvextern.so is exist – K M Aug 06 '21 at 21:09

0 Answers0