Example #1
0
        public override void InitParameters()
        {
            base.InitParameters();

            ParametrizedObjectParameter disparityParam = new ParametrizedObjectParameter(
                "Disparity Computer", "DISP_COMP");

            disparityParam.Parameterizables = new List<IParameterizable>();
            var dcWTA = new WTADisparityComputer();
            dcWTA.InitParameters();
            disparityParam.Parameterizables.Add(dcWTA);

            var intWTA = new InterpolationDisparityComputer();
            intWTA.InitParameters();
            disparityParam.Parameterizables.Add(intWTA);

            Parameters.Add(disparityParam);
        }
Example #2
0
        public void Test_BSGM_NoNoise()
        {
            SGMAggregator agg = new SGMAggregator();
            CensusCostComputer cost = new CensusCostComputer();
            WTADisparityComputer dispComp = new WTADisparityComputer();

            cost.ImageBase = new GrayScaleImage() { ImageMatrix = _imageLeft };
            cost.ImageMatched = new GrayScaleImage() { ImageMatrix = _imageRight };
            cost.MaskWidth = 3;
            cost.MaskHeight = 3;
            agg.CostComp = cost;

            dispComp.ConfidenceComp.UsedConfidenceMethod = ConfidenceMethod.TwoAgainstTwo;
            dispComp.CostComp = cost;
            dispComp.ImageBase = cost.ImageBase;
            dispComp.ImageMatched = cost.ImageMatched;
            agg.DispComp = dispComp;

            DisparityMap disp = new DisparityMap(_imageLeft.RowCount, _imageLeft.ColumnCount);
            agg.DisparityMap = disp;
            dispComp.DisparityMap = disp;

            agg.ImageBase = cost.ImageBase;
            agg.ImageMatched = cost.ImageMatched;
            agg.IsLeftImageBase = true;
            agg.Fundamental = _F;

               // agg.PathsLength = 10;
            agg.LowPenaltyCoeff = 0.02;
            agg.HighPenaltyCoeff = 0.04;
            agg.MaxDisparity = 10;
            agg.MinDisparity = 1;

            dispComp.Init();
            agg.Init();
            agg.ComputeMatchingCosts();
        }
Example #3
0
        public override void InitParameters()
        {
            base.InitParameters();

            IntParameter maxDXParam =
                new IntParameter("Max Disparity In X (Positive)", "DXPOS", 1, -100000, 100000);
            Parameters.Add(maxDXParam);

            IntParameter minDXParam =
                new IntParameter("Max Disparity In X (Negative)", "DXNEG", 1, -100000, 100000);
            Parameters.Add(minDXParam);

            IntParameter maxDYParam =
                new IntParameter("Max Disparity In Y (Positive)", "DYPOS", 1, -100000, 100000);
            Parameters.Add(maxDYParam);

            IntParameter minDYParam =
                new IntParameter("Max Disparity In Y (Negative)", "DYNEG", 1, -100000, 100000);
            Parameters.Add(minDYParam);

            ParametrizedObjectParameter disparityParam = new ParametrizedObjectParameter(
                "Disparity Computer", "DISP_COMP");

            disparityParam.Parameterizables = new List<IParameterizable>();
            var dcWTA = new WTADisparityComputer();
            dcWTA.InitParameters();
            disparityParam.Parameterizables.Add(dcWTA);

            var intWTA = new InterpolationDisparityComputer();
            intWTA.InitParameters();
            disparityParam.Parameterizables.Add(intWTA);

            Parameters.Add(disparityParam);
        }