SlideShare a Scribd company logo
1 of 11
COMPUTER GRAPHICS AND
IMAGE PROCESSING
Assignment of Lab
Abstract
A complete practiceand a well-defined documentation of the tasks thatare to be performed as
an assignment
Name: M AMIR FAROOQ
RegistrationNo. 2014-CS-03
Submitted To: MAM URSOOSA
1
Assignment of Computer Graphics & Image Processing (Lab)
Question # 9
Sobel Operators
Answer
Command: img =imread('E:hello.jpg','jpg');
figure(1),imshow(img);
filter1=[-1 -2 -1;0 0 0;1 2 1];
filter2=[-1 0 1;-2 0 2;-1 0 1];
res1=imfilter(img,filter1);
figure(2),imshow(res1);
res2=imfilter(img,filter2);
figure(3),imshow(res2);
figure(4),imshow(res1+res2);
Output:
2
Question # 10
Prewitt Operators
Answer
Command: img=imread('E:hello.jpg','jpg');
figure(1),imshow(img);
filter1=[-1 -1 -1;0 0 0;1 1 1]
filter2=[-1 0 1;-1 0 1;-1 0 1]
res1=imfilter(img,filter1);
figure(2),imshow(res1);
res2=imfilter(img,filter2);
figure(3),imshow(res2);
figure(4),imshow(res1+res2);
Output:
3
Question # 11
Guassian Filter
Answer
Command: img=imread('E:hello.jpg','jpg');
figure(1),imshow(img);
filter1=fspecial('gaussian',[7 7],2)
res=imfilter(img,filter1);
figure(2),imshow(res)
Output:
4
Question # 12
Median Filter
Answer
Command: img=imread('E:hello.jpg','jpg');
figure(1),imshow(img);
res=imnoise(img,'salt & pepper',0.01);
figure(2),imshow(res)
figure(3),imshow(medfilt2(temp));
Output:
Question # 13
Average Filter
Answer
Command: img=imread('E:hello.jpg','jpg');
figure(1),imshow(img);
temp1=fspecial('average',[7 7]);
figure(2),imshow(imfilter(img,temp1));
5
Output:
Question # 14
Laplacian Filter
Answer
Command: img=imread('E:hello.jpg','jpg');
figure(1),imshow(img);
a=fspecial('laplacian');
figure(2),imshow(imfilter(img,a));
Output:
6
Question # 15
Robert Opertor
Answer
Command: img=imread('E:hello.jpg','jpg');
figure(1),imshow(img);
temp1=[-1 0;0 -1];
temp2=[0 1;-1 0];
res1=imfilter(img,temp1);
figure(2),imshow(res1);
res2=imfilter(img,temp2);
figure(3),imshow(res2);
figure(4),imshow(res1+res2);
Output:
Q 16: Low Pass Filter
7
Thisfilterisusedforsmoothinginfrequencydomain.
Code:
img=imread('E:hello.jpg','jpg');
img1=rgb2gray(img);
filt=[11 1
1 1 1
1 1 1]/9
image=imfilter(img1,filt);
filtered_img=img1-image;
subplot(1,2,1),imshow(img1);title('Orignal Image');
subplot(1,2,2),imshow(filtered_img);title('LowPassFilter');
Q 17: HighPass Filter
Code:
img=imread('E:hello.png','png');
img1=rgb2gray(img);
8
filt=[11 1
1 1 1
1 1 1]/9;
image=imfilter(img1,filt);
filtered_img=2*img1-image;
subplot(1,2,1),imshow(img1);title('Orignal Image');
subplot(1,2,2),imshow(filtered_img);title('After ApplyingHighPassFilter');
Q 18: HighBoost Filter
Code:
img=imread('E:hello.jpg,',jpg');
img1=rgb2gray(img);
filt=[11 1
1 1 1
1 1 1]/9;
image=imfilter(img1,filt);
9
filtered_img=2*img1-image;
subplot(1,2,1),imshow(b);title('OrignalImage');
subplot(1,2,2),imshow(filtered_img);title('HighBoostImage');
Q 19: Horizental and Vertical Edges Using Prewitt Filter
Code:
img=imread('C:UsersAppleDesktop1','jpg');
img1=rgb2gray(img);
edges_of_image=edge(img1,'prewitt');
subplot(1,2,1)
imshow(img1);title('Orignal Image');
subplot(1,2,2),
10
imshow(edges_of_image);title('Horizental &Vertical Edges');

More Related Content

Similar to Manual of image processing lab

CE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdfCE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdfUmarMustafa13
 
Introduction to image contrast and enhancement method
Introduction to image contrast and enhancement methodIntroduction to image contrast and enhancement method
Introduction to image contrast and enhancement methodAbhishekvb
 
Python 03-parameters-graphics.pptx
Python 03-parameters-graphics.pptxPython 03-parameters-graphics.pptx
Python 03-parameters-graphics.pptxTseChris
 
Denis Sergienko "Pip install driven deep learning"
Denis Sergienko "Pip install driven deep learning"Denis Sergienko "Pip install driven deep learning"
Denis Sergienko "Pip install driven deep learning"Fwdays
 
License Plate Recognition System
License Plate Recognition System License Plate Recognition System
License Plate Recognition System Hira Rizvi
 
"Quantum" performance effects
"Quantum" performance effects"Quantum" performance effects
"Quantum" performance effectsSergey Kuksenko
 
29-kashyap-mask-detaction.pptx
29-kashyap-mask-detaction.pptx29-kashyap-mask-detaction.pptx
29-kashyap-mask-detaction.pptxKASHYAPPATHAK7
 
Application of recursive perturbation approach for multimodal optimization
Application of recursive perturbation approach for multimodal optimizationApplication of recursive perturbation approach for multimodal optimization
Application of recursive perturbation approach for multimodal optimizationPranamesh Chakraborty
 
CE344L-200365-Lab8.pdf
CE344L-200365-Lab8.pdfCE344L-200365-Lab8.pdf
CE344L-200365-Lab8.pdfUmarMustafa13
 
Eugene Khvedchenya. State of the art Image Augmentations with Albumentations.
Eugene Khvedchenya. State of the art Image Augmentations with Albumentations.Eugene Khvedchenya. State of the art Image Augmentations with Albumentations.
Eugene Khvedchenya. State of the art Image Augmentations with Albumentations.Lviv Startup Club
 
Computer graphics
Computer graphics Computer graphics
Computer graphics shafiq sangi
 
Need helping adding to the code below to plot the images from the firs.pdf
Need helping adding to the code below to plot the images from the firs.pdfNeed helping adding to the code below to plot the images from the firs.pdf
Need helping adding to the code below to plot the images from the firs.pdfactexerode
 
project_final_seminar
project_final_seminarproject_final_seminar
project_final_seminarMUKUL BICHKAR
 
AIML4 CNN lab256 1hr (111-1).pdf
AIML4 CNN lab256 1hr (111-1).pdfAIML4 CNN lab256 1hr (111-1).pdf
AIML4 CNN lab256 1hr (111-1).pdfssuserb4d806
 
An Illustrative Approach to Use SQL Functions: A Review
An Illustrative Approach to Use SQL Functions: A ReviewAn Illustrative Approach to Use SQL Functions: A Review
An Illustrative Approach to Use SQL Functions: A ReviewIJEACS
 

Similar to Manual of image processing lab (20)

CE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdfCE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdf
 
Introduction to image contrast and enhancement method
Introduction to image contrast and enhancement methodIntroduction to image contrast and enhancement method
Introduction to image contrast and enhancement method
 
Python 03-parameters-graphics.pptx
Python 03-parameters-graphics.pptxPython 03-parameters-graphics.pptx
Python 03-parameters-graphics.pptx
 
Dip 1
Dip 1Dip 1
Dip 1
 
Denis Sergienko "Pip install driven deep learning"
Denis Sergienko "Pip install driven deep learning"Denis Sergienko "Pip install driven deep learning"
Denis Sergienko "Pip install driven deep learning"
 
License Plate Recognition System
License Plate Recognition System License Plate Recognition System
License Plate Recognition System
 
"Quantum" performance effects
"Quantum" performance effects"Quantum" performance effects
"Quantum" performance effects
 
29-kashyap-mask-detaction.pptx
29-kashyap-mask-detaction.pptx29-kashyap-mask-detaction.pptx
29-kashyap-mask-detaction.pptx
 
CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017
CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017
CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017
 
Application of recursive perturbation approach for multimodal optimization
Application of recursive perturbation approach for multimodal optimizationApplication of recursive perturbation approach for multimodal optimization
Application of recursive perturbation approach for multimodal optimization
 
Advanced Concepts in Python
Advanced Concepts in PythonAdvanced Concepts in Python
Advanced Concepts in Python
 
Quiz 9 cp_sol
Quiz 9 cp_solQuiz 9 cp_sol
Quiz 9 cp_sol
 
CE344L-200365-Lab8.pdf
CE344L-200365-Lab8.pdfCE344L-200365-Lab8.pdf
CE344L-200365-Lab8.pdf
 
Eugene Khvedchenya. State of the art Image Augmentations with Albumentations.
Eugene Khvedchenya. State of the art Image Augmentations with Albumentations.Eugene Khvedchenya. State of the art Image Augmentations with Albumentations.
Eugene Khvedchenya. State of the art Image Augmentations with Albumentations.
 
matlab.docx
matlab.docxmatlab.docx
matlab.docx
 
Computer graphics
Computer graphics Computer graphics
Computer graphics
 
Need helping adding to the code below to plot the images from the firs.pdf
Need helping adding to the code below to plot the images from the firs.pdfNeed helping adding to the code below to plot the images from the firs.pdf
Need helping adding to the code below to plot the images from the firs.pdf
 
project_final_seminar
project_final_seminarproject_final_seminar
project_final_seminar
 
AIML4 CNN lab256 1hr (111-1).pdf
AIML4 CNN lab256 1hr (111-1).pdfAIML4 CNN lab256 1hr (111-1).pdf
AIML4 CNN lab256 1hr (111-1).pdf
 
An Illustrative Approach to Use SQL Functions: A Review
An Illustrative Approach to Use SQL Functions: A ReviewAn Illustrative Approach to Use SQL Functions: A Review
An Illustrative Approach to Use SQL Functions: A Review
 

More from maamir farooq (20)

Ooad lab1
Ooad lab1Ooad lab1
Ooad lab1
 
Lesson 03
Lesson 03Lesson 03
Lesson 03
 
Lesson 02
Lesson 02Lesson 02
Lesson 02
 
Php client libray
Php client librayPhp client libray
Php client libray
 
Swiftmailer
SwiftmailerSwiftmailer
Swiftmailer
 
Lect15
Lect15Lect15
Lect15
 
Lec 7
Lec 7Lec 7
Lec 7
 
Lec 6
Lec 6Lec 6
Lec 6
 
Lec 5
Lec 5Lec 5
Lec 5
 
J query 1.7 cheat sheet
J query 1.7 cheat sheetJ query 1.7 cheat sheet
J query 1.7 cheat sheet
 
Assignment
AssignmentAssignment
Assignment
 
Java script summary
Java script summaryJava script summary
Java script summary
 
Lec 3
Lec 3Lec 3
Lec 3
 
Lec 2
Lec 2Lec 2
Lec 2
 
Lec 1
Lec 1Lec 1
Lec 1
 
Css summary
Css summaryCss summary
Css summary
 
Session management
Session managementSession management
Session management
 
Data management
Data managementData management
Data management
 
Content provider
Content providerContent provider
Content provider
 
Android sq lite database tutorial
Android sq lite database tutorialAndroid sq lite database tutorial
Android sq lite database tutorial
 

Recently uploaded

MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 

Recently uploaded (20)

MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 

Manual of image processing lab

  • 1. COMPUTER GRAPHICS AND IMAGE PROCESSING Assignment of Lab Abstract A complete practiceand a well-defined documentation of the tasks thatare to be performed as an assignment Name: M AMIR FAROOQ RegistrationNo. 2014-CS-03 Submitted To: MAM URSOOSA
  • 2. 1 Assignment of Computer Graphics & Image Processing (Lab) Question # 9 Sobel Operators Answer Command: img =imread('E:hello.jpg','jpg'); figure(1),imshow(img); filter1=[-1 -2 -1;0 0 0;1 2 1]; filter2=[-1 0 1;-2 0 2;-1 0 1]; res1=imfilter(img,filter1); figure(2),imshow(res1); res2=imfilter(img,filter2); figure(3),imshow(res2); figure(4),imshow(res1+res2); Output:
  • 3. 2 Question # 10 Prewitt Operators Answer Command: img=imread('E:hello.jpg','jpg'); figure(1),imshow(img); filter1=[-1 -1 -1;0 0 0;1 1 1] filter2=[-1 0 1;-1 0 1;-1 0 1] res1=imfilter(img,filter1); figure(2),imshow(res1); res2=imfilter(img,filter2); figure(3),imshow(res2); figure(4),imshow(res1+res2); Output:
  • 4. 3 Question # 11 Guassian Filter Answer Command: img=imread('E:hello.jpg','jpg'); figure(1),imshow(img); filter1=fspecial('gaussian',[7 7],2) res=imfilter(img,filter1); figure(2),imshow(res) Output:
  • 5. 4 Question # 12 Median Filter Answer Command: img=imread('E:hello.jpg','jpg'); figure(1),imshow(img); res=imnoise(img,'salt & pepper',0.01); figure(2),imshow(res) figure(3),imshow(medfilt2(temp)); Output: Question # 13 Average Filter Answer Command: img=imread('E:hello.jpg','jpg'); figure(1),imshow(img); temp1=fspecial('average',[7 7]); figure(2),imshow(imfilter(img,temp1));
  • 6. 5 Output: Question # 14 Laplacian Filter Answer Command: img=imread('E:hello.jpg','jpg'); figure(1),imshow(img); a=fspecial('laplacian'); figure(2),imshow(imfilter(img,a)); Output:
  • 7. 6 Question # 15 Robert Opertor Answer Command: img=imread('E:hello.jpg','jpg'); figure(1),imshow(img); temp1=[-1 0;0 -1]; temp2=[0 1;-1 0]; res1=imfilter(img,temp1); figure(2),imshow(res1); res2=imfilter(img,temp2); figure(3),imshow(res2); figure(4),imshow(res1+res2); Output: Q 16: Low Pass Filter
  • 8. 7 Thisfilterisusedforsmoothinginfrequencydomain. Code: img=imread('E:hello.jpg','jpg'); img1=rgb2gray(img); filt=[11 1 1 1 1 1 1 1]/9 image=imfilter(img1,filt); filtered_img=img1-image; subplot(1,2,1),imshow(img1);title('Orignal Image'); subplot(1,2,2),imshow(filtered_img);title('LowPassFilter'); Q 17: HighPass Filter Code: img=imread('E:hello.png','png'); img1=rgb2gray(img);
  • 9. 8 filt=[11 1 1 1 1 1 1 1]/9; image=imfilter(img1,filt); filtered_img=2*img1-image; subplot(1,2,1),imshow(img1);title('Orignal Image'); subplot(1,2,2),imshow(filtered_img);title('After ApplyingHighPassFilter'); Q 18: HighBoost Filter Code: img=imread('E:hello.jpg,',jpg'); img1=rgb2gray(img); filt=[11 1 1 1 1 1 1 1]/9; image=imfilter(img1,filt);
  • 10. 9 filtered_img=2*img1-image; subplot(1,2,1),imshow(b);title('OrignalImage'); subplot(1,2,2),imshow(filtered_img);title('HighBoostImage'); Q 19: Horizental and Vertical Edges Using Prewitt Filter Code: img=imread('C:UsersAppleDesktop1','jpg'); img1=rgb2gray(img); edges_of_image=edge(img1,'prewitt'); subplot(1,2,1) imshow(img1);title('Orignal Image'); subplot(1,2,2),