private void powerTransformMenuItem_Click(object sender, EventArgs e) { double pow = double.Parse(paramsTextBox.Text); byte fMax = SourceImage.Cast <byte>().Max(); ApplyTransform((x) => FixRange((int)(255 * Math.Pow((double)x / fMax, pow)))); }
private void linearContrastMenuItem_Click(object sender, EventArgs e) { byte fMax = SourceImage.Cast <byte>().Max(); byte fMin = SourceImage.Cast <byte>().Min(); ApplyTransform((x) => FixRange((255 * (x - fMin) / (fMax - fMin)))); }
private void logarithmicTransformMenuItem_Click(object sender, EventArgs e) { double logMax = Math.Log(1 + SourceImage.Cast <byte>().Max()); ApplyTransform((x) => FixRange((int)(255 * Math.Log(1 + x) / logMax))); }