コード例 #1
0
        public CirclesFinder(Bitmap b)/* 24-bit bmp file */
        {
            _rawImg   = b;
            _binArray = ImgProcess.ToArray(_rawImg);

            RadiusFilter = 5;
            Execute(_binArray);
        }
コード例 #2
0
        public static string FormatBmp(string path)
        {
            string file     = Utils.String.FilePostfix(path, "-24b").Replace("jpg", "bmp");
            string fileplus = Utils.String.FilePostfix(file, "-bin");

            _logger.Info("Start FormatBmp");

            _logger.Info("Convert to BMP");
            using (Bitmap source = new Bitmap(path))
            {
                using (Bitmap bmp = new Bitmap(source.Width, source.Height, PixelFormat.Format24bppRgb))
                {
                    Graphics.FromImage(bmp).DrawImage(source, new Rectangle(0, 0, bmp.Width, bmp.Height));
                    bmp.Save(file, ImageFormat.Bmp);
                }
            }

            Bitmap i = ImgProcess.Binarize(file);

            i.Save(fileplus);
            _logger.Info("End FormatBmp");

            return(fileplus);
        }