[Exercises]
[Workspace]
Purpose:
The purpose of this lab is to experiment with designing
custom frequency domain filters, or masks, for filtering coherent
noise.
Activities:
-
Read image $DIP/data/barcode.kdf and display it. Use
operators
User defined and
Display Image.
-
Glyphs:Input/Output:Data Files:
User defined
-
Glyphs:Visualization:Non-Interactive Display:
Display Image
-
Take the forward Fourier transform (scale by 1/sqrt(N)) determine
its log(mag+1) magnitude spectrum and display it. Use
operators
FFT,
Magnitudes, and
Edit Image.
-
Glyphs:Arithmetic:Linear Transforms:
FFT
-
Glyphs:Arithmetic:Complex Operators:
Magnitudes
-
Glyphs:Visualization:Interactive Display:
Edit Image
-
Create the frequency filter image.
-
Move the mouse cursor over the magnitude spectrum of the image to
determine the coordinates of the "stars" (coherent noise).
-
Applying a colormap may help visualize the points this can be found
under the "Options:Colormaps" button in
Edit Image. The "Disjoint"
and "HSV Rings" colormaps are good choices.
-
You can to use the "Print Pixels" option in
Edit Image to verify
the positions of the maximum pixels.
-
Use the
Display Zoom Image option to determine the diameter needed for the
masks.
-
If you want to cheat, coordinates of the "stars" are given at the
end of the lab.
-
Using the operators
Constant,
Circle Image, and
Inset, create
a frequency mask that is the same size as the original image. Note:
the mask should have value "zero" to cancel the "stars", and the rest
of the pixel values should be set to 1. Why? Select and appropriate
diameter for the "zero-out" pattern. When creating the circle image,
use the
Expand and
Display Image operators to verify it.
-
Glyphs:Khoros 1:Generate Data:
Circle Image
-
Glyphs:Data Manip:Size & Region Operators:
Expand
-
Glyphs:Visualization:Non-Interactive Display:
Display Image
-
Glyphs:Input/Output:Generate Data:
Constant
-
Glyphs:Data Manip:Size & Region Operators:
Inset
-
When using the
Inset operators to inset the circles into the
background, set the offset parameters so that the center of the circle
corresponds to the center of the star.
-
Display the resulting mask image using the
Display Image
Operator
-
Multiply your mask with the DFT of the original image using
the
Multiply operator. Use the
Autocolor operator with "HSV Rings"
selected to enhance the result of the multiplication before displaying
it with the
Display Image operator.
-
Glyphs:Arithmetic:Two Operand Arithmetic:
Multiply
-
Glyphs:Visualization:Map Display & Manip:
Autocolor
-
Glyphs:Visualization:Non-Interactive Display:
Display Image
-
Take the inverse Fourier transform (scale by 1/sqrt(N)), determine
the magnitude spectrum [sqrt(real**2 + imaginary**2)], and display the
result. Use operators
FFT,
Magnitudes, and
Display Image.
-
Glyphs:Arithmetic:Linear Transforms:
FFT
-
Glyphs:Arithmetic:Complex Operators:
Magnitudes
-
Glyphs:Visualization:Non-Interactive Display:
Display Image
-
Determine the absolute difference of the two images and display the
result using operators
Absolute Diff and
Display Image.
-
Glyphs:Arithmetic:Two Operand Arithmetic:
Absolute Diff
-
Glyphs:Visualization:Non-Interactive Display:
Display Image
"Star" Coordinates: To help save time in Step 3, the center
coordinates of the bigger stars are given below.
Quadrant 1
(11, 10)
(8, 101)
(27, 84)
(48, 68)
(88, 34)
(108, 17)
Quadrant 2
(168, 94)
(188, 77)
(208, 60)
(228, 44)
(248, 27)
(244, 118)
Quadrant 3
(12, 138)
(8, 229)
(28, 212)
(48, 196)
(68, 179)
(88, 162)
Quadrant 4
(148, 239)
(168, 222)
(208, 188)
(228, 172)
(248, 155)
(244, 246)
Exercises
-
Perform the same experiment with different diameters of the
"zero-out" patterns.
Khoros Workspace
Execute the visual program c5s8barcode-filter.wk
Main DIP Menu
DIP Feedback Form
Copyright © 1997-1995 KRI, ISTEC, Ramiro Jordán, Roberto Lotufo. All Rights Reserved