SlideShare a Scribd company logo
1 of 16
1 of 6
LAB 5: IMAGE FILTERING
ECE180: Introduction to Signal Processing
OVERVIEW
You have recently learned about the convolution sum that
serves as the basis of the FIR filter difference equation. The
filter
coefficient sequence {ļæ½ļæ½} ā€“ equivalent to the filterā€™s impulse
response ā„Ž[ļæ½] ā€“ may be viewed as a one-dimensional moving
window that slides over the input signal ļæ½[ļæ½] to compute the
output signal ļæ½[ļæ½] at each time step. Extending the moving
window concept to a 2-D array that slides over an image pixel
array provides a useful and popular way to filter an image.
In this lab project you will implement two types of moving-
window image filters, one based on convolution and the other
based on the median value of the pixel grayscale values spanned
by the window. You will also gain experience with the
built-in image convolution filter imfilter.
OUTLINE
3. Evaluate the median and convolution filters to reduce noise
while preserving edges
for smoothing, edge detection, and sharpening
5. Learn how to use imfilter to convolution-filter color images,
and study the various mechanisms offered by
imfilter to deal with boundary effects
PREPARATION ā€“ TO BE COMPLETED BEFORE LAB
Study these tutorial videos:
1. Nested ā€œforā€ loops -- http://youtu.be/q2xfz8mOuSI?t=1m8s
(review this part)
2. Functions -- http://youtu.be/0zTmMIh6I8A (review as
needed)
Ensure that you have added the ECE180 DFS folders to your
MATLAB path, especially the ā€œimagesā€ and ā€œmatlabā€
subfolders.
Follow along with the tutorial video
http://youtu.be/MEqUd0dJNBA, if necessary.
LAB ACTIVITIES
1.1. Implement the following algorithm as the function med3x3:
TIP: First implement and debug the algorithm as a script and
then convert it to a function as a final step. Use any
of the smaller grayscale images from the ECE180 ā€œimagesā€
folder as you develop the function, or use the test
image X described in the Step 1.2.
(a) Create the function template and save it to an .m file with
the same name as the function,
(b) Accept a grayscale image x as the function input,
http://youtu.be/q2xfz8mOuSI?t=1m8s
http://youtu.be/0zTmMIh6I8A
http://youtu.be/MEqUd0dJNBA
2 of 6
(c) Copy x to the output image y and then initialize y(:) to zero;
this technique creates y as the same size and
data type as x,
(d) Determine the number of image rows and columns (see
size),
(e) Loop over all pixels in image x (subject to boundary limits):
pixel,
-D array to a 1-D array,
-D array values (see sort),
output pixel, and
(f) Return the median-filtered image y.
1.2. Enter load lab_5_verify to load the .mat file that contains
the test images X and Ymed3x3. Compare your
functionā€™s output image with the expected output image:
isequal(med3x3(X), Ymed3x3)
A ā€œ1ā€ result indicates that your function produces the correct
result at every pixel, otherwise you need to keep
debugging your function.
text.
2.1. Implement the following algorithm as the function
conv3x3:
(a) Accept a grayscale image x and the convolution kernel h (a
development purposes use h=ones(3)/3^2,
(b) Convert x to the ā€œdoubleā€ datatype (see double),
(c) Allocate space for the output image y with zero initial value,
(d) Determine the dimensions of the image x,
(e) Loop over all pixels in image x (subject to boundary limits):
pixel,
-D subarray by the kernel h,
-D array to a 1-D array ,
he 1-D array values to a single value and assign this to
the current output pixel (see sum),
(f) Convert y back to the ā€œunsigned 8-bit integerā€ datatype (see
uint8), and
(g) Return the convolution-filtered image y.
2.2. The .mat file you loaded in Step 1.2 also contains the
output image Yconv3x3. Compare your functionā€™s output
image with the expected output image:
isequal(conv3x3(X,ones(3)/3^2), Yconv3x3)
Your function works properly when you see ā€œ1ā€ as a result,
otherwise you need to keep debugging your function.
text.
3 of 6
-window filters:
The two filters you developed can be used to remove, or at least
reduce, the amount of noise in an image. Ideally noise
removal will not blur image edges, i.e., the grayscale
discontinuities that help us to recognize features in the image.
3.1. Create a new script for this part, and then load and display
one of the test patterns developed by the Society of
Motion Picture and Television Engineers (SMPTE, pronounced
ā€œsimp-teeā€):
tp=imread('smpte.png'); imshow(tp)
3.2. Create a copy of the test pattern that includes Gaussian
noise:
tpn=imnoise(tp,'gaussian',0,0.01); figure, imshow(tpn)
3.3. Apply your median filter to tpn to create tpnm. Display the
noisy image and filtered image side by side:
imshowpair(tpn,tpnm,'montage')
filter.
3.5. Create a convolution kernel array h to perform the average
h=ones(3)/3^2
3.6. Apply your averaging filter to tpn to create tpnc. Display
the noisy image and filtered image side by side as you
did earlier with imshowpair.
lay window for the averaging
filter.
filter and the averaging filter in terms of reducing
noise and preserving edges for Gaussian noise; when you
ā€œcompare and contrastā€ two processing techniques you
discuss what is similar and what is different about the two
methods. Use the ā€œZoom Inā€ tool on the figure
windows to study the noise and edges in more detail.
3.9. Repeat Steps 3.1 through 3.9 using ā€œsalt and pepper noise,ā€
a disturbance that causes random isolated pixels to
be set either to full white or full black:
tpn=imnoise(tp,'salt & pepper',0.02);
filter.
convolution filter.
filter and the convolution filter in terms of reducing
noise and preserving edges for salt-and-pepper noise. Remember
to use the ā€œZoom Inā€ tool to study the noise,
edges, and other features.
4 of 6
image processing. In this section you will study the effects
kernels.
4.1. Develop a script to load the ā€œcameraā€ image from a file,
define the desired kernel as a string constant (e.g.,
kernel='average'), select a kernel array with a switch statement,
and then display the original image and
the convolved image side by side; use conv3x3 as before. Use
the kernel name as the figure title, i.e,
title(kernel,'FontSize',16). The switch statement will select from
among the following kernels:
average
[
1 1 1
1 1 1
1 1 1
] Ɨ
1
9
hedges
[
āˆ’1 0 1
āˆ’1 0 1
āˆ’1 0 1
]
vedges
[
āˆ’1 āˆ’1 āˆ’1
0 0 0
1 1 1
]
edges
[
āˆ’1 āˆ’1 āˆ’1
āˆ’1 8 āˆ’1
āˆ’1 āˆ’1 āˆ’1
]
Laplacian
[
0 āˆ’1 0
āˆ’1 4 āˆ’1
0 āˆ’1 0
]
sharpen
[
0 āˆ’1 0
āˆ’1 5 āˆ’1
0 āˆ’1 0
]
pass
[
0 0 0
0 1 0
0 0 0
]
Enter the kernel as a 3x3 matrix using line continuation, e.g.,
enter the Laplacian kernel like this:
h = [ 0 -1 0; ...
-1 4 -1; ...
0 -1 0];
4.2. For each kernel, screenclip your image input/output pair
and then write some comments about its effect on the
processed image:
ā€“ note that hedges is a type of edge detector, can
you determine the meaning of the ā€œhā€
in the name? Also, what happens to the constant-intensity areas
of the image?
ā€“ how does this compare to the hedges kernel,
and what might the ā€œvā€ signify?
ā€“ compare this result to the hedges and vedges
kernels.
ā€“ compare to edges.
ā€“ this kernel can be considered as a combination
of two of the other kernels; which are
the two, and how are they combined? How might this explain
the visual appearance of the processed
image? Try the ā€œZoom Inā€ tool in the area of an edge.
5 of 6
5. Learn how to use imfilter:
MATLAB includes the function imfilter that operates just like
your conv3x3 filter but with extended capabilities
for arbitrary window sizes, several options to deal with
boundary effects, and the ability to work with color images.
Note that imfilter can also work directly with the uint8 data
type.
5.1. Create a new script for this part. Develop a code fragment
to create the ā€œpass-throughā€ kernel of an arbitrary size
of NxN elements that are all zero except for a single ā€œ1ā€ in the
center of the kernel. Assume that N will always be
chosen as an odd number.
code for N = 3, 5, and 7. (To save space, run the
command format compact before producing your output.)
5.2. Load the ā€œparrotsā€ image as variable x, display the image,
-through kernel h, and then apply
this kernel to the image:
imshow(imfilter(x,h))
Expect to see the original image; can you explain why?
of avoiding the boundary as you did with
conv3x3. You can adjust how imfilter deals with the boundary,
but begin with the 'full' option to cause
imfilter to show the original image and the values that it
assumes are outside the limits of the input image
based on the size of the kernel; the image you see is larger than
the original image:
imshow(imfilter(x,h,'full'))
Explain what you see; what numerical value is assumed? If in
doubt on the value, click the ā€œData Cursorā€ tool on
the figure and then click on the image.
the assumed values can sometimes cause
erager:
avg=ones(41)/41^2;
imshow(imfilter(x,avg,'full'))
and then try reverting back to the default output style which is
the same size as the input image:
imshow(imfilter(x,avg))
Explain what you see, recalling that this kernel computes the
average value of all the pixels in the 2-D moving
window.
the image as an infinitely repeating (periodic)
image:
imshow(imfilter(x,h,'full','circular'))
Now try the averaging kernel again where the output image is
the same size as the input:
imshow(imfilter(x,avg,'full','circular'))
What is your opinion of this choice for boundary handling, at
least for the ā€œparrotsā€ image? What would have to
be true about an image for 'circular' to be a good choice?
the previous step:
imshow(imfilter(x,h,'full','replicate'))
and then
imshow(imfilter(x,avg,'replicate'))
Explain how the 'replicate' option creates pixel values beyond
the limits of the original image. How do the
6 of 6
results compare to the 'circular' method? Do you think that
'replicate' gives better results at the
boundaries?
two ways as before:
imshow(imfilter(x,h,'full','symmetric'))
and then
imshow(imfilter(x,avg,'symmetric'))
Explain how the 'symmetric' option creates pixel values outside
the limits of the original image. Try the
averaging kernel again; how do the results compare to the
previous methods? Which method of the four available
methods do you think would be the best choice for most
images?
uses imfilter instead of conv3x3. Try all of
n the ā€œparrotā€ image. Pick your favorite
result, screenclip your input/output image results, state
the kernel you used, and explain what appeals to you about this
result.
6. Wrap Up:
projects for the term! Please comment on your
comfort level with MATLAB. Does any aspect of MATLAB
programming remain particularly unclear or confusing? If
so, please elaborate.
ā€œLab 5 _ Firstname Lastname.docxā€ and then submit
it to Turnitin by the end of the lab period today.

More Related Content

Similar to Image Filtering Lab: Implement Median and Convolution Filters

00463517b1e90c1e63000000
00463517b1e90c1e6300000000463517b1e90c1e63000000
00463517b1e90c1e63000000Ivonne Liu
Ā 
Image processing
Image processingImage processing
Image processingmaheshpene
Ā 
Image processing with matlab
Image processing with matlabImage processing with matlab
Image processing with matlabAman Gupta
Ā 
Online Signal Processing Assignment Help
Online Signal Processing Assignment HelpOnline Signal Processing Assignment Help
Online Signal Processing Assignment HelpMatlab Assignment Experts
Ā 
Introduction to Image Processing with MATLAB
Introduction to Image Processing with MATLABIntroduction to Image Processing with MATLAB
Introduction to Image Processing with MATLABSriram Emarose
Ā 
Edge detection iOS application
Edge detection iOS applicationEdge detection iOS application
Edge detection iOS applicationKetan Raval
Ā 
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
Ā 
Image processing with matlab
Image processing with matlabImage processing with matlab
Image processing with matlabminhtaispkt
Ā 
The method of comparing two image files
 The method of comparing two image files The method of comparing two image files
The method of comparing two image filesMinh Anh Nguyen
Ā 
The method of comparing two image files
The method of comparing two image filesThe method of comparing two image files
The method of comparing two image filesMinh Anh Nguyen
Ā 
Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Ganesan Narayanasamy
Ā 
Translation Invariance (TI) based Novel Approach for better De-noising of Dig...
Translation Invariance (TI) based Novel Approach for better De-noising of Dig...Translation Invariance (TI) based Novel Approach for better De-noising of Dig...
Translation Invariance (TI) based Novel Approach for better De-noising of Dig...IRJET Journal
Ā 
Ų§Ł„ŁˆŲ³Ų§Ų¦Ų· Ų§Ł„Ł…ŲŖŲ¹ŲÆŲÆŲ© Multimedia ŲŖŲ§Ų¬
Ų§Ł„ŁˆŲ³Ų§Ų¦Ų· Ų§Ł„Ł…ŲŖŲ¹ŲÆŲÆŲ©  Multimedia ŲŖŲ§Ų¬Ų§Ł„ŁˆŲ³Ų§Ų¦Ų· Ų§Ł„Ł…ŲŖŲ¹ŲÆŲÆŲ©  Multimedia ŲŖŲ§Ų¬
Ų§Ł„ŁˆŲ³Ų§Ų¦Ų· Ų§Ł„Ł…ŲŖŲ¹ŲÆŲÆŲ© Multimedia ŲŖŲ§Ų¬maaz hamed
Ā 
A computer vision approach to speech enhancement
A computer vision approach to speech enhancementA computer vision approach to speech enhancement
A computer vision approach to speech enhancementRamin Anushiravani
Ā 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image ProcessingAnkur Nanda
Ā 
Image De-Noising Using Deep Neural Network
Image De-Noising Using Deep Neural NetworkImage De-Noising Using Deep Neural Network
Image De-Noising Using Deep Neural Networkaciijournal
Ā 

Similar to Image Filtering Lab: Implement Median and Convolution Filters (20)

00463517b1e90c1e63000000
00463517b1e90c1e6300000000463517b1e90c1e63000000
00463517b1e90c1e63000000
Ā 
Himadeep
HimadeepHimadeep
Himadeep
Ā 
Image processing
Image processingImage processing
Image processing
Ā 
Image processing with matlab
Image processing with matlabImage processing with matlab
Image processing with matlab
Ā 
Online Signal Processing Assignment Help
Online Signal Processing Assignment HelpOnline Signal Processing Assignment Help
Online Signal Processing Assignment Help
Ā 
Introduction to Image Processing with MATLAB
Introduction to Image Processing with MATLABIntroduction to Image Processing with MATLAB
Introduction to Image Processing with MATLAB
Ā 
Edge detection iOS application
Edge detection iOS applicationEdge detection iOS application
Edge detection iOS application
Ā 
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
Ā 
Image processing with matlab
Image processing with matlabImage processing with matlab
Image processing with matlab
Ā 
The method of comparing two image files
 The method of comparing two image files The method of comparing two image files
The method of comparing two image files
Ā 
The method of comparing two image files
The method of comparing two image filesThe method of comparing two image files
The method of comparing two image files
Ā 
Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117
Ā 
Translation Invariance (TI) based Novel Approach for better De-noising of Dig...
Translation Invariance (TI) based Novel Approach for better De-noising of Dig...Translation Invariance (TI) based Novel Approach for better De-noising of Dig...
Translation Invariance (TI) based Novel Approach for better De-noising of Dig...
Ā 
Ų§Ł„ŁˆŲ³Ų§Ų¦Ų· Ų§Ł„Ł…ŲŖŲ¹ŲÆŲÆŲ© Multimedia ŲŖŲ§Ų¬
Ų§Ł„ŁˆŲ³Ų§Ų¦Ų· Ų§Ł„Ł…ŲŖŲ¹ŲÆŲÆŲ©  Multimedia ŲŖŲ§Ų¬Ų§Ł„ŁˆŲ³Ų§Ų¦Ų· Ų§Ł„Ł…ŲŖŲ¹ŲÆŲÆŲ©  Multimedia ŲŖŲ§Ų¬
Ų§Ł„ŁˆŲ³Ų§Ų¦Ų· Ų§Ł„Ł…ŲŖŲ¹ŲÆŲÆŲ© Multimedia ŲŖŲ§Ų¬
Ā 
CNN_AH.pptx
CNN_AH.pptxCNN_AH.pptx
CNN_AH.pptx
Ā 
CNN_AH.pptx
CNN_AH.pptxCNN_AH.pptx
CNN_AH.pptx
Ā 
A computer vision approach to speech enhancement
A computer vision approach to speech enhancementA computer vision approach to speech enhancement
A computer vision approach to speech enhancement
Ā 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
Ā 
Image De-Noising Using Deep Neural Network
Image De-Noising Using Deep Neural NetworkImage De-Noising Using Deep Neural Network
Image De-Noising Using Deep Neural Network
Ā 
B070306010
B070306010B070306010
B070306010
Ā 

More from mercysuttle

1 QuestionĀ Information refinement means taking the system requi.docx
1 QuestionĀ Information refinement means taking the system requi.docx1 QuestionĀ Information refinement means taking the system requi.docx
1 QuestionĀ Information refinement means taking the system requi.docxmercysuttle
Ā 
1 pageApaSourcesDiscuss how an organizationā€™s marketing i.docx
1 pageApaSourcesDiscuss how an organizationā€™s marketing i.docx1 pageApaSourcesDiscuss how an organizationā€™s marketing i.docx
1 pageApaSourcesDiscuss how an organizationā€™s marketing i.docxmercysuttle
Ā 
1 R120V11Vac0Vdc R2100VC13mE.docx
1 R120V11Vac0Vdc R2100VC13mE.docx1 R120V11Vac0Vdc R2100VC13mE.docx
1 R120V11Vac0Vdc R2100VC13mE.docxmercysuttle
Ā 
1 PSYC499SeniorCapstoneTheImpactoftheSocial.docx
1 PSYC499SeniorCapstoneTheImpactoftheSocial.docx1 PSYC499SeniorCapstoneTheImpactoftheSocial.docx
1 PSYC499SeniorCapstoneTheImpactoftheSocial.docxmercysuttle
Ā 
1 Politicking is less likely in organizations that haveĀ· adecl.docx
1 Politicking is less likely in organizations that haveĀ· adecl.docx1 Politicking is less likely in organizations that haveĀ· adecl.docx
1 Politicking is less likely in organizations that haveĀ· adecl.docxmercysuttle
Ā 
1 page2 sourcesReflect on the important performance management.docx
1 page2 sourcesReflect on the important performance management.docx1 page2 sourcesReflect on the important performance management.docx
1 page2 sourcesReflect on the important performance management.docxmercysuttle
Ā 
1 of 402.5 PointsUse Cramerā€™s Rule to solve the following syst.docx
1 of 402.5 PointsUse Cramerā€™s Rule to solve the following syst.docx1 of 402.5 PointsUse Cramerā€™s Rule to solve the following syst.docx
1 of 402.5 PointsUse Cramerā€™s Rule to solve the following syst.docxmercysuttle
Ā 
1 Objectives Genetically transform bacteria with for.docx
1 Objectives Genetically transform bacteria with for.docx1 Objectives Genetically transform bacteria with for.docx
1 Objectives Genetically transform bacteria with for.docxmercysuttle
Ā 
1 of 8 Student name ā€¦ā€¦ā€¦ā€¦ā€¦. St.docx
1 of 8 Student name ā€¦ā€¦ā€¦ā€¦ā€¦.               St.docx1 of 8 Student name ā€¦ā€¦ā€¦ā€¦ā€¦.               St.docx
1 of 8 Student name ā€¦ā€¦ā€¦ā€¦ā€¦. St.docxmercysuttle
Ā 
1 MATH 106 QUIZ 4 Due b.docx
1 MATH 106 QUIZ 4                                 Due b.docx1 MATH 106 QUIZ 4                                 Due b.docx
1 MATH 106 QUIZ 4 Due b.docxmercysuttle
Ā 
1 MN6003 Levis Strauss Case Adapted from Does Levi St.docx
1 MN6003 Levis Strauss Case Adapted from Does Levi St.docx1 MN6003 Levis Strauss Case Adapted from Does Levi St.docx
1 MN6003 Levis Strauss Case Adapted from Does Levi St.docxmercysuttle
Ā 
1 NAME__________________ EXAM 1 Directi.docx
1 NAME__________________ EXAM 1  Directi.docx1 NAME__________________ EXAM 1  Directi.docx
1 NAME__________________ EXAM 1 Directi.docxmercysuttle
Ā 
1 Name .docx
1 Name                                                 .docx1 Name                                                 .docx
1 Name .docxmercysuttle
Ā 
1 pageapasources2Third Party LogisticsBriefly describe .docx
1 pageapasources2Third Party LogisticsBriefly describe .docx1 pageapasources2Third Party LogisticsBriefly describe .docx
1 pageapasources2Third Party LogisticsBriefly describe .docxmercysuttle
Ā 
1 Pageapasources2Review the Food Environment Atlas maps for.docx
1 Pageapasources2Review the Food Environment Atlas maps for.docx1 Pageapasources2Review the Food Environment Atlas maps for.docx
1 Pageapasources2Review the Food Environment Atlas maps for.docxmercysuttle
Ā 
1 Lab 3 Newtonā€™s Second Law of Motion Introducti.docx
1 Lab 3 Newtonā€™s Second Law of Motion  Introducti.docx1 Lab 3 Newtonā€™s Second Law of Motion  Introducti.docx
1 Lab 3 Newtonā€™s Second Law of Motion Introducti.docxmercysuttle
Ā 
1 Marks 2 A person can be prosecuted for both an attempt and .docx
1 Marks 2 A person can be prosecuted for both an attempt and .docx1 Marks 2 A person can be prosecuted for both an attempt and .docx
1 Marks 2 A person can be prosecuted for both an attempt and .docxmercysuttle
Ā 
1 Marks 1 Post Traumatic Stress Disorder (PTSD)Choose one .docx
1 Marks 1 Post Traumatic Stress Disorder (PTSD)Choose one .docx1 Marks 1 Post Traumatic Stress Disorder (PTSD)Choose one .docx
1 Marks 1 Post Traumatic Stress Disorder (PTSD)Choose one .docxmercysuttle
Ā 
1 List of Acceptable Primary Resources for the Week 3 .docx
1 List of Acceptable Primary Resources for the Week 3 .docx1 List of Acceptable Primary Resources for the Week 3 .docx
1 List of Acceptable Primary Resources for the Week 3 .docxmercysuttle
Ā 
1 of 1 DOCUMENTSouth China Morning PostJune 11, 2007 M.docx
1 of 1 DOCUMENTSouth China Morning PostJune 11, 2007 M.docx1 of 1 DOCUMENTSouth China Morning PostJune 11, 2007 M.docx
1 of 1 DOCUMENTSouth China Morning PostJune 11, 2007 M.docxmercysuttle
Ā 

More from mercysuttle (20)

1 QuestionĀ Information refinement means taking the system requi.docx
1 QuestionĀ Information refinement means taking the system requi.docx1 QuestionĀ Information refinement means taking the system requi.docx
1 QuestionĀ Information refinement means taking the system requi.docx
Ā 
1 pageApaSourcesDiscuss how an organizationā€™s marketing i.docx
1 pageApaSourcesDiscuss how an organizationā€™s marketing i.docx1 pageApaSourcesDiscuss how an organizationā€™s marketing i.docx
1 pageApaSourcesDiscuss how an organizationā€™s marketing i.docx
Ā 
1 R120V11Vac0Vdc R2100VC13mE.docx
1 R120V11Vac0Vdc R2100VC13mE.docx1 R120V11Vac0Vdc R2100VC13mE.docx
1 R120V11Vac0Vdc R2100VC13mE.docx
Ā 
1 PSYC499SeniorCapstoneTheImpactoftheSocial.docx
1 PSYC499SeniorCapstoneTheImpactoftheSocial.docx1 PSYC499SeniorCapstoneTheImpactoftheSocial.docx
1 PSYC499SeniorCapstoneTheImpactoftheSocial.docx
Ā 
1 Politicking is less likely in organizations that haveĀ· adecl.docx
1 Politicking is less likely in organizations that haveĀ· adecl.docx1 Politicking is less likely in organizations that haveĀ· adecl.docx
1 Politicking is less likely in organizations that haveĀ· adecl.docx
Ā 
1 page2 sourcesReflect on the important performance management.docx
1 page2 sourcesReflect on the important performance management.docx1 page2 sourcesReflect on the important performance management.docx
1 page2 sourcesReflect on the important performance management.docx
Ā 
1 of 402.5 PointsUse Cramerā€™s Rule to solve the following syst.docx
1 of 402.5 PointsUse Cramerā€™s Rule to solve the following syst.docx1 of 402.5 PointsUse Cramerā€™s Rule to solve the following syst.docx
1 of 402.5 PointsUse Cramerā€™s Rule to solve the following syst.docx
Ā 
1 Objectives Genetically transform bacteria with for.docx
1 Objectives Genetically transform bacteria with for.docx1 Objectives Genetically transform bacteria with for.docx
1 Objectives Genetically transform bacteria with for.docx
Ā 
1 of 8 Student name ā€¦ā€¦ā€¦ā€¦ā€¦. St.docx
1 of 8 Student name ā€¦ā€¦ā€¦ā€¦ā€¦.               St.docx1 of 8 Student name ā€¦ā€¦ā€¦ā€¦ā€¦.               St.docx
1 of 8 Student name ā€¦ā€¦ā€¦ā€¦ā€¦. St.docx
Ā 
1 MATH 106 QUIZ 4 Due b.docx
1 MATH 106 QUIZ 4                                 Due b.docx1 MATH 106 QUIZ 4                                 Due b.docx
1 MATH 106 QUIZ 4 Due b.docx
Ā 
1 MN6003 Levis Strauss Case Adapted from Does Levi St.docx
1 MN6003 Levis Strauss Case Adapted from Does Levi St.docx1 MN6003 Levis Strauss Case Adapted from Does Levi St.docx
1 MN6003 Levis Strauss Case Adapted from Does Levi St.docx
Ā 
1 NAME__________________ EXAM 1 Directi.docx
1 NAME__________________ EXAM 1  Directi.docx1 NAME__________________ EXAM 1  Directi.docx
1 NAME__________________ EXAM 1 Directi.docx
Ā 
1 Name .docx
1 Name                                                 .docx1 Name                                                 .docx
1 Name .docx
Ā 
1 pageapasources2Third Party LogisticsBriefly describe .docx
1 pageapasources2Third Party LogisticsBriefly describe .docx1 pageapasources2Third Party LogisticsBriefly describe .docx
1 pageapasources2Third Party LogisticsBriefly describe .docx
Ā 
1 Pageapasources2Review the Food Environment Atlas maps for.docx
1 Pageapasources2Review the Food Environment Atlas maps for.docx1 Pageapasources2Review the Food Environment Atlas maps for.docx
1 Pageapasources2Review the Food Environment Atlas maps for.docx
Ā 
1 Lab 3 Newtonā€™s Second Law of Motion Introducti.docx
1 Lab 3 Newtonā€™s Second Law of Motion  Introducti.docx1 Lab 3 Newtonā€™s Second Law of Motion  Introducti.docx
1 Lab 3 Newtonā€™s Second Law of Motion Introducti.docx
Ā 
1 Marks 2 A person can be prosecuted for both an attempt and .docx
1 Marks 2 A person can be prosecuted for both an attempt and .docx1 Marks 2 A person can be prosecuted for both an attempt and .docx
1 Marks 2 A person can be prosecuted for both an attempt and .docx
Ā 
1 Marks 1 Post Traumatic Stress Disorder (PTSD)Choose one .docx
1 Marks 1 Post Traumatic Stress Disorder (PTSD)Choose one .docx1 Marks 1 Post Traumatic Stress Disorder (PTSD)Choose one .docx
1 Marks 1 Post Traumatic Stress Disorder (PTSD)Choose one .docx
Ā 
1 List of Acceptable Primary Resources for the Week 3 .docx
1 List of Acceptable Primary Resources for the Week 3 .docx1 List of Acceptable Primary Resources for the Week 3 .docx
1 List of Acceptable Primary Resources for the Week 3 .docx
Ā 
1 of 1 DOCUMENTSouth China Morning PostJune 11, 2007 M.docx
1 of 1 DOCUMENTSouth China Morning PostJune 11, 2007 M.docx1 of 1 DOCUMENTSouth China Morning PostJune 11, 2007 M.docx
1 of 1 DOCUMENTSouth China Morning PostJune 11, 2007 M.docx
Ā 

Recently uploaded

Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
Ā 
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
Ā 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
Ā 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
Ā 
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
Ā 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)Dr. Mazin Mohamed alkathiri
Ā 
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
Ā 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
Ā 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
Ā 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
Ā 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
Ā 
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
Ā 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
Ā 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
Ā 
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
Ā 
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
Ā 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
Ā 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
Ā 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
Ā 

Recently uploaded (20)

Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
Ā 
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
Ā 
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
Ā 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Ā 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
Ā 
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
Ā 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
Ā 
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
Ā 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
Ā 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
Ā 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
Ā 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
Ā 
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
Ā 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
Ā 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
Ā 
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
Ā 
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
Ā 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
Ā 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
Ā 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
Ā 

Image Filtering Lab: Implement Median and Convolution Filters

  • 1. 1 of 6 LAB 5: IMAGE FILTERING ECE180: Introduction to Signal Processing OVERVIEW You have recently learned about the convolution sum that serves as the basis of the FIR filter difference equation. The filter coefficient sequence {ļæ½ļæ½} ā€“ equivalent to the filterā€™s impulse response ā„Ž[ļæ½] ā€“ may be viewed as a one-dimensional moving window that slides over the input signal ļæ½[ļæ½] to compute the output signal ļæ½[ļæ½] at each time step. Extending the moving window concept to a 2-D array that slides over an image pixel array provides a useful and popular way to filter an image. In this lab project you will implement two types of moving- window image filters, one based on convolution and the other based on the median value of the pixel grayscale values spanned by the window. You will also gain experience with the built-in image convolution filter imfilter. OUTLINE
  • 2. 3. Evaluate the median and convolution filters to reduce noise while preserving edges for smoothing, edge detection, and sharpening 5. Learn how to use imfilter to convolution-filter color images, and study the various mechanisms offered by imfilter to deal with boundary effects PREPARATION ā€“ TO BE COMPLETED BEFORE LAB Study these tutorial videos: 1. Nested ā€œforā€ loops -- http://youtu.be/q2xfz8mOuSI?t=1m8s (review this part) 2. Functions -- http://youtu.be/0zTmMIh6I8A (review as needed) Ensure that you have added the ECE180 DFS folders to your MATLAB path, especially the ā€œimagesā€ and ā€œmatlabā€ subfolders. Follow along with the tutorial video http://youtu.be/MEqUd0dJNBA, if necessary. LAB ACTIVITIES 1.1. Implement the following algorithm as the function med3x3: TIP: First implement and debug the algorithm as a script and then convert it to a function as a final step. Use any
  • 3. of the smaller grayscale images from the ECE180 ā€œimagesā€ folder as you develop the function, or use the test image X described in the Step 1.2. (a) Create the function template and save it to an .m file with the same name as the function, (b) Accept a grayscale image x as the function input, http://youtu.be/q2xfz8mOuSI?t=1m8s http://youtu.be/0zTmMIh6I8A http://youtu.be/MEqUd0dJNBA 2 of 6 (c) Copy x to the output image y and then initialize y(:) to zero; this technique creates y as the same size and data type as x, (d) Determine the number of image rows and columns (see size), (e) Loop over all pixels in image x (subject to boundary limits): pixel, -D array to a 1-D array, -D array values (see sort),
  • 4. output pixel, and (f) Return the median-filtered image y. 1.2. Enter load lab_5_verify to load the .mat file that contains the test images X and Ymed3x3. Compare your functionā€™s output image with the expected output image: isequal(med3x3(X), Ymed3x3) A ā€œ1ā€ result indicates that your function produces the correct result at every pixel, otherwise you need to keep debugging your function. text. 2.1. Implement the following algorithm as the function conv3x3: (a) Accept a grayscale image x and the convolution kernel h (a development purposes use h=ones(3)/3^2, (b) Convert x to the ā€œdoubleā€ datatype (see double), (c) Allocate space for the output image y with zero initial value,
  • 5. (d) Determine the dimensions of the image x, (e) Loop over all pixels in image x (subject to boundary limits): pixel, -D subarray by the kernel h, -D array to a 1-D array , he 1-D array values to a single value and assign this to the current output pixel (see sum), (f) Convert y back to the ā€œunsigned 8-bit integerā€ datatype (see uint8), and (g) Return the convolution-filtered image y. 2.2. The .mat file you loaded in Step 1.2 also contains the output image Yconv3x3. Compare your functionā€™s output image with the expected output image: isequal(conv3x3(X,ones(3)/3^2), Yconv3x3) Your function works properly when you see ā€œ1ā€ as a result, otherwise you need to keep debugging your function. text.
  • 6. 3 of 6 -window filters: The two filters you developed can be used to remove, or at least reduce, the amount of noise in an image. Ideally noise removal will not blur image edges, i.e., the grayscale discontinuities that help us to recognize features in the image. 3.1. Create a new script for this part, and then load and display one of the test patterns developed by the Society of Motion Picture and Television Engineers (SMPTE, pronounced ā€œsimp-teeā€): tp=imread('smpte.png'); imshow(tp) 3.2. Create a copy of the test pattern that includes Gaussian noise: tpn=imnoise(tp,'gaussian',0,0.01); figure, imshow(tpn) 3.3. Apply your median filter to tpn to create tpnm. Display the noisy image and filtered image side by side: imshowpair(tpn,tpnm,'montage') filter. 3.5. Create a convolution kernel array h to perform the average
  • 7. h=ones(3)/3^2 3.6. Apply your averaging filter to tpn to create tpnc. Display the noisy image and filtered image side by side as you did earlier with imshowpair. lay window for the averaging filter. filter and the averaging filter in terms of reducing noise and preserving edges for Gaussian noise; when you ā€œcompare and contrastā€ two processing techniques you discuss what is similar and what is different about the two methods. Use the ā€œZoom Inā€ tool on the figure windows to study the noise and edges in more detail. 3.9. Repeat Steps 3.1 through 3.9 using ā€œsalt and pepper noise,ā€ a disturbance that causes random isolated pixels to be set either to full white or full black: tpn=imnoise(tp,'salt & pepper',0.02); filter. convolution filter. filter and the convolution filter in terms of reducing noise and preserving edges for salt-and-pepper noise. Remember
  • 8. to use the ā€œZoom Inā€ tool to study the noise, edges, and other features. 4 of 6 image processing. In this section you will study the effects kernels. 4.1. Develop a script to load the ā€œcameraā€ image from a file, define the desired kernel as a string constant (e.g., kernel='average'), select a kernel array with a switch statement, and then display the original image and the convolved image side by side; use conv3x3 as before. Use the kernel name as the figure title, i.e, title(kernel,'FontSize',16). The switch statement will select from among the following kernels: average [
  • 9. 1 1 1 1 1 1 1 1 1 ] Ɨ 1 9 hedges [ āˆ’1 0 1 āˆ’1 0 1 āˆ’1 0 1 ] vedges [ āˆ’1 āˆ’1 āˆ’1 0 0 0 1 1 1 ] edges
  • 10. [ āˆ’1 āˆ’1 āˆ’1 āˆ’1 8 āˆ’1 āˆ’1 āˆ’1 āˆ’1 ] Laplacian [ 0 āˆ’1 0 āˆ’1 4 āˆ’1 0 āˆ’1 0 ] sharpen [ 0 āˆ’1 0 āˆ’1 5 āˆ’1 0 āˆ’1 0 ] pass [
  • 11. 0 0 0 0 1 0 0 0 0 ] Enter the kernel as a 3x3 matrix using line continuation, e.g., enter the Laplacian kernel like this: h = [ 0 -1 0; ... -1 4 -1; ... 0 -1 0]; 4.2. For each kernel, screenclip your image input/output pair and then write some comments about its effect on the processed image: ā€“ note that hedges is a type of edge detector, can you determine the meaning of the ā€œhā€ in the name? Also, what happens to the constant-intensity areas of the image? ā€“ how does this compare to the hedges kernel, and what might the ā€œvā€ signify? ā€“ compare this result to the hedges and vedges kernels.
  • 12. ā€“ compare to edges. ā€“ this kernel can be considered as a combination of two of the other kernels; which are the two, and how are they combined? How might this explain the visual appearance of the processed image? Try the ā€œZoom Inā€ tool in the area of an edge. 5 of 6 5. Learn how to use imfilter: MATLAB includes the function imfilter that operates just like your conv3x3 filter but with extended capabilities for arbitrary window sizes, several options to deal with boundary effects, and the ability to work with color images. Note that imfilter can also work directly with the uint8 data type. 5.1. Create a new script for this part. Develop a code fragment to create the ā€œpass-throughā€ kernel of an arbitrary size of NxN elements that are all zero except for a single ā€œ1ā€ in the center of the kernel. Assume that N will always be chosen as an odd number.
  • 13. code for N = 3, 5, and 7. (To save space, run the command format compact before producing your output.) 5.2. Load the ā€œparrotsā€ image as variable x, display the image, -through kernel h, and then apply this kernel to the image: imshow(imfilter(x,h)) Expect to see the original image; can you explain why? of avoiding the boundary as you did with conv3x3. You can adjust how imfilter deals with the boundary, but begin with the 'full' option to cause imfilter to show the original image and the values that it assumes are outside the limits of the input image based on the size of the kernel; the image you see is larger than the original image: imshow(imfilter(x,h,'full')) Explain what you see; what numerical value is assumed? If in doubt on the value, click the ā€œData Cursorā€ tool on the figure and then click on the image.
  • 14. the assumed values can sometimes cause erager: avg=ones(41)/41^2; imshow(imfilter(x,avg,'full')) and then try reverting back to the default output style which is the same size as the input image: imshow(imfilter(x,avg)) Explain what you see, recalling that this kernel computes the average value of all the pixels in the 2-D moving window. the image as an infinitely repeating (periodic) image: imshow(imfilter(x,h,'full','circular')) Now try the averaging kernel again where the output image is the same size as the input: imshow(imfilter(x,avg,'full','circular')) What is your opinion of this choice for boundary handling, at least for the ā€œparrotsā€ image? What would have to be true about an image for 'circular' to be a good choice?
  • 15. the previous step: imshow(imfilter(x,h,'full','replicate')) and then imshow(imfilter(x,avg,'replicate')) Explain how the 'replicate' option creates pixel values beyond the limits of the original image. How do the 6 of 6 results compare to the 'circular' method? Do you think that 'replicate' gives better results at the boundaries? two ways as before: imshow(imfilter(x,h,'full','symmetric')) and then imshow(imfilter(x,avg,'symmetric')) Explain how the 'symmetric' option creates pixel values outside the limits of the original image. Try the averaging kernel again; how do the results compare to the previous methods? Which method of the four available
  • 16. methods do you think would be the best choice for most images? uses imfilter instead of conv3x3. Try all of n the ā€œparrotā€ image. Pick your favorite result, screenclip your input/output image results, state the kernel you used, and explain what appeals to you about this result. 6. Wrap Up: projects for the term! Please comment on your comfort level with MATLAB. Does any aspect of MATLAB programming remain particularly unclear or confusing? If so, please elaborate. ā€œLab 5 _ Firstname Lastname.docxā€ and then submit it to Turnitin by the end of the lab period today.