public static ContrastEnhancer Instance()
 {
     if (_instance == null)
     {
         lock (instancelock)
         {
             if (_instance == null)
             {
                 _instance = new ContrastEnhancer();
             }
         }
     }
     return(_instance);
 }
Beispiel #2
0
    public RGBChannels ApplyConstrastEnhancement(RGBChannels image, ContrastType type, double quantil = 0.1)
    {
        if (contrastEnhancer == null)
        {
            contrastEnhancer = ContrastEnhancer.Instance();
        }
        RGBChannels output = image;

        switch (type)
        {
        case ContrastType.AutoContrast:
            output = contrastEnhancer.AutoContrast(image);
            break;

        case ContrastType.RobustContrast:
            output = contrastEnhancer.RobustContrast(image, quantil);
            break;

        case ContrastType.HistogramEqualization:
            output = contrastEnhancer.HistogramEqualization(image);
            break;
        }
        return(output);
    }