Image processing
1 to 1 Filters
Transform is given by function:
Color out = F( Color in )
![]() |
1 to 1 filter is usually shown as an input-output relationship graph with the original pixel value on the horizontal axis as the input, and the new pixel value on the vertical axis as the output.
|

Useful 1-to-1 transforms:
1. Null transform

2. Photo-inversion transform

3. Brightness correction

4. Contrast enhancement transform

5 Gamma correction

Convolution Filters
One of the most powerful techniques in all of image processing is convolution.
Convolution is the modification of a pixel's value on the basis of the value of neighboring pixels.
Images are convolved by multiplying each pixel and its neighbors by a numerical matrix, called a kernel. This matrix is essentially moved over each pixel in the image, each pixel under the matrix is multiplied by the appropriate matrix value, the total is summed and normalized, and the central pixel is replaced by the result.
Cx,y = å(å(Pi,j*Mi,j))/(å(å(Mi,j))

Kernel can be virtually any size (3x3, 5x5, 5x7, 15x15, whatever), but 3x3 sizes are generally the most useful--they operate only on a pixel and its directly adjacent neighbors.
Convolution requires a lot of computational power. To calculate a pixel for a given mask of size m x n, m * n multiplications, m * n - 1 additions, and one division are required. So to perform a 3 x 3 convolution on a 1024 x 1024 color image (a minimal convolution on an average-size image), 27 million multiplications, 24 million additions, and 3 million divisions are performed. For more substantial convolutions, such as 5 x 5 or 8 x 8, on larger images the amount of computation required becomes very large indeed.
if a filter results in RGB values outside 0..255, we can:
- Clip values to the 0..255 range, so that all values less than 0 become 0, and all values greater than 255 become 255.
At the edge of an image:
|
![]() |

1. Low-frequency filters - Smoothing convolutions
Low frequency filters:
![]() |
![]() |
![]() |
The blur filters - Unweighted smoothing
The blur filters smooth transitions by averaging the pixels next to the hard edges of defined lines and shaded areas in an image
3x3 matrix

9x9 matrix

Gaussian filters - weighted smoothing
The Gaussian distribution in 1-D has the form:
where
is the standard deviation of the distribution. We have also assumed that the
distribution has a mean of zero (i.e. it is centered on the line x=0)
1-D Gaussian distribution with mean 0 and=1
In 2-D, an isotropic (i.e. circularly symmetric) Gaussian has the form:
2-D Gaussian distribution with mean (0,0) and=1
The idea of Gaussian smoothing is to use this 2-D distribution as a `point-spread' function, and this is achieved by convolution. Since the image is stored as a collection of discrete pixels we need to produce a discrete approximation to the Gaussian function before we can perform the convolution. In theory, the Gaussian distribution is non-zero everywhere, which would require an infinitely large convolution kernel, but in practice it is effectively zero more than about three standard deviations from the mean, and so we can truncate the kernel at this point.
3x3 matrix

5x5 matrix
5x5 matrix - discrete approximation to Gaussian function with
=1.0

2. High-frequency filters -sharpening convolution
-
The Sharpen filters focus blurry images by increasing the contrast of adjacent pixels

![]() |
![]() |
How a sharpening convolution works
Sharpening filters
a) High Pass (HP) Filters
-
M(0,0) = b/s
-
M(-1,0)=M(1,0)=M(0,1)=M(0,-1) = -a/s
-
s = b-4a
e.g. a=1, b=5

b) Mean Removal

3. Edge-detection filters
![]() |
![]() |
a) Shift and difference filters
These filters can be constructed to detect edges in specific directions. Due to their limited size, these kernels can only detect edges along the horizontal, vertical, and diagonals.
Vertical
|
Horizontal
|
Diagonal
|
b) Laplacian filters
L(f(x,y)) = d2f/dx2 + d2f/dy2
for discrete function
d2f/dx2 = f(x+1,y)-2*f(x,y)+f(x-1,y)
d2f/dy2 = f(x,y+1)-2*f(x,y)+f(x,y-1)
kernel matrix:

4. Emboss filters
![]() |
East filter:
|
South-East filter:
|
||||||||||||||||||
South-East filter (2):
|
South filter:
|











