示例#1
0
        private void MS_File_Open_Click(object sender, System.EventArgs e)
        {
            OFD.FileName     = "";
            SS_LBStatus.Text = "圖片開啟中";
            if (OFD.ShowDialog() == DialogResult.OK)
            {
                StopProcess();

                this.Cursor = Cursors.WaitCursor;

                string filepath = OFD.FileName;

                OImg   = new Bitmap(filepath);
                RImg   = new Bitmap(filepath);
                OrQImg = GrayImg.From(filepath);
                OrSImg = BGRImg.From(filepath);

                PB_Result.Image  = OrQImg.ToImage();
                PB_Result.Height = FLP_Result.Height;
                PB_Result.Width  = OrQImg.Width * FLP_Result.Height / OrQImg.Height;

                QImg = OrQImg.Extend();
                SImg = OrSImg.Extend();

                K = new SimpleMotionKernel(QImg.Width, QImg.Height, 53);

                QImg.FFT2();
                SImg.FFT2();

                QThread = new Thread(QProcess);
                QThread.Start();

                this.Cursor = Cursors.Default;
            }
        }
示例#2
0
 static void Main(string[] args)
 {
     try {
         if (args.Length >= 3)
         {
             string RPath  = args[0];
             string WPath  = args[1];
             string WExt   = args[2];
             BGRImg Source = BGRImg.From(RPath);
             BGRImg Result = Source.Extend();
             Result.BFFTShift();
             Result.FFT2();
             Result.ToImage(true).Save(WPath, ImgF.ChooseImgFormat(WExt));
             Environment.Exit(0);
         }
         else
         {
             Environment.Exit(1);
         }
     } catch (Exception ex) {
         Console.WriteLine(ex.ToString());
         Environment.Exit(2);
     }
 }