Home > Photography > Decorrelation Stretch Images
Decorrelation Stretch Images
Decorrelation Stretch[ing] ("DCS") is an image-processing algorithm which originated in the world of satellite and aerial mapping. Its intended use is to highlight differences in an image that are too subtle for a human to see.
DCS is one of the original reasons that I decided to use DaVinci as the foundation for The Mirror's Surface Breaks. There are some striking example images available on various websites, and DaVinci includes support for performing a DCS operation on images.
However, viewing DCS images has an odd effect on me. If I haven't seen any for at least a couple of months, my reaction is that they look amazing. However, my eyes seem to tire quickly of them, and so after a few days I don't want to see any more for awhile. I suppose you could say that - at least as far as my preferences - DCS is sort of the Winterkälte of the image-processing world. In any case, the functionality is there, and it is definitely useful in certain cases.
DCS is a much more complicated process than the others described on this site. There is a bit of a gaping abyss between the "easy, high-level" and "formal, accurate" descriptions of how it works. In order of ascending complexity, here are four of my attempts to explain it, and then a fifth from Jon Harman's website:
- It makes colours that are similar in the original image dissimilar in the processed image.
- If each of the sets of numbers in the original image that define a colour (e.g. red, green, and blue values) is treated as a coordinate in space, decorrelation stretching moves those points in space farther apart, so that it becomes easier to see a difference between them.
- "[It applies a] Karhunen-Loeve transform to the colors of the image. This diagonalizes the covariance (or optionally the correlation) matrix of the colors. Next the contrast for each color is stretched to equalize the color variances. At this point the colors are uncorrelated and fill the colorspace. Finally the inverse transform is used to map the colors back to an approximation of the original."
If you don't know how to "calculate the covariance matrix and eigenvectors of it", don't bother trying to work your way through the actual algorithm.
The aforementioned Jon Harman has found extensive use for it in examining images of petroglyphs and pictographs, and so here is an example in which I've taken one of my own photos of petroglyphs and processed it using DCS. I've also included an image that shows the histograms of the images, and a scatterplot of a sample of pixels in which the R, G, and B values are used as X, Y, and Z coordinates to illustrate the effect that the DCS process is having. As you can see, before the operation, the colours are spaced closely together in the scatterplot, and afterwards, they are very spread out. In other words, they were "highly correlated" before, and "decorrelated" afterwards.
When I was originally researching the technique, I read on Dr. Harman's site that it gives different results in the YUV colourspace, so I gave TMSB the ability to perform it in any colourspace that that software supports. The results seem to be the most useful in the YUV colourspace, especially when larger images are being processed. YUV gives a brighter, higher-contrast appearance, probably because it is biased towards that aspect of human visual perception. The colours are not always quite as well-spaced as when using the RGB colourspace, so the tradeoff may make one or the other preferable for certain types of image. The results in any hue-based colourspace (HSL, HSV, HSY, IHSL, etc.) are quite similar and usually not outstanding, but every once in awhile will be interesting.
Running DCS ("RDCS") is a modified DCS in which the image is divided into sections. Each section has a DCS operation applied separately, and then the sections are blended back together into a single output image. This can dramatically increase the contrast of an image, at the expense of making it extremely noisy.
Here are some examples of DCS that shows it where it is usually strongest - processing satellite imagery. Many sections of the populated areas of Nazca, Peru become highly visible in the DCS-enhanced versions of the same images.