public FaceDetectionContextDlibDnnMmod() : base("DlibDnnMmod", new OpenCvSharp.Scalar(0, 0, 255)) { if (IntPtr.Size == 4) { System.Windows.MessageBox.Show("To use dlib DNN, x64 CUDA and cuDNN 5.1 are necessary"); IsEnabled = false; return; } DlibDnnMmod = new DlibSharp.DnnMmodFaceDetection("D:/Data/Dlib/mmod_human_face_detector.dat"); Image = new DlibSharp.MatrixRgbPixel(); }
protected virtual void Dispose(bool disposing) { if (disposed) { return; } if (disposing) { // dispose managed objects, and dispose objects that implement IDisposable if (DlibDnnMmod != null) { DlibDnnMmod.Dispose(); DlibDnnMmod = null; } if (Image != null) { Image.Dispose(); Image = null; } } // release any unmanaged objects and set the object references to null disposed = true; }