///<summary> Create a CascadeClassifier from the specific file</summary> ///<param name="fileName"> The name of the file that contains the CascadeClassifier</param> public CascadeClassifier(String fileName) { FileInfo file = new FileInfo(fileName); if (!file.Exists) { throw new FileNotFoundException(Properties.StringTable.FileNotFound, file.FullName); } _ptr = CvInvoke.CvCascadeClassifierCreate(fileName); if (_ptr == IntPtr.Zero) { throw new NullReferenceException(String.Format(Properties.StringTable.FailToCreateHaarCascade, file.FullName)); } }
///<summary> Create a CascadeClassifier from the specific file</summary> ///<param name="fileName"> The name of the file that contains the CascadeClassifier</param> public CascadeClassifier(String fileName) { #if !NETFX_CORE FileInfo file = new FileInfo(fileName); if (!file.Exists) { throw new FileNotFoundException("FileNotFound", file.FullName); } #endif _ptr = CvInvoke.CvCascadeClassifierCreate(fileName); if (_ptr == IntPtr.Zero) { #if NETFX_CORE throw new NullReferenceException(String.Format("Fail to create HaarCascade object: {0}", fileName)); #else throw new NullReferenceException(String.Format("FailToCreateHaarCascade {0}", file.FullName)); #endif } }