Ejemplo n.º 1
0
 public static void ScratchesReductionInPaintTeleaMethod()
 {
     if (ImageBefor != null)
     {
         using (DefectsFinder defectsFinder = new DefectsFinder(ImageBefor))
         {
             defectsFinder.SearchDefects();
             using (Scratches scratches = new Scratches(ImageBefor, defectsFinder.LargeDefectsContoursMatrix, _exclFromCleaning))
             {
                 ImageAfter = scratches.InpaintTeleaMethod();
             }
         }
     }
 }
Ejemplo n.º 2
0
 public static void ScratchesReductionSpiralSingleDefectsMethod()
 {
     if (ImageBefor != null)
     {
         ProgressManager.AddSteps(2);
         using (DefectsFinder defectsFinder = new DefectsFinder(ImageBefor))
         {
             defectsFinder.SearchDefects();
             using (Scratches scratches = new Scratches(ImageBefor, defectsFinder.LargeDefectsContoursMatrix, _exclFromCleaning))
             {
                 ImageAfter = scratches.ScratchesReductionSpiralAveranging();
             }
         }
     }
 }
Ejemplo n.º 3
0
        public static void AutomaticRepair(bool dust, bool scratches, bool smudges)
        {
            int steps = 0;

            steps = dust ? steps + 1 : steps;
            steps = scratches ? steps + 1 : steps;
            steps = smudges ? steps + 1 : steps;
            steps = (scratches || smudges) ? steps + 1 : steps;
            ProgressManager.AddSteps(steps);

            if (ImageBefor != null)
            {
                if (smudges)
                {
                    //Progress 9 steps
                    using (Smudge smudge = new Smudge(ImageBefor))
                    {
                        ImageAfter = smudge.CleanSmudges();
                    }
                }

                if (dust || scratches)
                {
                    using (DefectsFinder defectsFinder = new DefectsFinder(ImageBefor))
                    {
                        //Progress 8 steps
                        defectsFinder.SearchDefects();
                        if (dust)
                        {
                            using (Dust dustCleaner = new Dust(ImageAfter, defectsFinder.SmallDefectsContoursMatrix, _exclFromCleaning))
                            {
                                //Progress 100 steps
                                ImageAfter = dustCleaner.DustReductionLeftToRight();
                            }
                        }

                        if (scratches)
                        {
                            using (Scratches scratchesCleaner = new Scratches(ImageAfter, defectsFinder.LargeDefectsContoursMatrix, _exclFromCleaning))
                            {
                                //Progres scratches count
                                ImageAfter = scratchesCleaner.RemoveScrates();
                            }
                        }
                    }
                }
            }
        }