コード例 #1
0
        /// <summary>
        /// Returns the correction mask.
        /// </summary>
        /// <param name="a">Factor [-1, 1]</param>
        /// <param name="length">Length</param>
        /// <returns>Matrix</returns>
        public static float[,] LocalContrastEnhancement(float a, int length)
        {
            float[,] table = new float[length, length];
            float w, v;
            int   x, y;

            for (x = 0; x < length; x++)
            {
                w = x / (float)length;

                for (y = 0; y < length; y++)
                {
                    v = y / (float)length;

                    table[x, y] = Intensity.LocalContrastEnhancement(w, v, a);
                }
            }

            return(table);
        }
コード例 #2
0
 /// <summary>
 /// Implements filter rebuilding.
 /// </summary>
 protected override void Rebuild()
 {
     this.values = Intensity.LocalContrastEnhancement(this.contrast, 256);
 }