示例#1
0
        /// <summary>
        /// Returns the correction mask.
        /// </summary>
        /// <param name="nbase">Logarithm base</param>
        /// <param name="a">Factor (0, 1]</param>
        /// <param name="b">Offset (0, 1]</param>
        /// <param name="length">Length</param>
        /// <returns>Matrix</returns>
        public static float[,] SingleScaleRetinex(float nbase, float a, float b, 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.SingleScaleRetinex(w, v, nbase, a, b);
                }
            }

            return(table);
        }
示例#2
0
 /// <summary>
 /// Implements filter rebuilding.
 /// </summary>
 protected override void Rebuild()
 {
     this.values = Intensity.SingleScaleRetinex(this.nbase, this.a, this.b, 256);
 }