Esempio n. 1
0
        public UnmanagedImage Apply(UnmanagedImage image)
        {
            UnmanagedImage unmanagedImage = dilatation.Apply(image);

            errosion.ApplyInPlace(unmanagedImage);
            return(unmanagedImage);
        }
Esempio n. 2
0
        /// <summary>
        /// Apply filter to an image in unmanaged memory.
        /// </summary>
        ///
        /// <param name="image">Source image in unmanaged memory to apply filter to.</param>
        ///
        /// <returns>Returns filter's result obtained by applying the filter to
        /// the source image.</returns>
        ///
        /// <remarks>The method keeps the source image unchanged and returns
        /// the result of image processing filter as new image.</remarks>
        ///
        /// <exception cref="UnsupportedImageFormatException">Unsupported pixel format of the source image.</exception>
        ///
        public UnmanagedImage Apply(UnmanagedImage image)
        {
            var destImage = dilatation.Apply(image);

            errosion.ApplyInPlace(destImage);

            return(destImage);
        }
Esempio n. 3
0
        // 선 굵게, 24비트로 넣어줘야함
        public static Bitmap thick(Bitmap source)
        {
            ///////////// ini 객체 생성 시작 /////////////////////////////////////////////////////
            //현재 프로그램이 실행되고 있는정보 가져오기: 디버깅 모드라면 bin/debug/프로그램명.exe
            FileInfo exefileinfo = new FileInfo(@"C:\Program Files\PLOCR\PLOCR.exe");
            string pathini = exefileinfo.Directory.FullName.ToString();  //프로그램 실행되고 있는데 path 가져오기
            string fileName = @"\PLOCRconfig.ini";  // 환경설정 파일명
            string filePath = pathini + fileName;   //ini 파일 경로
            PLOCR.IniUtil ini = new PLOCR.IniUtil(filePath);   // 만들어 놓았던 iniUtil 객체 생성(생성자 인자로 파일경로 정보 넘겨줌)
            //////////// ini 객체 생성 끝 /////////////////////////////////////////////////////////

            int order = int.Parse(ini.GetIniValue("선굵기값", "굵게횟수"));

            for (int i = 0; i < order; i++)
            {
                Bitmap tmp = (Bitmap)source;        // 중요! 한번 이미지 처리가 끝난 비트맵 source 는 clone 함수로 보내기 전에 다시 한번 (Bitmap) 처리 해줘야함, 이유는 잘 모르겠음
                // convert to 24 bits per pixel
                source = ImageProcess.Clone(tmp, PixelFormat.Format24bppRgb);
                // delete old image
                tmp.Dispose();

                Erosion filter = new Erosion();
                filter.ApplyInPlace(source); ;
            }

            return source;
        }
Esempio n. 4
0
 /// <summary>
 /// Apply filter to an image.
 /// </summary>
 ///
 /// <param name="image">Image to apply filter to.</param>
 ///
 /// <remarks>The method applies the filter directly to the provided source image.</remarks>
 ///
 /// <exception cref="UnsupportedImageFormatException">Unsupported pixel format of the source image.</exception>
 ///
 public void ApplyInPlace(Bitmap image)
 {
     errosion.ApplyInPlace(image);
     dilatation.ApplyInPlace(image);
 }
Esempio n. 5
0
        // 선 굵게
        private void button34_Click(object sender, EventArgs e)
        {
            ///////////// ini 객체 생성 시작 /////////////////////////////////////////////////////
            //현재 프로그램이 실행되고 있는정보 가져오기: 디버깅 모드라면 bin/debug/프로그램명.exe
            FileInfo exefileinfo = new FileInfo(@"C:\Program Files\PLOCR\PLOCR.exe");
            string pathini = exefileinfo.Directory.FullName.ToString();  //프로그램 실행되고 있는데 path 가져오기
            string fileName = @"\PLOCRconfig.ini";  // 환경설정 파일명
            string filePath = pathini + fileName;   //ini 파일 경로
            DocumentAnalysis.IniUtil ini = new DocumentAnalysis.IniUtil(filePath);   // 만들어 놓았던 iniUtil 객체 생성(생성자 인자로 파일경로 정보 넘겨줌)
            //////////// ini 객체 생성 끝 /////////////////////////////////////////////////////////

            Bitmap source = Global.source;
            Bitmap tmp = source;
            // convert to 24 bits per pixel
            source = imageProcess.Clone(tmp, PixelFormat.Format24bppRgb);
            // delete old image
            tmp.Dispose();

            Erosion filter = new Erosion();
            filter.ApplyInPlace(source);

            Global.source = source;
            pictureBox1.Image = Global.source;
            pictureBox1.Refresh();

            textBox24.Text = (int.Parse(textBox24.Text) + 1).ToString();
            ini.SetIniValue("선굵기값", "굵게횟수", textBox24.Text.ToString());

            //string path = calculator.CreateFileCheck("C:\\Program Files\\PLOCR\\prescription.png");
            //pictureBox1.Image.Save(path);
        }