Class AlgorithmRuleBasedContrastEnhancement

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.WindowListener, java.lang.Runnable, java.util.EventListener

    public class AlgorithmRuleBasedContrastEnhancement
    extends AlgorithmBase
    This algorithm uses an equation with 3 membership functions, udark, ugray, and ubright, to transform a gray level g to a new gray level g' for histogram enhancement. Data type is promoted if necessary. g' = (udark(g)*gmin + ugray(g)*gmid + ubright(g)*gmax)/(udark(g) + ugray(g) + ubright(g)) gmin and gmax are the new user selected minimum and maximum gray scale levels, with gmin = srcMax. Must have gmin srcMax. If we were to have gmin == srcMin and gmax = srcMax, then the image would be unchanged after processing. By default gmid = (srcMin + srcMax)/2.0, but the user can select other values between srcMin and srcMax. Note that in reference 3 the authors used gmin = 0, gmid = 200, gmax = 255. udark(g) has 2 straight line segments. The first stays at 1 from gmin to srcMin. The second goes from goes from 1 at srcMin to 0 at gmid. ugray(g) has 2 line segments. The first goes from 0 at srcMin to 1 at gmid. The second goes from 1 at gmid to 0 at srcMax. udark has 2 straight line segments. The first goes from 0 at gmid to 1 at srcMax. The second stays at 1 from srcMax to gmax. References: 1.) Digital Image Processing Third Edition by Rafael C. Gonzalez and Richard E. Woods, Section 3.8.4 Using Fuzzy Sets for Intensity Transformations, Pearson Prentice Hall, 2008, pp. 186-189. 2.) Tizhoosh, H. R., "Fuzzy Image Enhancement: An Overview," in Fuzzy Techniques in Image Processing, E. Kerre and M. Nachtegael, eds., Springer-Verlag, New York, 2000, pp. 147-148. 3.) Tizhoosh HR, Krell G, and Michaelis B., "On Fuzzy Image Enhancement of Megavoltage Images in Radiation Therapy," in Proceedings of FUZZ-IEEE'97 (Barcelona), pp. 1399-1404, 1997.
    • Field Detail

      • gmin

        private double gmin
        The new image minimum. Must have gmin
        • gmid

          private double gmid
          Gray scale value at which ugray(g) = 1.0. By default gmid = (srcMin + srcMmax)/2.0, but it can assume any value between srcMin and srcMax
        • gmax

          private double gmax
          The new image maximum. Must have gmax >= srcMax
        • Constructor Detail

          • AlgorithmRuleBasedContrastEnhancement

            public AlgorithmRuleBasedContrastEnhancement​(ModelImage srcImg,
                                                         double gmin,
                                                         double gmid,
                                                         double gmax)
            Constructor for images in which changes are returned to the source image.
            Parameters:
            srcImg - Source image model.
            gmin - The new image minimum
            gmid - Gray scale value at which ugray(g) = 1.0
            gmax - The new image maximum
          • AlgorithmRuleBasedContrastEnhancement

            public AlgorithmRuleBasedContrastEnhancement​(ModelImage destImg,
                                                         ModelImage srcImg,
                                                         double gmin,
                                                         double gmid,
                                                         double gmax)
            Constructor for images in which changes are placed in a predetermined destination image.
            Parameters:
            destImg - Image model where result image is stored.
            srcImg - Source image model.
            gmin - The new image minimum
            gmid - Gray scale value at which ugray(g) = 1.0
            gmax - The new image maximum
        • Method Detail

          • finalize

            public void finalize()
            Prepares this class for destruction.
            Overrides:
            finalize in class AlgorithmBase
          • calcStoreInPlace

            private void calcStoreInPlace()
            Rule based contrast enhancement of the source image. Replaces the original image with the processed image.
          • calcStoreInDest

            private void calcStoreInDest()
            This function produces a new image that has had rule based contrast enhancement