[Exercises]
[Workspace]
Purpose:
The purpose of this lab exercise is to demonstrate the effects of pixel overflow.
Activities:
-
Select and display an image with data type unsigned byte (for example, Floating Ball). Use these operators
-
User defined and
-
Glyphs:Visualization:Non-Interactive Display:Display Image
-
increase the level of all pixels by a desired constant, say 80.
Use the operator:
-
Glyphs:Arithmetic:Two Operand Arithmetic:Add
-
Set the "Real Constant" in the Add pane to a value that will increase
the level of all pixels by a desired constant
-
connect the operators, and display the results using Display Image
-
Use a variable in cantata. The parameters in any cantata pane operator
can accept any expression. You can put for instance 40 + 40. It is
also possible to use a variable in cantata:
-
Open the Workspace:Variables... pane
-
In the pane define the variable K = 80 and hit return.
-
Close the pane
-
In the Add operator, put the created variable as the parameter.
-
Repeat the last step, but first convert the pixel data type of the original image to unsigned short. use the operator
-
Glyphs:Data Manip:Data Conversion:Convert Type
-
Connect the output of User defined to the input of Convert Type
-
open the Convert Type pane and select "Short" from the "Select Output Data Type:" pull down list.
-
Duplicate the Add and Display Image operators using the "duplicate" icon.
-
Connect the rest of the network and run the workspace
Exercises
-
Add different constant values to gain a better understanding of the
wraparound effect. Change only the variable K and rerun the
workspace.
Can we detect this effect with data types "short" "long" "integer" and
"float"?
Khoros Workspace
Execute the visual program c1s4wrap-byte.wk
Main DIP Menu
DIP Feedback Form
Copyright © 1997-1995 KRI, ISTEC, Ramiro Jordán, Roberto Lotufo. All Rights Reserved