0% found this document useful (0 votes)
85 views16 pages

Experiment: Digital Image Processing: Image As A 2 D Signal

This document discusses digital image processing. It defines a digital image as a 2D signal where pixels represent the intensity at positions (x,y). Digital images can be binary, grayscale, or color. Frequency in an image refers to how quickly pixel values change over space - higher frequencies correspond to more rapid changes. Filters are used to modify images and can be classified as low-pass, high-pass, band-pass or band-reject based on which frequencies they preserve or reject. Common spatial filters include average, Gaussian, median, Prewitt, Sobel and Laplacian filters for smoothing and sharpening images. Frequency domain filtering uses techniques like the FFT. MATLAB commands for reading, displaying, filtering and transforming images are

Uploaded by

AJAY MEENA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views16 pages

Experiment: Digital Image Processing: Image As A 2 D Signal

This document discusses digital image processing. It defines a digital image as a 2D signal where pixels represent the intensity at positions (x,y). Digital images can be binary, grayscale, or color. Frequency in an image refers to how quickly pixel values change over space - higher frequencies correspond to more rapid changes. Filters are used to modify images and can be classified as low-pass, high-pass, band-pass or band-reject based on which frequencies they preserve or reject. Common spatial filters include average, Gaussian, median, Prewitt, Sobel and Laplacian filters for smoothing and sharpening images. Frequency domain filtering uses techniques like the FFT. MATLAB commands for reading, displaying, filtering and transforming images are

Uploaded by

AJAY MEENA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

     

Experiment : Digital Image Processing 
 
 
● Image as a 2­D signal. 

 
We can think of an image as a function,  
​ f : R2 ­­> R 
f( x, y ) gives the intensity at position ​( x, y )  
Realistically, we expect the image only to be defined over a rectangle, with a finite range. 
 
 
 
 
● What  is an Digital Image? 
Reflected  light  from  scene  sampled  in  space  and  represented  as  discrete  elements  called 
pixels  (pixel=picture+element).  Hence  pixel  is   a  smallest  distinguishable  element  of  a 
digital image. 
 

 
 
 
 
● How a digital image is represented ? (Types of digital images) 
○ Binary image/Black & White image: 
Only two possible pixel values; 0=black, 1=white 

 
○ Grayscale scale image: 
'double' format in range 0 to 1 
0.0=black, 1.0=white 
'uint8'  format in range 0 to 255 (for 8 bit image) 
0=black, 255=white,  

 
○ Color image: 
R, G, B planes each satisfying grayscale pixel value criteria 
 
 
 
● What is frequency in an image? 

 
 
In the above figure, intuitively we can say t2​t3 section contains higher frequency content 
as compared to t1​t2 as there are larger variations in t2​t3 in smaller duration as compared 
to t1​t2. Similarly in spatial domain (i.e. in case of images) if pixel values are changing 
suddenly in smaller spatial window then we can say there is high frequency content in 
image. Opposite to that, if pixel values are varying slowly then it corresponds to lower 
frequency content. 
 
 
 
● What are image filters/masks/kernel/template/subimage? 
Filters are classified as: 
Low­pass (i.e., preserve low frequencies) 
High­pass (i.e., preserve high frequencies) 
Band­pass (i.e., preserve frequencies within a band) 
Band­reject (i.e., reject frequencies within a band) 
 
Spatial Filtering 
 
1­D moving avg 

 
 
 
 
The concept of moving average filter is explained with the help of figure above.In case of 1D 
signal, both signal and filter are vectors. In 2D case both signal and filter will be matrices. 
 
Linear Spatial Filtering: 
In general, linear filtering of an image f of size MxN with a filter mask of size mxn is given by 
the expression: 
 

Need to define: 
(1) a neighborhood (or mask) 
(2) an operation T 
 
 

 
 
 
Non­Linear Spatial filtering: 
 
Nonlinear spatial filters (Order­statistics filters) are those, whose response is based on ordering 
(ranking) the pixels contained in the image area encompassed by the filter, and then replacing the 
value of the center pixel with the value determined by the ranking result. 

 
 
We will mainly focus on two types of spatial filters: 
Smoothing (low­pass) 
Sharpening (high­pass) 
 
NOTE:​ Sum of elements of mask should become one. 
 
Smoothing Filters 
● Box Average filter 

 
 
 
● Gaussian filter 
Two parameters, Standard deviation and size. 
 
Size ~ 5 times of deviation 

 
 

 
 
 
● Median Filtering 
 

 
 
Corp region of neighborhood 
Sort the values of the pixel in our region 
In the MxN mask the median is MxN div 2 +1 
Sharpening Filters 
 
The principal objective of sharpening is to highlight fine detail in an image or to enhance detail 
that has been blurred. Taking the derivative of an image results in sharpening the image. 
The derivative of an image (i.e., 2D signal) can be computed using the gradient. 
 

 
 
 

 
 
Gradient magnitude: provides information about edge strength. 
Gradient direction: perpendicular to the direction of the edge. 
 
 
 
 
 
 
 
 
● Prewitt Filter 
 
● Sobel Filter 

 
 
 
 
 
● Laplacian filter 
Second derivative. 

 
 
 
 
● Unsharp masking 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Frequency domain Filtering: 
 

   
 

 
● Read the description of following MATLAB commands using ‘help’: imread, fspecial, 
imfilter, imshow, fft2, ifft2, figure. 
● Basic understanding of filters (LPF HPF). 
● Basic concepts of signals and systems. 
 
 
Digital Image processing

PREREQUISITES​ : Basic Matlab Programming (Data types,loops,conditional


statements)

NOTES​ :
1 Brief review of Topics in Part A and Part B has to be done before attending lab
2. Part A,B and C will be done in lab . Part D is assignment
3. For brief review one can refer Google along with the Study material provided
in separate file

PART A
AIM: understand the following basic concepts
1. What is an image
2. What are different types of images and how they are represented
3. What is frequency in an image
4. What is filter maskin case of 2D images

PART B
AIM: Apply following filter on the given grayscale image one by one with the
inbuilt matlab commands and understand the results
Basic commands: (can be Referred from Mathworks)
1. imread
2. Imshow
3. imfilter
4. fspecial

Filters (Can be Referred from Wikipedia)


1. Average filter
2. Gaussian filter(vary size and sigma parameter)
3. Prewitt filter
4. sobel filter (compare with Prewitt filter)
5. Laplacian filter (compare with Prewitt filter and sobel )
6. LoG filter (compare with Laplacian filter)
7. DoG filter (compare with LoG filter)
8. Unsharp mask

PART C
AIM: Apply 3x3 average filter over a given image without using inbuilt Matlab
commands

PART D ​(Assignment)
AIM: Apply filter over given noisy images and identify which filter perform
better without affecting the original image data much

Note​: Images will be sent on the respective experiment day and need to submit
the result within 2 days

You might also like