Пример #1
0
        public byte[] GetEigenvalue(Bitmap bitmap, PoolingType poolingType, Color threshold, int precisionX = 16, int precisionY = 16)
        {
            InputDataType = DataType.Image;
            var pool      = new Pooling(InputDataType);
            var poolColor = pool.Execute(bitmap, precisionX, precisionY, poolingType);

            _compressionPoint = new Point(poolColor.GetLength(0), poolColor.GetLength(1));
            _poolColor        = poolColor;

            if (threshold == Color.Black)
            {
                threshold = pool.GetMedianColor();
            }
            var binary     = new Binarization();
            var eigenvalue = binary.Execute(poolColor, threshold);

            SimilarArray = binary.GetSimilarArray();

            return(eigenvalue);
        }
Пример #2
0
        public byte[] GetEigenvalue(float[,] data, PoolingType poolingType, int precisionX = 16, int precisionY = 16, float threshold = 9999)
        {
            InputDataType = DataType.Data;
            var pool     = new Pooling(InputDataType);
            var poolData = pool.Execute(data, precisionX, precisionY, poolingType);

            _compressionPoint = new Point(poolData.GetLength(0), poolData.GetLength(1));
            _poolData         = poolData;

            if (threshold == 9999)
            {
                threshold = pool.GetMedianValue();
            }
            var binary     = new Binarization();
            var eigenvalue = binary.Execute(poolData, threshold);

            SimilarArray = binary.GetSimilarArray();

            return(eigenvalue);
        }