CNTK.CntkBitmapExtensions.ExtractCHW C# (CSharp) Метод

ExtractCHW() публичный статический Метод

Extracts image pixels in CHW
public static ExtractCHW ( this image ) : List
image this The bitmap image to extract features from
Результат List
        public static List<float> ExtractCHW(this Bitmap image)
        {
            var features = new List<float>(image.Width * image.Height * 3);
            for (int c = 0; c < 3; c++)
            {
                for (int h = 0; h < image.Height; h++)
                {
                    for (int w = 0; w < image.Width; w++)
                    {
                        var pixel = image.GetPixel(w, h);
                        float v = c == 0 ? pixel.B : c == 1 ? pixel.G : pixel.R;
                        features.Add(v);
                    }
                }
            }

            return features;
        }