public ScanFHogPyramidDetector(IntPtr detector, ImageScanner.FHogPyramidParameter parameter)
     : base(detector)
 {
     this._FeatureExtractorType = parameter.FeatureExtractorType;
     this._PyramidRate          = parameter.PyramidRate;
     this._PyramidType          = parameter.PyramidType;
 }
        internal ObjectDetector(IntPtr ptr, ImageScanner.FHogPyramidParameter parameter)
        {
            if (ptr == IntPtr.Zero)
            {
                throw new ArgumentException("Can not pass IntPtr.Zero", nameof(ptr));
            }
            if (parameter == null)
            {
                throw new ArgumentNullException(nameof(parameter));
            }

            // Dispose on DetectorImp class
            //this.NativePtr = ptr;

            this._Imp = new ScanFHogPyramidDetector(ptr, parameter);
            this._FHogPyramidParameter = parameter;
            this.NativePtr             = this._Imp.NativePtr;
        }
        public ObjectDetector(T scanner)
        {
            if (scanner == null)
            {
                throw new ArgumentNullException(nameof(scanner));
            }

            var fhogParam = scanner.GetFHogPyramidParameter();

            if (fhogParam != null)
            {
                this._Imp = new ScanFHogPyramidDetector(fhogParam);
                this._FHogPyramidParameter = fhogParam;
                this.NativePtr             = this._Imp.NativePtr;
                return;
            }

            throw new NotSupportedException();
        }
            public ScanFHogPyramidDetector(ImageScanner.FHogPyramidParameter parameter)
                : base(IntPtr.Zero)
            {
                this._FeatureExtractorType = parameter.FeatureExtractorType;
                this._PyramidRate          = parameter.PyramidRate;
                this._PyramidType          = parameter.PyramidType;

                var ret = NativeMethods.object_detector_scan_fhog_pyramid_new(this._PyramidType,
                                                                              this._PyramidRate,
                                                                              this._FeatureExtractorType,
                                                                              out var detector);

                switch (ret)
                {
                case NativeMethods.ErrorType.FHogNotSupportExtractor:
                case NativeMethods.ErrorType.PyramidNotSupportRate:
                case NativeMethods.ErrorType.PyramidNotSupportType:
                    throw new NotSupportedException();
                }

                this.NativePtr = detector;
            }