[Exercises]
[Workspace]
Purpose:
Compare images visually putting them together in a single
image, in the form of mosaic image or frames in a sequence.
Activities:
-
Create a single image for comparison using mosaic image.
-
Use the User defined operator to access the images:
$DIP/data/retina.kdf and $DIP/data/mpicchu.kdf. Put them together
side by side using the Inset operator. Set the parameter
"Width Coordinate" of the Inset operator to 256, which is the width
of the first image, such that the second image is placed at coordinate
w=256 in the first image.
Visualize with Display Image operator. Use the following operators:
-
Glyphs:Input/Output:Data Files:User defined
-
Glyphs:Data Manip:Size & Region Operators:Inset
-
Glyphs:Visualization:Non-Interactive Display:Display Image
-
Making this process more general.
If the width of the first image changes, you have to change the parameter
accordantly. You can use the operators Print Stats to set a
cantata variable to the width of the image. You can find the Print Stats
operator in:
-
Glyphs:Data Manip:Analysis & Information:Print Stats
-
Use the input of the Print Stats operator connected to the first
image which you want to get the width. Set the parameter in
the Print Stats operator to output only the "size attribute width".
The variable associated with it is "width_size. This variable will
be set to the input image width when the glyph is executed.
-
Open the Inset operator and use "width_size" as its parameter
"width coordinate".
-
To make sure that the Inset operator will only executed when the
variable "width_size" is updated, connect the "output control
connection" of the Print Stats gluph to the "input control
connection" of the Inset glyph.
-
Run the workspace
-
Create a single image for comparison using a frames in a sequence.
-
Use the previous User defined operator accessing the previous two images:
$DIP/data/retina.kdf and $DIP/data/mpicchu.kdf and use two
new User defined operators to access the images $DIP/data/ball.kdf
and $DIP/data/gull.kdf. Use the Inset operator,
two by two, setting the attribute "Element Coordinate" to 1 on both
operators, and with these results use another Inset operator setting the
attribute to 2, and visualize the result with the Animate operator
putting the output of the Inset operator in "Input File".
-
Glyphs:Data Manip:Size & Region Operators:Inset
-
Glyphs:Visualization:Interactive Display:Animate
Exercises
-
Repeat the same experiments using a simpler operator which
appends one image to the other. You can select the dimension you
want to append the image. To put the images side-by-side you append
in the "width" dimension and to append in an animation fashion you
select append in the "element" dimension. The Append operator can
be found in:
-
Glyphs:Data Manip:Size & Region Operators:Append
Khoros Workspace
Execute the visual program c2s4compare-visual.wk
Main DIP Menu
DIP Feedback Form
Copyright © 1997-1995 KRI, ISTEC, Ramiro Jordán, Roberto Lotufo. All Rights Reserved