예제 #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;
            }
예제 #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));
        }
예제 #3
0
 internal RowLabPixel(IntPtr ptr, NativeMethods.MatrixElementType type, Array2DMatrixBase parent)
     : base(ptr, type, parent)
 {
 }
예제 #4
0
 internal RowHsiPixel(IntPtr ptr, Dlib.Native.MatrixElementType type, Array2DMatrixBase parent)
     : base(ptr, type, parent)
 {
 }