private void SProcess() { SS_PB.Value = 0; int length = TrB_Length.Value; SS_PB.Value = 10; int lambda = TrB_Lambda.Value; SS_PB.Value = 15; BGRImg ReSImg = SImg.InsideSimpleMotionDeblur(K, lambda); SS_PB.Value = 70; ReSImg.BFFTShift(); SS_PB.Value = 80; ReSImg.IFFT2(); SS_PB.Value = 90; ReSImg = ReSImg.UnExtend(OrQImg.Width, OrQImg.Height); if (PB_Result.Image != null) { PB_Result.Image.Dispose(); PB_Result.Image = null; } if (RImg != null) { RImg.Dispose(); RImg = null; } RImg = ReSImg.ToImage(); PB_Result.Image = RImg; SS_LBStatus.Text = "完整圖片"; SS_PB.Value = 100; SS_PB.Visible = false; XProcessing = false; GC.Collect(); }
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); } }