# Image Enhancement Using Point Transformation Techniques

The term spatial domain refers to the image plane itself and image processing techniques in this category are based on direct manipulation of pixels in an image. The spatial domain processes can be denoted by the expression

$$g(x, y) = T[ f(x,y) ]$$

where \(f(x,y)\) is the input image, \(g(x,y)\) is the output image and \(T\) is an operator on \(f\) defined over a neighborhood of point \((x,y)\). Typically the neighborhood is rectangular, centered on \((x,y)\), and much smaller in size than the image.

Smallest possible neighborhood is of size \( 1\times 1\). In this case, \(g\) depends only on the value of \(f\) at a single point \((x,y)\), and \(T\) becomes an** intensity (or gray-level) transformation function or point transformation** of the form

$$ s = T (r) $$

where \(s\) and \(r\) are variables denoting the intensity of \(g\) and \(f\) at any point \((x,y)\) respectively.

**Point Transformation**

Point transformation is carried out by various point transformation function which can be categorized as

**Linear Point Transformation Function**

Linear functions are of the following form

$$ a \times f(x,y) + b$$

where \(a\) and \(b\) are constants and manipulate contrast and brightness. Example of linear functions are

- Identity Function
- Inverse Function

**Image Negative or Inversion Function**

Inversion is one of the important linear point transformation functions, which performs a digital negative operation. The negative of an image with intensity levels in the range \([0, L – 1]\) is obtained by using the negative transformation shown below

$$ s = L -1 – r $$

This type of processing is particularly suited for enhancing white or gray details embedded in dark region of an image, especially when the black areas are dominant in size.

**Non-Linear Point Transformation Function**

For a non linear operator, the relationship between input and output variables are non linear. Some of the important non linear functions frequently used in image processing are square, square root, logarithm and exponential functions.

**Log Transformations**

The general form of the \(\log\) transformation is

$$ s = c.log( 1 + r)$$

where \(c\) is a constant and it is assumed that \( r \ge 0 \). The shape of the \(\log\) curve is shown below shows that

this transformation maps a narrow range of low intensity values in the input into a wider range of output levels. The opposite is true for higher range of values.

**We use the transformation of this type to expand the value of dark pixels in an image while compressing the higher level values. The opposite is true for inverse log transformation function.**

The inverse log transformation function is given by

$$ s = c.2^r – 1$$

The \(\log\) function has the important characteristics that it compress the dynamic range of the image with large variations in pixel values. A classical illustration of this in which pixel values have large dynamic range is the Fourier Spectrum.

**Power-Law (Gamma Transformations)**

Power law transformation have the basic form

$$s = c.r^\gamma$$

where \(c\) and \(\gamma\) are positive constant. Sometimes the above equation is written as \(s = c(r + \epsilon)^\gamma\) to account for an offset (that is a measurable output when input is zero. plot of \(s\) versus \(r\) for various values of \(\gamma\) are shown below.

**As in the case of \(\log\) transformation, power law curves with fractional value of \(\gamma\) map a narrow range of dark input values into a wider range of output values, with the opposite being true for higher values of input levels. As expected curves generated with values of \(\gamma > 1\) have exactly opposite effect as those generated with values of \(\gamma < 1\).**

**Gamma Correction**

Gamma correction controls the overall brightness of an image. Images which are not properly corrected can look either bleached out, or too dark. Trying to reproduce colors accurately also requires some knowledge of gamma. Varying the amount of gamma correction changes not only the brightness, but also the ratios of red to green to blue.

To explain gamma correction we will begin with where you are looking – your computer monitor.

Almost every computer monitor, from whatever manufacturer, has one thing in common. They all have a intensity to voltage response curve which is roughly a \(2.5\) power function. Don’t be afraid, this just means that if you send your computer monitor a message that a certain pixel should have intensity equal to x, it will actually display a pixel which has intensity equal to \(x ^ {2.5}\) Because the range of voltages sent to the monitor is between \(0\) and \(1\), this means that the intensity value displayed will be less than what you wanted it to be. (\(0.5 ^ {2.5} = 0.177\) for example) Monitors, then, are said to have a gamma of \(2.5\).

To correct this annoying little problem, the input signal to the monitor (the voltage) must be “gamma corrected”. The solution, fortunately, is a simple one. Since we know the relationship between the voltage sent to the monitor and the intensity which it produces, we can correct the signal before it gets to the monitor.

This article is contributed by Ram Kripal. If you like eLgo Academy and would like to contribute, you can mail your article to admin@elgoacademy.org. See your article appearing on the eLgo Academy page and help other Geeks. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.