public Action <Image <Gray, byte>, Image <Bgr, byte> > ProcessingStep1_Simple( SampleType sampletype, int cHnum, int cWnum, int estWSize, int estHSize) { return(new Action <Image <Gray, byte>, Image <Bgr, byte> >((baseimg, colorimg) => { try { Stopwatch stw = new Stopwatch(); stw.Start(); var color_visual_img = colorimg.Clone(); var color_visual_img2 = colorimg.Clone(); PResult = new ImgPResult( PData.UPAreaLimit, PData.DWAreaLimit, PData.IntenSumUPLimit, PData.IntenSumDWLimit ); byte[,,] indexingImage = MatPattern(cHnum, cWnum, 3); byte[,,] passfailPosData = new byte[cHnum, cWnum, 1]; double[,,] estedChipP = EstedChipPos(cHnum, cWnum); var boxlist = estedChipP.GetRectList(estHSize, estWSize, color_visual_img.Height, color_visual_img.Width); var centerMoment = estedChipP.GetMomnetList(); // 모멘트 및 박스 리스트 구함. estedChipP.Act_LoopChipPos( boxlist , centerMoment , CheckOkNg_Inten( indexingImage , color_visual_img , ref PResult)); var clusterCenters = (ClusterData( (from item in PResult.OutData select new double[] { item.Intensity }) .ToArray <double[]>())["center"] as double[][]) .Select(x => x[0]) .OrderBy(x => x) .ToArray(); // Background Intensity var updw = PResult.OutData .Select(x => x.Intensity) .ToArray <double>() .Map(intesns => FindIntensityUpDw(intesns)); PResult.OutData.Act(CheckLowOver( estedChipP , indexingImage , color_visual_img , clusterCenters , LineThickness)); DrawCenterPoint(color_visual_img, estedChipP); UpdateResult(PResult)(indexingImage, color_visual_img); evtProcessingResult(); stw.Stop(); Console.WriteLine("Process Time : " + stw.ElapsedMilliseconds); } catch (Exception er) { System.Windows.MessageBox.Show(er.ToString()); evtProcessingDone(true); } })); }