[Exercises]
[Workspace]
Purpose:
The purpose of this lab experiment is to demonstrate the
basic concept of image restoration. In this example, the blurring
function, and therefore, the inverse function, are known.
Activities:
-
Get the float type blurred
image $DIP/data/lenina-blur-float.kdf and display it using the
operators
User defined and
Display Image.
-
Glyphs:Input/Output:Data Files:
User defined
-
Glyphs:Visualization:Non-Interactive Display:
Display Image
-
Take the forward
FFT of the image, use
FFT operator (unity
scaling), and display its spectrum using the
Display Image operator.
-
Glyphs:Arithmetic:Linear Transforms:
FFT
-
Glyphs:Visualization:Non-Interactive Display:
Display Image
-
Read in the blurring kernel, $DIP/data/gauss-kernel-21x1.ascii,
and plot it using the
Display 2D Plot operator. This kernel is a 1D signal,
width = 21.
-
Glyphs:Input/Output:Data Files:
User defined
-
Glyphs:Visualization:Plot Display:
Display 2D Plot
-
Take the forward
FFT of the blurring kernel and display it. First
zero extend it to the size of the blurred image. Use the
Pad
operator and then apply the
FFT.
-
Glyphs:Data Manip:Size & Region Operators:
Pad
-
Glyphs:Arithmetic:Linear Transforms:
FFT
-
Glyphs:Visualization:Non-Interactive Display:
Display Image
-
Find the reciprocal of the kernel DFT using the operator
Divide Into.
Display the DFT of the inverse filter.
-
Glyphs:Arithmetic:Two Operand Arithmetic:
Divide Into
-
Glyphs:Visualization:Non-Interactive Display:
Display Image
-
Multiply the DFT of the blurred image with the inverse filter
using the operator
Multiply. Display the result using the
Display Image
operator.
-
Glyphs:Arithmetic:Two Operand Arithmetic:
Multiply
-
Glyphs:Visualization:Non-Interactive Display:
Display Image
-
Finally, take the inverse DFT of the last result (scale by 1/N),
determine its magnitude using the
Magnitudes operator, and display
the result.
-
Glyphs:Arithmetic:Linear Transforms:
FFT
-
Glyphs:Arithmetic:Complex Operators:
Magnitudes
-
Glyphs:Visualization:Non-Interactive Display:
Display Image
-
Create and save an "Inverse Filtering" Procedure.
-
Select all glyphs except those created in Step 1 (
User defined
and
Display Image). Select the glyphs by placing the mouse
cursor in the workspace, pressing the mouse button, and dragging it
across the workspace to draw a "rubberband" around the glyphs you want
to select. When you release the mouse button, the selected glyphs will
have a dark black border. If not all of the glyphs that you need were
selected, select additional ones by pressing down the "Shift" key,
and while it is depressed, use the mouse to select additional glyphs.
-
Create the procedure by opening the Control:Create Procedure
cantata menu.
-
Change the name of the procedure to "Inverse Filter" by placing
the mouse cursor over the "Procedure" title and clicking. When the
"new Icon Name" form comes up, type in the new procedure name and
select "OK".
-
To save the procedure, delete all the other glyphs, leaving only
the procedure glyph in cantata. Save the workspace with the
File:Save As menu.
-
Clear the workspace for the next lesson.
Khoros Workspace
Execute the visual program c7s1inverse.wk
Main DIP Menu
DIP Feedback Form
Copyright © 1997-1995 KRI, ISTEC, Ramiro Jordán, Roberto Lotufo. All Rights Reserved