コード例 #1
0
        /// <summary>
        /// Creates the <see cref="HistogramEqualizationProcessor"/> that implements the algorithm
        /// defined by the given <see cref="HistogramEqualizationOptions"/>.
        /// </summary>
        /// <param name="options">The <see cref="HistogramEqualizationOptions"/>.</param>
        /// <returns>The <see cref="HistogramEqualizationProcessor"/>.</returns>
        public static HistogramEqualizationProcessor FromOptions(HistogramEqualizationOptions options)
        {
            HistogramEqualizationProcessor processor;

            switch (options.Method)
            {
            case HistogramEqualizationMethod.Global:
                processor = new GlobalHistogramEqualizationProcessor(
                    options.LuminanceLevels,
                    options.ClipHistogram,
                    options.ClipLimitPercentage);
                break;

            case HistogramEqualizationMethod.AdaptiveTileInterpolation:
                processor = new AdaptiveHistogramEqualizationProcessor(
                    options.LuminanceLevels,
                    options.ClipHistogram,
                    options.ClipLimitPercentage,
                    options.NumberOfTiles);
                break;

            case HistogramEqualizationMethod.AdaptiveSlidingWindow:
                processor = new AdaptiveHistogramEqualizationSlidingWindowProcessor(
                    options.LuminanceLevels,
                    options.ClipHistogram,
                    options.ClipLimitPercentage,
                    options.NumberOfTiles);
                break;

            default:
                processor = new GlobalHistogramEqualizationProcessor(
                    options.LuminanceLevels,
                    options.ClipHistogram,
                    options.ClipLimitPercentage);
                break;
            }

            return(processor);
        }
コード例 #2
0
 /// <summary>
 /// Creates the <see cref="HistogramEqualizationProcessor"/> that implements the algorithm
 /// defined by the given <see cref="HistogramEqualizationOptions"/>.
 /// </summary>
 /// <param name="options">The <see cref="HistogramEqualizationOptions"/>.</param>
 /// <returns>The <see cref="HistogramEqualizationProcessor"/>.</returns>
 public static HistogramEqualizationProcessor FromOptions(HistogramEqualizationOptions options) => options.Method switch
 {