[Exercises]
[Workspace]
Purpose:
The purpose of this lab exercise is to overlay a binary
annotation image onto a grey-level image using three different
methods: union (or maximum), bitwise XOR, and gating.
Activities:
-
Build a "zoomed" image for overlaying a grid of numbers into.
-
Use two Piecewise Linear operators to generate images of size
9x9 with pixel values ranging from 0 to 1.
-
Glyphs:Khoros 1:Generate Data:Piecewise Linear
-
Open the Piecewise Linear operator and set the following parameters:
Period: 9
Rise Time: 4
Fall Time: 4
Pulse Width: 0
For one image, generate a pattern in the width direction, and for
the other image, generate the pattern in the height direction. Make sure
that the Sampling Freq parameter is set to 1.
-
Multiply these images together using the Multiply operator.
-
Glyphs:Arithmetic:Two Operand Arithmetic:Multiply
-
Normalize the image from 0 to 255 using the Normalize
operator. Convert the image to unsigned byte.
-
Expand the image by a factor of 18 in the width dimension and
13 in the height dimension. These factors were chosen so that this
image will exactly match with the annotated numbers in the file
$DIP/data/numbers.pbm.
-
Glyphs:Data Manip:Size & Region Operators:Expand
-
Display the image
-
Overlay the binary annotations onto the zoomed image that you
created in Part 1.
-
Select and display the $DIP/data/numbers.pbm image. Use
operators User defined and Display Image. Verify if the pixel data type
of the image is bit using the Data Object Info and File Viewer
operators. If that is the case, it is necessary to convert the image
to unsigned byte and normalize it between 0 and 255 using the
Normalize operator.
-
Glyphs:Input/Output:Data Files:User defined
-
Glyphs:Visualization:Non-Interactive Display:Display Image
-
Glyphs:Input/Output:Information:Data Object Info
-
Glyphs:Input/Output:Information:File Viewer
-
Glyphs:Data Manip:Data Conversion:Normalize
-
Take the union of the image created in Step 1 and the numbers
image, using the Maximum operator. Display the result.
-
Glyphs:Arithmetic:Two Operand Arithmetic:Maximum
-
Apply the bitwise XOR operator to the same two images and
display the result.
-
Glyphs:Arithmetic:Bitwise Operators:XOR
-
Apply the Gate Data operator to create an image where the
overlay numbers are all visible, and display the result. This
requires an additional processing step.
-
Add the constant value of 128 to the zoomed image and display
the result. Note that there is overflow in this operation. In this
case the overflow effect is desired.
-
Glyphs:Arithmetic:Two Operand Arithmetic:Add
-
Using the Gate Data operator, combine the zoomed image from
Part 1 (as "Input 1"), the image you just created (as "Input 2"), and
the numbers image as the "Gating Input".
-
Glyphs:Arithmetc:Two Operand Arithmetic:Gate Data
-
Compare the results from parts B, C, and D.
Exercises
-
Combine the gray-level zoomed image with colored numbers? You can
use the technique explained in a lesson ahead called "Color Image
Composing".
Khoros Workspace
Execute the visual program c3s4combine-zoom-number.wk
Main DIP Menu
DIP Feedback Form
Copyright © 1997-1995 KRI, ISTEC, Ramiro Jordán, Roberto Lotufo. All Rights Reserved