Class AlgorithmColorSaturation

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

    public class AlgorithmColorSaturation
    extends AlgorithmBase
    This algorithm changes the saturation of a color image while keeping the hue and intensity constant. Intensity = (R + G + B)/3 Hue = theta if B <= G = 360 - theta if B > G with theta = arccos{0.5[(R - G) + (R - B)]/sqrt[(R - G)**2 + (R - B)*(G - B)]} Saturation = 1 - 3 * min(R, G, B)/(R + G + B) Derived from quaternion formula: Radial dilation = ((a + 2)/2)*(r*i + g*j + b*k) + (a/2)*u*(ri + g*j + b*k)*u where u is a pure unit quaternion. For radial dilation around the gray line where r = g = b, set u = (i + j + k)/sqrt(3) Radial dilation around gray line = ((a + 2)/2)*(r*i + g*j + b*k) + (a/2)*((i + j + k)/sqrt(3))*(r*i + g*j + b*k)*((i + j + k)/sqrt(3)) which expands space outward for a > 0 or moves it out from the r = g = b line and compresses space for a < 0 or moves it in towards the r = g = b line. Using a = -1 sets r = g = b at every pixel. Using a = -2 complements the image in an opposing color sense. If need be, decrease the magnitude of a applied to a particular pixel so that the 3 equations can be satisfied for legal values of r, g, and b. References: 1.) Multivariate Image Processing, Christopher Collet, Jocelyn Chanussot, and Kacem Chehdi, editors, Chapter 13, Hypercomplex Models and Processing of Vector Images by S. J. Sangwine, T. A. Ell, and N. Le Bihan, Year 2010, Publisher Wiley, pp. 407-436. 2.) "Hypercomplex color affine filters" by T. A. Ell, IEEE International Conference on Image Processing (ICIP 2000), vol. II, Vancouver, Canada, Institute of Electrical and Electronics Engineers, pp. 792-795, September 16-19, 2007.
    • Field Detail

      • a

        private float a
    • Constructor Detail

      • AlgorithmColorSaturation

        public AlgorithmColorSaturation()
        AlgorithmColorSaturation - default constructor.
      • AlgorithmColorSaturation

        public AlgorithmColorSaturation​(ModelImage destImg,
                                        ModelImage srcImg,
                                        float a)
        AlgorithmColorSaturation.
        Parameters:
        destImg - DOCUMENT ME!
        srcImg - DOCUMENT ME!
        a - Scale factor which increases saturation for a > 0 and decreases saturation for a < 0