Can someone explain me why am i getting this exception?
private CascadeClassifier CAS = new CascadeClassifier(Application.StartupPath + @"\haarcascade_frontalface_alt_tree.xml");
Image<Bgr, Byte> BGR_FACE_IMG = new Image<Bgr, Byte>((Bitmap)pictureBox1.BackgroundImage);
Image<Gray, Byte> GRAY_FACE_IMG = new Image<Gray, Byte>(BGR_FACE_IMG.ToBitmap());
Rectangle[] CAS_FACES = CAS.DetectMultiScale(GRAY_FACE_IMG, 1.1, 10, Size.Empty);
CAS_FACES are null and i don't know why.
Exception:
Emgu.CV.Util.CvException HResult=0x80131500 Message=OpenCV: !empty() Source=Emgu.CV.World Ślad stosu: w Emgu.CV.CvInvoke.CvErrorHandler(Int32 status, IntPtr funcName, IntPtr errMsg, IntPtr fileName, Int32 line, IntPtr userData) w Emgu.CV.CvInvoke.cveCascadeClassifierDetectMultiScale(IntPtr classifier, IntPtr image, IntPtr objects, Double scaleFactor, Int32 minNeighbors, Int32 flags, Size& minSize, Size& maxSize) w Emgu.CV.CascadeClassifier.DetectMultiScale(IInputArray image, Double scaleFactor, Int32 minNeighbors, Size minSize, Size maxSize) w FaceRec.Form1.button2_Click(Object sender, EventArgs e) w C:\Users\Miłosz\source\repos\FaceRec\FaceRec\Form1.cs:wiersz 48 w System.Windows.Forms.Control.OnClick(EventArgs e) w System.Windows.Forms.Button.OnClick(EventArgs e) w System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) w System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) w System.Windows.Forms.Control.WndProc(Message& m) w System.Windows.Forms.ButtonBase.WndProc(Message& m) w System.Windows.Forms.Button.WndProc(Message& m) w System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) w System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) w System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) w System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
w System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) w System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) w System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) w System.Windows.Forms.Application.Run(Form mainForm) w FaceRec.Program.Main() w C:\Users\Miłosz\source\repos\FaceRec\FaceRec\Program.cs:wiersz 19
User contributions licensed under CC BY-SA 3.0