Keywords: front-page

## Lab: Image Dithering

[Exercises] [Workspace]

Purpose: The purpose of this experiment is to show the technique called image dithering. It consists of mapping the original grey level image into a binary one.

Activities:

1. Read the image $DIP/data/mpicchu.kdf and normalize it to 0 (Lower Value) and 255 (Upper Value) using the operators User defined and Normalize. Create a two dimensional piecewise linear image using Piecewise Linear with the parameters:

              Rows = 32, Cols = 256,
              Sample Freq =  1,
              X Period    = 256
              X Rise Time = 256

   Inset the result from Piecewise Linear at the bottom of the result of Normalize with the Inset operator and display it with Display Image operator.

   1. Glyphs:Input/Output:Data Files:User defined
   2. Glyphs:Data Manip:Data Conversion:Normalize
   3. Glyphs:Khoros 1:Generate Data:Piecewise Linear
   4. Glyphs:Data Manip:Size & Region Operators:Inset
   5. Glyphs:Visualization:Non-Interactive Display:Display Image

2. Generate Uniform Noise of dimension 256x256, using Uniform Noise operator. Normalize it to 0 (Lower Value) and 255 (Upper Value) using the Normalize operator. Use this image as threshold for first item, using the > operator and display the result using Display Image operator.

   1. Glyphs:Input/Output:Generate Noise:Uniform Noise
   2. Glyphs:Data Manip:Data Conversion:Normalize
   3. Glyphs:Arithmetic:Comparison Operators:>
   4. Glyphs:Visualization:Non-Interactive Display:Display Image

3. Generate object containing sinusoidal value data with size 256 x 256. In the option Number of sine wave, set the attributes: "Num. Along Width" to 100 and "Num, Along Height" to 100, using Sinusoid operator. Normalize to 0 (Lower Value) and 255 (Upper Value) using the Normalize operator. Use this image as threshold for first item, using the > operator and display using Display Image operator.

   1. Glyphs:Input/Output:Generate Data:Sinusoid
   2. Glyphs:Data Manip:Data Conversion:Normalize
   3. Glyphs:Arithmetic:Comparison Operators:>
   4. Glyphs:Visualization:Non-Interactive Display:Display Image

4. Create a two dimensional piecewise linear image using the Piecewise Linear operator:

              Rows = 256, Cols = 256,
              Sample Freq =  1,
              X Period    = 4          Y Period = 4
              X Rise Time = 2,         Y Rise Time = 2
              X Fall Time = 2,         Y Fall Time = 2

   Normalize to 0 (Lower Value) and 255 (Upper Value) using the Normalize operator. Use this image as threshold for first item, using the > operator and display using Display Image operator.

   1. Glyphs:Khoros 1:Generate Data:Piecewise Linear
   2. Glyphs:Data Manip:Data Conversion:Normalize
   3. Glyphs:Arithmetic:Comparison Operators:>
   4. Glyphs:Visualization:Non-Interactive Display:Display Image

5. Use the Impulse operator to create an object with dimension 256x256 with 32 impulses in "Width" and "Height" directions. Select data type to Float and place the result at the first input of the LinearOp (Linear Operator) glyph. Read the image $DIP/data/dither.ascii with the User defined operator and place it at the second input of the LinearOp (Linear Operator) glyph. Normalize the result to 0 (Lower Value) and 255 (Upper Value) using the Normalize operator. Use this image as threshold for first item, using the > operators and display using Display Image operator.

   1. Glyphs:Input/Output:Generate Data:Impulse
   2. Glyphs:Input/Output:Data Files:User defined
   3. Glyphs:Arithmetic:Linear Transforms:LinearOp (Linear Operator)
   4. Glyphs:Data Manip:Data Conversion:Normalize
   5. Glyphs:Arithmetic:Comparison Operators:>
   6. Glyphs:Visualization:Non-Interactive Display:Display Image

Khoros Workspace
Execute the visual program c3s7dither.wk