SciSharp / NumSharp

High Performance Computation for N-D Tensors in .NET, similar API to NumPy.
https://github.com/SciSharp
Apache License 2.0
1.38k stars 192 forks source link

NDArray.ToBitmap() has critical issue with 24bpp VERTICAL images #440

Open MiroslavKabat opened 3 years ago

MiroslavKabat commented 3 years ago
        var arr = np.ones(1, 2, 1, 3).astype(NPTypeCode.Byte);
        var bmp = arr.ToBitmap();

        for (int c = 0; c < bmp.Width; c++)
        {
            for (int r = 0; r < bmp.Height; r++)
            {
                var p = bmp.GetPixel(c, r);
                Console.WriteLine($"r:{r} c:{c} => ({p.R};{p.G};{p.B})");
            }
        }

        // return
        // r: 0 c: 0 => (1; 1; 1)
        // r: 1 c: 0 => (0; 1; 1) !!!

        // instead of
        // r: 0 c: 0 => (1; 1; 1)
        // r: 1 c: 0 => (1; 1; 1)