Ejemplo n.º 1
0
 public ScanFHogPyramidDetector(IntPtr detector, ImageScanner.FHogPyramidParameter parameter)
     : base(detector)
 {
     this._FeatureExtractorType = parameter.FeatureExtractorType;
     this._PyramidRate          = parameter.PyramidRate;
     this._PyramidType          = parameter.PyramidType;
 }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
            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;
            }