IP Theory- Unit 1&2
IP Theory- Unit 1&2
• What is IP?
Assume a human seeing the a traffic signal on the road. Immediately his eyes will start
capturing the content and brain shall interpret what the signals signify. In digital image
processing, the same image shall be fed in as an input to the system. The eye is the camera
and brain is the processing system in this case. The system shall interpret and understand
the content to let the further actions happen. The algorithm developed shall play a major
role in understanding the contents with higher accuracy.
• What is an Image?
An image, is a binary representation of visual information.
Images are mathematically represented as a two dimensional function, f(x,y)
where,
x and y are called the spatial coordinates
f is the intensity or gray level of the image at that point
• What is a pixel?
A digital image is an image composed of picture elements also known as PIXELS. Each pixel
has a finite, discrete quantity representing the numerical representation for intensity or
grey level.
• Resolution of an Image
• Spatial Resolution
Spatial resolution of an image is the physical size of the image in form of number of pixels
in the image smallest discernible detail in an image depends on the number of pixels.
An image can be either down sampled to reduce resolution or upsampled to increase
resolution in spatial domain.
• Down Sampling
In the down-sampling technique, the number of pixels in the given image is reduced
depending on the sampling frequency.
Due to this, the resolution and size of the image decrease. An image can be either down
sampled to reduce resolution or upsampled to increase resolution in spatial domain.
• Up Sampling
The number of pixels in the down-sampled image can be increased by using up-sampling
interpolation techniques. The up-sampling technique increases the resolution as well as the
size of the image.
• Intensity Level
refers to the number of gray level / number of intensity levels. It is given in terms of the
number of bits used to store each intensity level. For example: 8 bit , 16 bit
Also called Gray level Resolution
It represents value of each pixel: Binary image (1-bit), Monochrome images (8 bit grey scale),
Colour images (24 bit colour scale)
• 4 Neighbours of a Pixel
Any pixel p(x, y) has two vertical and two horizontal neighbours, given by
Two horizontal → (x, y+1), (x, y-1)
Two vertical → (x+1, y), (x-1, y)
• 8 Neighbours of a Pixel
The points ND(P) and N4(P) are together known as 8-neighbors of the
point P, denoted by N8(P).
Some of the points in the N4, ND and N8 may fall outside image when P lies on the border of
image.
• Connectivity/ Adjacency: Being connected means the pixels have same value / grey level
with its neighboring pixel
We see horizontal / vertical neighbor for 4 way adjacency
We see diagonal pixels for 8 way adjacency
a) 4-connectivity: Two or more pixels are said to be 4-connected if they are 4-adjacent with
each others.
b) 8-connectivity: Two or more pixels are said to be 8-connected if they are 8-adjacent with
each others.
c) m-connectivity: Two or more pixels are said to be m-connected if they are m-adjacent
with each others.
• Note: The role of m-adjacency is to define a single path between pixels. It is used in many
image analysis and processing algorithms. There is a ambiguity in path from p to q (i.e p and
q are not m connected). Always select the 4 adjacent path over the diagonal path.
IP Theory Unit 2:
• What is image enhancement?
o Highlighting interesting detail in images
o Emphasize, sharpen or smoothen image features
o Removing noise from images
o Making images more visually appealing
o Enhance otherwise hidden information
• Contrast
Contrast refers to the differences of the gray level amplitudes within an image.
The difference in brightness between light and dark areas of an image.
Contrast determines the number of shades in the image.
• Point Processing
In point processing we work on single pixel. Some examples of point processing are
• Digital negative
• Contrast Stretching
• Thresholding
• Grey level slicing
• Bit level slicing
• Log Transformation
• Power law transformation
• Log Transformation
In some images it happens that some pixels have very large values so large that the other
low value pixels are obscured. Example in daytime we cannot see stars because intensity of
sun is very large and that of stars is low so eye cannot adjust to the dynamic range
Thus, we decrease the dynamic range of the image. We use LOG OPERTOR to do this.
• Histogram
Histogram is a graphical representation of the intensity distribution of an image.
In simple terms, it represents the number of pixels for each intensity value (grey level) of
the image. Histogram is widely useful in image processing
X axis → intensity level y axis → number of pixels with this intensity level. Based on intensity
characteristics, histograms are classified as histogram of light image, dark image, low
contrast image, high contrast image. Notice that the high contrast image has the most
evenly spaced histogram.
• Histogram Usage
Histogram is used for various image processing applications such as :
o Manipulating contrast or brightness
o Improve quality by normalizing the histogram values to a flat profile
• Types of Histograms
Histogram equalization, Histogram matching (specification), Local enhancement
• Histogram Equalization
Histogram equalization also known as histogram flattening. Preprocessing technique to
enhance contrast in ‘natural’ images (sharpen an image). Redistributes to generate equal
number of pixels for every gray-value. Spreads the frequencies of an image. Therefore it is
called as equalization.
• Spatial Filtering
Let us say you want to sharpen or blur a image. One of the way of doing it is by spatial
filtering.
By spatial filtering we can :
• blur the images (this is equivalent to low pass filtering operation) or
• sharpen the images (this is equivalent to high pass filtering operation)
Spatial Filtering is just moving the filter mask from point to point in an image. The filter mask
is also called as Template, window, kernel. Filtering creates a new pixel value with
coordinates equal to the coordinates of the center of the neighborhood whose value is the
result of filtering operation. A filtered image is obtained as the center of the filter visits each
pixel in the input image. Sharpness/detail begins to disappear with increase in size of mask.
The output intensity value at (x,y) depends on the input intensity value at (x,y) and the
neighboring pixel intensity values around (x,y). Spatial masks (also called window, filter,
kernel, template) are convolved over the entire range for local enhancement (spatial
filtering). The size of the masks (3x3, 5x5, 7x7..) determines the number of neighboring
pixels which influence the output value at (x,y). The values (coefficients) of the mask
determine the nature and properties of enhancing technique.
• Note: For filtering or morphological operations: we coincide the mask coefficient with the
image pixel such that center of mask w(0,0) coincide with the center of the image pixels
f(x,y)