Mid Term CV Lab
Mid Term CV Lab
Lab Manual 7CAI4-22 (Computer Vision Lab) SKIT, Ramnagaria, Jagatpura, Jaipur
List of Experiments
Implementing various basic image processing operations in Python/Matlab/open-CV:
Beyond Syllabus:
1. Implementation of image restoring techniques
2. Implementation of Image Intensity slicing technique for image enhancement
3. Canny edge detection Algorithm
Lab Manual 7CAI4-22 (Computer Vision Lab) SKIT, Ramnagaria, Jagatpura, Jaipur
Objective
The primary aim of this course is to provide essential and hands-on knowledge about computer
vision components and to cultivate the necessary skills for image processing, applicable both in
industry and research settings.
Key objectives of the course include:
1. Introducing fundamental terminology, technology, and its practical applications.
2. Exploring the concept of image processing and its essential operations.
3. Familiarizing students with Matlab, a versatile tool for image-related operations.
4. Introducing various datasets available on different platforms, widely used for analysis in
the field of image processing.
5. Guiding students in the practical implementation of image processing techniques using
both online and offline image datasets.
By the end of this course, students will be equipped with a solid foundation in computer vision,
image processing techniques, and the practical tools required for success in this field.
Course Outcomes
After completion of this course, students will be able to –
7CAI4-22.1 Explain the concept and Application of image processing for computer vision.
7CAI4-22.1 Implement and Analyze the Fourier transform for filtering the image.
7CAI4-22.1 Design an Image processing application project using YOLO Model online
datasets.
Experiment – 1
Aim: Reading images, writing image, conversion of images, and complementing of an image.
Reading an Image
To import an image from any supported graphics image file format, in any of the supported
bit depths, use the imread function.
Syntax
A = imread(filename,fmt)
Description
A = imread(filename,fmt) reads a greyscale or color image from the file specified by the
string filename, where the string fmt specifies the format of the file. If the file is not in the
current directory or in a directory in the MATLAB path, specify the full pathname of the
location on your system.
Display An Image
To display iamge, use the imshow function.
Syntax
imshow(A)
Description
imshow(A) displays the image stored in array A.
Syntax
imwrite(A,filename,fmt)
Lab Manual 7CAI4-22 (Computer Vision Lab) SKIT, Ramnagaria, Jagatpura, Jaipur
Syntax
imwrite(A,filename,fmt)
Example:
a=imread('pout.tif');
imwrite(a,gray(256),'b.bmp');
imshow('b.bmp')% imshow is used to display image
c =240
a=imread('pout.tif');
[r,c]=size(a);
for i=1:1:r
k=1;
for j=c:-1:1
temp=a(i,k);
result(i,k)=a(i,j);
result(i,j)=temp;
k=k+1;
end
end
Lab Manual 7CAI4-22 (Computer Vision Lab) SKIT, Ramnagaria, Jagatpura, Jaipur
subplot(1,2,1),imshow(a)
subplot(1,2,2),imshow(result)
TASK 1
Write a MATLAB code that reads a gray scale image and generates the flipped image of original
iamge. Your output should be like the one given below
Lab Manual 7CAI4-22 (Computer Vision Lab) SKIT, Ramnagaria, Jagatpura, Jaipur
******************************************************************
TASK 2
Write a MATLAB code that will do the following
1. Read any grayscale image.
2. Display that image.
3. Again display the image such that the pixels having intensity values below than 50 will display
as black and pixels having intensity values above than 150 will display as white. And the pixels
between these will display as it is.
8
Lab Manual 7CAI4-22 (Computer Vision Lab) SKIT, Ramnagaria, Jagatpura, Jaipur
Experiment – 2
% Image Enhancement
I=imread('cancercell.jpg');
subplot(4,2,1); imshow(I); title('Original Image');
g=rgb2gray(I);
subplot(4,2,5); imshow(g); title('Gray Image');
J=imadjust(g,[0.3 0.7],[]);
subplot(4,2,3); imshow(J); title('Enhanced Image');
m=histeq(g);
subplot(4,2,6); imshow(m); title('Equalized Image');
subplot(4,2,8); imhist(m); title('Histogram of Equalized
Image');
9
Lab Manual 7CAI4-22 (Computer Vision Lab) SKIT, Ramnagaria, Jagatpura, Jaipur
10
Lab Manual 7CAI4-22 (Computer Vision Lab) SKIT, Ramnagaria, Jagatpura, Jaipur
Experiment – 3
% Read an image
originalImage = imread('example.jpg'); % Replace 'example.jpg' with your image file
11
Lab Manual 7CAI4-22 (Computer Vision Lab) SKIT, Ramnagaria, Jagatpura, Jaipur
12
Lab Manual 7CAI4-22 (Computer Vision Lab) SKIT, Ramnagaria, Jagatpura, Jaipur
Original Image:
13
Lab Manual 7CAI4-22 (Computer Vision Lab) SKIT, Ramnagaria, Jagatpura, Jaipur
14
Lab Manual 7CAI4-22 (Computer Vision Lab) SKIT, Ramnagaria, Jagatpura, Jaipur
VISION (SKIT)
“To Promote Higher Learning in Advanced Technology and Industrial Research to make our
Country a Global Player”
MISSION (SKIT)
“To Promote Quality Education, Training and Research in the field of Engineering by establishing
effective interface with Industry and to encourage Faculty to undertake Industry Sponsored
Projects for Students”
15
Lab Manual 7CAI4-22 (Computer Vision Lab) SKIT, Ramnagaria, Jagatpura, Jaipur
PO1: Engineering knowledge: Apply the knowledge of mathematics, science, engineering fundamentals,
and an engineering specialization to the solution of complex engineering problems.
PO2: Problem analysis: Identify, formulate, research literature, and analyze complex engineering problems
reaching substantiated conclusions using first principles of mathematics, natural sciences, and engineering
sciences.
PO3: Design/development of solutions: Design solutions for complex engineering problems and design
system components or processes that meet the specified needs with appropriate consideration for the public
health and safety, and the cultural, societal, and environmental considerations.
PO4: Conduct investigations of complex problems: Use research-based knowledge and research methods
including design of experiments, analysis and interpretation of data, and synthesis of the information to
16
Lab Manual 7CAI4-22 (Computer Vision Lab) SKIT, Ramnagaria, Jagatpura, Jaipur
PO5: Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities with an
understanding of the limitations.
PO6: The engineer and society: Apply reasoning informed by the contextual knowledge to assess societal,
health, safety, legal and cultural issues and the consequent responsibilities relevant to the professional
engineering practice.
PO7: Environment and sustainability: Understand the impact of the professional engineering solutions in
societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable
development.
PO8: Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of
the engineering practice.
PO9: Individual and teamwork: Function effectively as an individual, and as a member or leader in diverse
teams, and in multidisciplinary settings.
PO10: Communication: Communicate effectively on complex engineering activities with the engineering
community and with society at large, such as, being able to comprehend and write effective reports and
design documentation, make effective presentations, and give and receive clear instructions.
PO11: Project management and finance: Demonstrate knowledge and understanding of the engineering
and management principles and apply these to one’s own work, as a member and leader in a team, to manage
projects and in multidisciplinary environments.
PO12: Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.
PSO2: Graduates will demonstrate an ability to design, develop, test, debug, deploy, analyze, troubleshoot,
maintain, manage and secure the software.
PSO3: Graduates will possess the knowledge of institutions / organizations / companies related to computer
science & engineering.
17