[Exercises]
[Workspace]
Purpose:
The purpose of this lab exercise is to experiment with linear
convolution in the spatial and frequency domains.
Activities:
-
Read the image $DIP/data/gull.kdf, reduce it to 1/2 its size
(shrink), zero pad it to 256x256 and display it. Use the following
operators:
User defined,
Shrink,
Pad, and
Display Image.
-
Glyphs:Input/Output:Data Files:
User defined
-
Glyphs:Data Manip:Size & Region Operators:
Shrink
-
Glyphs:Data Manip:Size & Region Operators:
Pad
-
Glyphs:Visualization:Non-Interactive Display:
Display Image
-
Read the Laplacian convolution kernel, $DIP/data/laplacian.ascii,
and zero pad it to the same dimensions as
the input image, using
User defined and
Pad operators. Print the values
of the original kernel using the
Print Data and
File Viewer
operators. The kernel is stored as a 3x3 matrix in ASCII, and can be
read automatically by Khoros operators (therefore, it is not necessary
to use a import operator to read it).
-
Glyphs:Input/Output:Data Files:
User defined
-
Glyphs:Input/Output:Information:
Print Data
-
Glyphs:Input/Output:Information:
File Viewer
-
Glyphs:Data Manip:Size & Region Operators:
Pad
-
Take the forward Fourier transform of both the image and the zero
padded kernel, and multiply the results. Now take the inverse Fourier
transform, extract the real part, and display the result. This is
convolution in the frequency domain. Use the
FFT,
Multiply,
Real Part
and
Display Image operators.
-
Glyphs:Arithmetic:Linear Transforms:
FFT
-
Glyphs:Arithmetic:Two Operand Arithmetic:
Multiply
-
Glyphs:Arithmetic:Complex Operators:
Real Part
-
Glyphs:Visualization:Non-Interactive Display:
Display Image
-
Perform the spatial domain convolution of the Laplacian kernel with
the shrink/padded image, and display the result. Use operators
LinearOp (Linear Operator)
and
Display Image.
-
Glyphs:Arithmetic:Linear Transforms:
LinearOp (Linear Operator)
-
Glyphs:Visualization:Non-Interactive Display:
Display Image
-
Take the absolute difference between the results obtained by
convolving in the frequency domain and by convolving in the spatial
domain. Determine the maximum difference between these two methods
using the
Statistics operator.
-
Glyphs:Arithmetic:Two Operand Arithmetic:
Absolute Diff
-
Glyphs:Visualization:Non-Interactive Display:
Display Image
-
Glyphs:Data Manip:Analysis & Information:
Statistics
-
Glyphs:Input/Output:Information:
File Viewer
Exercises
-
Suggest another method for performing linear convolution where the
output dimensions are the same as the original input image.
-
Perform the same experiment but with different kernels (low pass,
high pass).
-
What happens if no zero padding is performed?
-
Experiment with different images.
Khoros Workspace
Execute the visual program c6s3convolution-fft.wk
Main DIP Menu
DIP Feedback Form
Copyright © 1997-1995 KRI, ISTEC, Ramiro Jordán, Roberto Lotufo. All Rights Reserved