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

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

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

                        features.Add(v);
                    }
                }
            }

            return features;
        }