Example #1
0
        private void tsmiThreshold_Click(object sender, EventArgs e)
        {
            var Threshold = QueryThreshold("Пороговое преобразование");

            if (Threshold < 0)
            {
                return;
            }
            var Func = new Point[] {
                new Point {
                    X = 0, Y = 85
                },
                new Point {
                    X = Threshold, Y = 85
                },
                new Point {
                    X = Threshold, Y = 170
                },
                new Point {
                    X = 256, Y = 170
                }
            };

            Bitmaps.Transform(r => Transformations.PiecewiseLinear(r, Func));
            pbProcessed.Refresh();
        }
Example #2
0
        private void tsmiPiecewiseLinear_Click(object sender, EventArgs e)
        {
            var Func = new Point[4];

            Func[0].X = 0;
            Func[0].Y = 50;
            Func[1].X = 150;
            Func[1].Y = 200;
            Func[2].X = 150;
            Func[2].Y = 150;
            Func[3].X = 256;
            Func[3].Y = 256;
            Bitmaps.Transform(r => Transformations.PiecewiseLinear(r, Func));
            pbProcessed.Refresh();
            ShowGraphic(EvtArgs => PaintPiecewiseLinearFunc(EvtArgs, Func));
        }