The Direct Decorrelation Stretch (DDS) is a simple type of saturation stretch. The stretch is applied to a colour composite image (Data Type of RGB) and is used to improve the saturation, or colourfulness, of the image. The DDS operates by reducing the achromatic (grey) component of a pixel's colour by a scale factor (k), such that the red (r), green (g), and blue (b) components of the output colour are defined as:
rk = r - k min(r, g, b)
gk = g - k min(r, g, b)
bk = b - k min(r, g, b)
The achromatic factor (k) can range between 0 (no effect) and 1 (full saturation stretch), although typical values range from 0.3 to 0.7. A linear stretch is used afterwards to adjust overall image brightness. Liu and Moore (1996) recommend applying a colour balance stretch, such as Balance Contrast Enhancement before using the DDS.
The following is an example of a Python script that uses this tool:
wd = pluginHost.getWorkingDirectory()
inputFile = wd + "input.dep"
outputFile = wd + "output.dep"
achromaticFactor = "0.5"
args = [inputFile, outputFile, achromaticFactor]
pluginHost.runPlugin("DirectDecorrelationStretch", args, False)
This is a Groovy script also using this tool:
def wd = pluginHost.getWorkingDirectory()
def inputFile = wd + "input.dep"
def outputFile = wd + "output.dep"
def achromaticFactor = "0.5"
String[] args = [inputFile, outputFile, achromaticFactor]
pluginHost.runPlugin("DirectDecorrelationStretch", args, false)