Exemplo n.º 1
0
            internal Row(IntPtr ptr, NativeMethods.MatrixElementType type, Array2DMatrixBase parent)
            {
                if (ptr == IntPtr.Zero)
                {
                    throw new ArgumentException("Can not pass IntPtr.Zero", nameof(ptr));
                }

                this._Parent   = parent ?? throw new ArgumentNullException(nameof(parent));
                this.NativePtr = ptr;
                this._Type     = type;
            }
Exemplo n.º 2
0
        public static Matrix <byte> DrawHog(Array2DMatrixBase hogImage, int cellDrawSize = 15, float minResponseThreshold = 0.0f)
        {
            if (hogImage == null)
            {
                throw new ArgumentNullException(nameof(hogImage));
            }
            if (!(cellDrawSize > 0))
            {
                throw new ArgumentOutOfRangeException(nameof(cellDrawSize));
            }

            hogImage.ThrowIfDisposed(nameof(hogImage));
            var inType = hogImage.MatrixElementType.ToNativeMatrixElementType();
            var ret    = Native.draw_fhog(inType, hogImage.NativePtr, cellDrawSize, minResponseThreshold, out var outMatrix);

            switch (ret)
            {
            case Native.ErrorType.InputElementTypeNotSupport:
                throw new ArgumentException($"Input {inType} is not supported.");
            }

            return(new Matrix <byte>(outMatrix, MatrixElementTypes.UInt8));
        }
Exemplo n.º 3
0
 internal RowLabPixel(IntPtr ptr, NativeMethods.MatrixElementType type, Array2DMatrixBase parent)
     : base(ptr, type, parent)
 {
 }
Exemplo n.º 4
0
 internal RowHsiPixel(IntPtr ptr, Dlib.Native.MatrixElementType type, Array2DMatrixBase parent)
     : base(ptr, type, parent)
 {
 }