Ejemplo n.º 1
0
        public static DiffVect CompDiff(Mat input, Mat comp, BreakDiffDebugReporter reporter)
        {
            var processor = new ShiftVecProcessor(input, comp);
            var vect      = processor.GetAllDiffVect();

            if (reporter != null)
            {
                reporter.ReportStepChanges(processor, vect);
            }
            return(vect);
        }
Ejemplo n.º 2
0
        public static void breakAndDiff(Mat m1, Mat m2, BreakDiffDebugReporter reporter)
        {
            var curProcessor = new ShiftVecProcessor(m1, m2);
            //Mat res = ShiftVecDector.BreakAndNearMatches(m1, m2);
            var vect = curProcessor.GetAllDiffVect();


            Mat res = curProcessor.ShowAllStepChange(vect);

            reporter.Report(res, vect);
        }
Ejemplo n.º 3
0
        public static DiffVect FindInRage(PreVidStream stream, Mat curr, int steping = 1, int from = 0, int to = 0)
        {
            if (to == 0 || to > stream.Total)
            {
                to = stream.Total;
            }
            if (from < 0)
            {
                from = 0;
            }
            DiffVect curMax = null;

            for (int pos = from; pos < to; pos += steping)
            {
                stream.Pos = pos;
                var processor = new ShiftVecProcessor(curr, stream.GetCurMat());
                var all       = processor.GetAllDiffVect();
                all.VidPos = pos;
                var maxGood = all.Vector.Diff;
                if (curMax == null)
                {
                    curMax = all;
                }
                else
                {
                    if (maxGood > curMax.Vector.Diff)
                    {
                        curMax = all;
                    }
                }
            }
            //Console.WriteLine($"max at {curMax.Pos} {curMax.diff.ToString("0.00")}");
            if (steping == 1)
            {
                return(curMax);
            }
            return(FindInRage(stream, curr, 1, curMax.VidPos - steping, curMax.VidPos + steping));
        }