Exemple #1
0
        public void GrayworldWBProperties()
        {
            using var wb = CvXPhoto.CreateGrayworldWB();
            var saturationThreshold = wb.SaturationThreshold;

            const float val = 100f;

            wb.SaturationThreshold = val;

            Assert.Equal(val, wb.SaturationThreshold);
            Assert.NotEqual(saturationThreshold, wb.SaturationThreshold);
        }
Exemple #2
0
        public void GrayworldWBBalanceWhite()
        {
            using var wb  = CvXPhoto.CreateGrayworldWB();
            using var src = Image("lenna.png");
            using var dst = new Mat(src.Rows, src.Cols, src.Type());
            wb.BalanceWhite(src, dst);

            if (Debugger.IsAttached)
            {
                using var combined = new Mat(src.Rows, src.Cols * 2, src.Type());
                using var roi1     = new Mat(combined, new Rect(0, 0, src.Cols, src.Rows));
                using var roi2     = new Mat(combined, new Rect(src.Cols, 0, src.Cols, src.Rows));
                src.CopyTo(roi1);
                dst.CopyTo(roi2);
                Window.ShowImages(combined);
            }
        }