Graphics Reference
In-Depth Information
7
Performing Image
Processing Techniques
In this chapter, we will use compute shaders (or DirectCompute) for the following image
processing techniques:
F Running a compute shader - desaturation (grayscale)
F Adjusting the contrast and brightness
F Implementing box blur using separable convolution filters
F Implementing a Gaussian blur filter
F Detecting edges with the Sobel edge-detection filter
F Calculating an image's luminance histogram
Introduction
Image processing is the process of applying a signal-processing technique against an input
image. The input image is generally a two-dimensional signal with the output being either
another image or any properties derived from the input signal.
During this chapter, we will implement a number of filtering techniques using compute
shaders (also known as DirectCompute). Utilizing compute shaders for this process allows
us to provide image processing in general applications, including non-UI applications, and
in some cases is able to achieve a significant performance improvement over pixel shaders
(most notably large radius filters). In some circumstances it may be desirable to implement
the filter technique within a pixel shader by rendering to a screen-aligned quad, although we
lose some of the unique capabilities of the compute shader when doing so—such an example
might be small radius blurs where we can utilize the bilinear hardware support.
Search WWH ::




Custom Search