コード例 #1
0
ファイル: CostAggregatorTests.cs プロジェクト: KFlaga/Cam3D
        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();
        }