Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
196 views

Digital Image Processing File

The document contains a syllabus for a Digital Image Processing theory and practical course offered at Veer Bahadur Singh Purvanchal University, Jaunpur. The theory paper covers topics like image representation, enhancement, restoration, transforms, compression and segmentation across 5 units over 8 lectures each. The practical paper involves 12 suggested MATLAB-based experiments related to image processing concepts and operations. The courses aim to help students understand digital image processing concepts and techniques, and develop the ability to implement various image processing methods.

Uploaded by

Aviral Chaurasia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
196 views

Digital Image Processing File

The document contains a syllabus for a Digital Image Processing theory and practical course offered at Veer Bahadur Singh Purvanchal University, Jaunpur. The theory paper covers topics like image representation, enhancement, restoration, transforms, compression and segmentation across 5 units over 8 lectures each. The practical paper involves 12 suggested MATLAB-based experiments related to image processing concepts and operations. The courses aim to help students understand digital image processing concepts and techniques, and develop the ability to implement various image processing methods.

Uploaded by

Aviral Chaurasia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Veer Bahadur Singh Purvanchal University, Jaunpur

Faculty of Engineering & Technology (UNSIET)


Department of Electronics Engineering

SYLLABUS

FOR

Digital Image Processing


Theory Paper KEC-071
Practical Paper KEC-751A

ODD SEMESTER EXAMINATION

(7th Semester Exam)

Syllabus & Lab Practicals


(Session: 2022-2023)

Department of Electronic & Communication Engineering


Uma Nath Singh Institute of Engineering & Technology
Theory Paper: KEC-071 (DIP)

KEC-071 Digital Image Processing 3L:0T:0P 3 Credits

Unit Topics Lectures


I Introduction: Overview of Image Processing, Application area of image 8
processing, Digital Image Representation, Types of images, Digital Image
Processing Operations, Fundamental steps in DIP, Overview of Digital Image
Systems, Physical Aspect of Image Acquisition, biological Aspect of Image
Acquisition, sampling & quantization, Digital Halftone Process, Image storage
and File formats.
II Image Enhancement: Need for image enhancement, Image enhancement 8
operations, Image enhancement in spatial domain, histogram based techniques,
Spatial Filtering concepts, Image smoothing and sharpening spatial and frequency
domain filters, homomorphic filtering.
Image Restoration: Introduction to degradation, types of Image degradations,
image degradation models, noise modeling, estimation of degradation functions,
Image restoration in presence of noise only, periodic noise and band pass and
band reject filtering, difference between enhancement & restoration, Image
restoration techniques.
III Image Transforms: Need for image transforms, Properties of Fourier transform, 8
Discrete cosine transform, Discrete sine transform, Hadamard transform, Haar
transform, Slant transform, SVD and KL transforms.
IV Image Compression: Image compression model, type of redundancy, 8
compression algorithms and its types, lossless compression algorithms, lossy
compression algorithms, image and video compression standards.
V Image Segmentation: Introduction, Detection of Discontinuities, Edge 8
Detection, Hough Transforms and Shape Detection, corner detection, Principle of
thresholding, Principle of region - growing.
Text Books:
1. Rafael C. Gonzalez Richard E woods Steven L. Eddins, ‘‘Digital Image Processing’’, Mc Graw Hill, 3rd Edition,
2008.
2. Anil K Jain, “Fundamentals of Digital Image Processing”, Prentice-Hall of India Pvt. Ltd, 1989.

Course Outcomes: At the end of this course students will demonstrate the ability to:
1. Describe the concept and need for image processing.
2. Implement the various techniques for image enhancement and restoration both in spatial and frequency domains.
3. Interpret the various types of image transforms and their properties.
4. Distinguish between lossless and lossy image compression algorithms and examine their performances in spatial
and frequency domains.
5. Examine the various image segmentation techniques.
KEC-751A Digital Image Processing Lab 0L:0T:2P 1 Credit

SUGGESTIVE LIST OF EXPERIMENTS:


1. Introduction to MATLAB Image Processing Toolbox.
2. Write a MATLAB program to learn the basic image processing operations.
3. Write a MATLAB program for geometric transformation.
4. Write a MATLAB program for image enhancement using Histogram equalization.
5. Write a MATLAB program to perform smoothing or averaging filter in spatial domain.
6. Write a MATLAB program to perform smoothing or averaging filter in frequency domain.
7. Write a MATLAB program for image restoration.
8. Write a MATLAB program of sharpening of image using gradient mask.
9. Write a MATLAB program for performing morphological operations on the image.
10. Write a MATLAB program to fill the region of interest of the image.
11. Write a MATLAB program for edge detection of an image.

Course Outcomes: At the end of this course students will demonstrate the ability to:
1. Explain image processing operations using MATLAB tool.
2. Evaluate the appropriate methods for image enhancement and image restoration.
3. Formulate spatial and frequency domain filters to obtain better quality image.
4. Select various attributes of image such as texture and edges from the image.
5. Design and develop the applications of transforms such as DCT and wavelet.

SOFTWARE USED: MATLAB by MATHWORKS (2021)


EXPERIMENT NO: 1

AIM:

Introduction to MATLAB Image Processing Toolbox.

APPARATUS REQUIRED:

HARDWARE: Personal Computer


SOFTWARE : MATLAB 7.8

INTRODUCTION TO MATLAB:

• MATLAB is a technical language to ease scientific computations.


• The name is derived from MATrix LABoratory .
• It provides many of the attributes of spreadsheets and programming languages.
• MATLAB is a case sensitive language (a variable named “c” is different than another
one called “C”).
• In interactive mode MATLAB scripts are platform independent (good for cross
platform portability).
• MATLAB works with matrices.
• Everything MATLAB understands is a matrix (from text to large cell arrays and
structure arrays).

BASIC COMPONENTS OF THE MATLAB ENVIRONMENT:

MATLAB has the following basic window components:


• Command Window - to execute commands in the MATLAB environment
• Editor Window – To write program
• Current Directory Window - to quickly access files on the MATLAB path
• Figure Window - to display graphical output from MATLAB code
• Workspace Window - to view variable definitions and variable memory allocations
• Command History Window - displays all commands issued in MATLAB since the last session
(good for learning and verification)
PROCEDURE:

1. Start the MATLAB program.


2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. If any error occurs in the program correct the error and run it again
7. For the output see command window/Figure window
8. Stop the program.
EXPERIMENT NO: 2

AIM:
Write a MATLAB program to learn the basic image processing operations.

APPARATUS REQUIRED:

HARDWARE: Personal Computer


SOFTWARE : MATLAB 7.8
PROCEDURE:
1. Start the MATLAB program.
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. If any error occurs in the program correct the error and run it again
7. For the output see command window/Figure window
8. Stop the program.

PROGRAM: (The basic image processing operations)

%%%%%%%PROGRAM: (The basic image processing operations)

%Program for Reading images


I = imread('vbspu1.png'

%Program for Image display


I = imread('earth1.jpg');
imshow(I)

%Program for Four image in one frame


A=imread('earth1.jpg');
subplot(2,2,1);
imshow(A)
B=imread('earth2.jpg');
subplot(2,2,2);
imshow(B)
C=imread('water1.jpg');
subplot(2,2,3);
imshow(C)
D=imread('water2.jpg');
subplot(2,2,4);
imshow(D)

%Program for Image information


I = imread('earth1.jpg');
imfinfo('earth1.jpg')

%Program for Writing image


I = imread('earth1.jpg');
imwrite(I,'earth1.png')

% Program for Image quality to reduce the resolution of the image


A=imread('nature.jpg');
subplot(2,2,1);imshow(A);title('Original image')
B=double(A);
subplot(2,2,2);imshow(B);title('convert to double')
C=B+5;
subplot(2,2,3);imshow(C);title('High intensity')
D=B-50;
subplot(2,2,4);imshow(D);title('low intensity')

% Program for Histogram


A=imread('nature2.jpg');
figure(1),imhist(A);

% Program for Image sharpening


A=imread('bird.jpg');
imshow(A)
B=imsharpen(A);
figure(1),imshow(B)

RESULT:

Reading Image Image Display Four images in one frame


Image information Writing image Image quality to reduce the
resolution of the image

Image Histogram Image sharpening

Thus the MATLAB program Reading images, Image display, Four image in one frame , Image information
, Writing image , Image quality to reduce the resolution of the image ,Histogram ,Image sharpening using
MATLAB function written and the results were plotted.
EXPERIMENT NO: 3

AIM:
Write a MATLAB program for geometric transformation.

APPARATUS REQUIRED:
HARDWARE: Personal Computer
SOFTWARE: MATLAB 7.8

PROCEDURE:
1. Start the MATLAB program.
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. If any error occurs in the program correct the error and run it again
7. For the output see command window\ Figure window
8. Stop the program.

PROGRAM: (geometric transformation)

I=imread('bird.jpg');
% 2-D affine transformation
tform=affine2d([1 0 0;0.5 1 0;0 0 1]);
J=imwarp(I,tform);
subplot(2,3,1),imshowpair(I,J,"montage");title('2-D affine transformation')
% Rotated image 10 deg
x=10;
tform1=affine2d([cosd(x) -sind(x) 0;sind(x) cosd(x) 0;0 0 1]);
K=imwarp(I,tform1);
subplot(2,3,2),imshowpair(I,K,"montage");title('Rotated image 10 deg')
% translated image
L=imtranslate(I,[330,-180],'FillValues',255);
subplot(2,3,3),imshowpair(I,L,"montage"), title('Translated Image');
% Scaling iamge
magnifiaction=0.5;
M=imresize(I,magnifiaction);
subplot(2,3,4),imshowpair(I,M,method="montage");title('Scaling image');
% Rotated image 45 deg
N=imrotate(I,45,"bilinear");
subplot(2,3,5),imshowpair(I,N,method="montage"),title('Rotated image 45
deg');

RESULT:

Thus the MATLAB program written and the results were plotted.
EXPERIMENT NO: 4

AIM:
Write a MATLAB program for image enhancement using Histogram equalization.

APPARATUS REQUIRED:
HARDWARE: Personal Computer
SOFTWARE: MATLAB 7.8

PROCEDURE:
1. Start the MATLAB program.
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. If any error occurs in the program correct the error and run it again
7. For the output see command window\ Figure window
8. Stop the program.

PROGRAM: (image enhancement using Histogram equalization)

I=imread('nature.jpg');
Ih=histeq(I);
subplot(2,2,1),imshow(I),title('Original Image');
subplot(2,2,2),imshow(Ih),title(' Histogram Equalized Image');
subplot(2,2,3),imhist(I),title('Histogram of Original Image');
subplot(2,2,4),imhist(Ih),title('Histogram of Equalized Image');
Thus the MATLAB program written and the results were plotted.
EXPERIMENT NO: 5

AIM:
Write a MATLAB program to perform smoothing or averaging filter in spatial domain.

APPARATUS REQUIRED:
HARDWARE: Personal Computer
SOFTWARE: MATLAB 7.8
PROCEDURE:
1. Start the MATLAB program.
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. If any error occurs in the program correct the error and run it again
7. For the output see command window\ Figure window
8. Stop the program.

PROGRAM: (perform smoothing or averaging filter in spatial domain)

clc
clear all
close all
%Reading input image for filtering
A=imread('bird.jpg');
%Addition of noise to the input images
B=imnoise(A,'salt & pepper');
C=imnoise(A,'gaussian');
D=imnoise(A,'speckle');
% Defining 3x3 and 5x5 kernel
h1=1/9*ones(3,3);
h2=1/25*ones(5,5);
%Attempting to recover the image
B1=uint8(convn(double(B),h1,'same'));
B2=uint8(convn(double(B),h2,'same'));
C1=uint8(convn(double(C),h1,'same'));
C2=uint8(convn(double(C),h2,'same'));
D1=uint8(convn(double(D),h1,'same'));
D2=uint8(convn(double(D),h2,'same'));
% Display the images
subplot(3,3,1),imshowpair(A,B,"montage"),title('Noisy Image of salt &
pepper');
subplot(3,3,2),imshowpair(B,B1,"montage"),title(' Use of 3x3 Averaging
filter');
subplot(3,3,3),imshowpair(A,B2,"montage"),title('Use of 5x5 Averaging
filter');
subplot(3,3,4),imshowpair(A,C,"montage"),title('Noisy Image of Gaussian');
subplot(3,3,5),imshowpair(C,C1,"montage"),title('Use of 3x3 Averaging
filter');
subplot(3,3,6),imshowpair(C,C2,"montage"),title('Use of 5x5 Averaging
filter');
subplot(3,3,7),imshowpair(A,D,"montage"),title('Noisy Image of speckle');
subplot(3,3,8),imshowpair(D,D1,"montage"),title('Use of 3x3 Averaging
filter');
subplot(3,3,9),imshowpair(D,D2,"montage"),title('Use of 5x5 Averaging
filter');

RESULT:

Thus the MATLAB program written and the results were plotted.
EXPERIMENT NO: 6

AIM:
Write a MATLAB program to perform smoothing or averaging filter in frequency domain.

APPARATUS REQUIRED:
HARDWARE: Personal Computer
SOFTWARE: MATLAB 7.8
PROCEDURE:
1. Start the MATLAB program.
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. If any error occurs in the program correct the error and run it again
7. For the output see command window\ Figure window
8. Stop the program.

PROGRAM:

% read the image


a=imread('bird1.jpg');
subplot(2,3,1),imshow(a),title('input image');
a=rgb2gray(a);
a=im2double(a);
[m,n]=size(a); % size of input image

A=fft2(a);% fourier transform of input image


subplot(2,3,2),imshow(uint8(abs(A))),title('F.T. of I/P without shift');
A_shift=fftshift(A); % shifting origin'
A_real=abs(A_shift); % real part of B_shift
subplot(2,3,3),imshow(uint8(A_real)),title('frequencybdomain image');
DO = 50;
for u=1:m
for v=1:n
d = sqrt((u-m/2).^2+(v-n/2).^2);
H(u,v)=exp(-(d^2)/(2*DO.^2));
end
end
H_low = H.*A_shift;
H_low_real = H.*A_real;
H_low_shift = H.*A_real;
H_low_image = H.*A_real;
subplot(2,3,4),imshow(H),title('Gaussian low pass filter');
subplot(2,3,5),mesh(H),title('surface plot GLPF');
subplot(2,3,6),imshow(abs(H_low_image)),title('Gaussian low pass filtered
image');

RESULT:

Thus, the MATLAB program written and the results were plotted.
EXPERIMENT NO: 7

AIM:
Write a MATLAB program for image restoration.

APPARATUS REQUIRED:
HARDWARE: Personal Computer
SOFTWARE: MATLAB 7.8
PROCEDURE:
1. Start the MATLAB program.
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. If any error occurs in the program correct the error and run it again
7. For the output see command window\ Figure window
8. Stop the program.

PROGRAM:

A=imread('bird1.jpg');
subplot(2,3,1),imshow(uint8(A)),title('Original iamge');
A=double(rgb2gray(A));
[M,N] = size(A);
% degradation function
h = ones(11,11)/121;
% transformation to frequency domain
freq_a = fft2(A);
freq_h = fft2(h,M,N);
% degraded iamge
B = real(ifft2(freq_h.*freq_a))+10*randn(M,N);
% inverse filtering for image restoration
freq_b = fft2(B);
powfreq_a = freq_a.^2/(M*N);
alpha = 0.5;
sigma = sqrt(4*10^(-7));
freq_g = ((freq_h.')').*abs(powfreq_a).....
./(abs(freq_h.^2).*abs(powfreq_a)+alpha*sigma^2);
Res_freq_a = freq_g.*freq_b;
% Restored iamge in spatial domain
Res_a = real(ifft2(Res_freq_a));
% display of output images

subplot(2,3,2),imshow(uint8(B)),title('Degraded image');
subplot(2,3,3),imshow(uint8(Res_a)),title('Restored image after inverse
filtering');

RESULT:

Thus, the MATLAB program written and the results were plotted.
EXPERIMENT NO: 8

AIM:
Write a MATLAB program of sharpening of image using gradient mask.

APPARATUS REQUIRED:
HARDWARE: Personal Computer
SOFTWARE: MATLAB 7.8
PROCEDURE:
1. Start the MATLAB program.
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. If any error occurs in the program correct the error and run it again
7. For the output see command window\ Figure window
8. Stop the program.

PROGRAM: (sharpening of image using gradient mask)

% Program of sharpen image using gradient mask


clc
clear all
close all

% Reading input images


A=imread("moon.tif");

% unsharp masking
H=fspecial('unsharp');
B=imfilter(A,H);

% Display of input and output


subplot(1,3,1),imshow(A),title('Original image');
subplot(1,3,2),imshow(B),title('unsharp masking image');
RESULT:

Thus, the MATLAB program written and the results were plotted.
EXPERIMENT NO: 9

AIM:
Write a MATLAB program for performing morphological operations on the image.
APPARATUS REQUIRED:
HARDWARE: Personal Computer
SOFTWARE: MATLAB 7.8
PROCEDURE:
1. Start the MATLAB program.
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. If any error occurs in the program correct the error and run it again
7. For the output see command window\ Figure window
8. Stop the program.

PROGRAM: (performing morphological operations on the image)

% morphological image processing


clc
clear all
close all
% reading input image
A=imread("moon.tif");
% defining flate structring element
se=strel(ones(3));
% gray scale image dilation
Amax=imdilate(A,se);
% gray scale image erosion
Amin=imerode(A,se);
% subtract the two
Mgrad=Amax-Amin;
% display of image
subplot(2,2,1),imshow(A),title('Original image');
subplot(2,2,2),imshow(A),title('Dilated image');
subplot(2,2,3),imshow(A),title('eroded image');
subplot(2,2,4),imshow(A),title('Gradient image');
RESULT:

Thus the MATLAB program written and the results were plotted.
EXPERIMENT NO: 10

AIM:
Write a MATLAB program to fill the region of interest of the image.

APPARATUS REQUIRED:
HARDWARE: Personal Computer
SOFTWARE: MATLAB 7.8
PROCEDURE:
1. Start the MATLAB program.
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. If any error occurs in the program correct the error and run it again
7. For the output see command window\ Figure window
8. Stop the program.

PROGRAM: (fill the region of interest of the image)

% fill the region of interest of the image


clc
clear all
close all
% reading input image
A=imread("eight.tif");
imshow(A);
B=roipoly;
C=fspecial('average',15);
imshow(roifilt2(C,A,B));
RESULT:

Thus, the MATLAB program written and the results were plotted.
EXPERIMENT NO: 11

AIM:
Write a MATLAB program for edge detection of an image.

APPARATUS REQUIRED:
HARDWARE: Personal Computer
SOFTWARE: MATLAB 7.8
PROCEDURE:
1. Start the MATLAB program.
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. If any error occurs in the program correct the error and run it again
7. For the output see command window\ Figure window
8. Stop the program.

PROGRAM: (edge detection of an image)


% program for edge detection of an image
clear all
close all
% reading input image
A=imread("bird.jpg");
% image in grayscale
X=rgb2gray(A);
% Edge detection
B=edge(X,'roberts');
C=edge(X,'sobel');
D=edge(X,'prewitt');
E=edge(X,'log');
F=edge(X,'canny');
% Display of input & output images
subplot(3,2,1),imshowpair(A,X,"montage");title('Original image')
subplot(3,2,2),imshow(B),title('Edge detection by Roberts operation');
subplot(3,2,3),imshow(C),title('Edge detection by sobel operation');
subplot(3,2,4),imshow(D),title('Edge detection by prewitt operation');
subplot(3,2,5),imshow(E),title('Edge detection by log operation');
subplot(3,2,6),imshow(F),title('Edge detection by canny operation');
RESULT:

Thus, the MATLAB program written and the results were plotted.

You might also like