コード例 #1
0
        private List <float> processImageFile(ImageMapInfo mapInfo)
        {
            Bitmap bmp = new Bitmap(mapInfo.Filepath);

            Emgu.CV.Image <Bgr, byte> img = new Emgu.CV.Image <Bgr, byte>(bmp);
            if (mapInfo.Resize > 0)
            {
                img = img.Resize(mapInfo.Resize, mapInfo.Resize, Emgu.CV.CvEnum.Inter.Nearest);
            }

            if (mapInfo.Flip != Emgu.CV.CvEnum.FlipType.None)
            {
                img = img.Flip(mapInfo.Flip);
            }

            if (mapInfo.RotationAngle > 0)
            {
                img.Rotate(mapInfo.RotationAngle, new Bgr(Color.White));
            }

            return(img.Bitmap.ParallelExtractCHW());
        }