public void Run(int[] src, int[] imagdarksub, out int[] SamplingValue, CaptureParam caps) { var DSP = DSPFactory.Create(param.DemosaicSelect); DSP.param = param; DSP.Width = Width; DSP.Height = Height; DSP.Canvas_Width = Canvas_Width; DSP.Canvas_Height = Canvas_Height; /*SaveProcess*/ //saves.save_pre(src); if (caps.enableresult) { caps.GetResult(); src = Array.ConvertAll(caps.ave, n => (int)n); caps.ave.SaveRawFloat(caps.savepath, $"ave.bin"); caps.dev.SaveRawFloat(caps.savepath, $"dev.bin"); } //DSP.Unfolding(src); DSP.UnfoldingCorrection(src); if (caps.enable1) { src.SaveRaw(caps.savepath, $"{caps.filename}.bin"); } if (caps.enableadd1) { caps.Add(src); } DSP.DarkSub(src, imagdarksub); DSP.HOB(src); if (caps.enable2) { src.SaveRaw(caps.savepath, $"{caps.filename}_HOB.bin"); } DSP.Sort(src); SamplingValue = DSP.Sampling(src); DSP.Offset(src); TrimCanvas(src, param.Canvas_X, param.Canvas_Y); DSP.Demosaic( Canvas_Width, Canvas_Height, img16uc1, img16uc3, img8uc3, GetInputMat((float)param.RGain, (float)param.GGain, (float)param.BGain, param.Matrix), param.bayerpattern ); if (lut != null) { LookUp(); } Convert8UC3(); Blur(); Application.Current.Dispatcher.Invoke(new Action(() => { ConvertBitmap(); }), DispatcherPriority.Background, new object[] { }); if (caps.enableBMP) { img.SaveBMP(caps.savepath, $"{caps.filename}.bmp"); } //後処理 //return (img, new int[] { 1 }); }