Keywords: front-page

## Lab: Image Overlaying I

[Exercises] [Workspace]

Purpose: The purpose of this lab is to experiment with overlaying images. This exercise demonstrates how to generate a grid and overlay it onto a pixel replicated image to delineate each of pixels in the original image.

Activities:

1. Building the zoomed image.

   1. Select an image to work with. Extract a small region from it, say 8x8 using the operator Extract and expand it by a factor of 20 using the operator Expand. Display the image.

      1. Glyphs:Input/Output:Data Files:User defined
      2. Glyphs:Data Manip:Size & Region Operators:Extract
      3. Glyphs:Data Manip:Size & Region Operators:Expand
      4. Glyphs:Visualization:Non-Interactive Display:Display Image

2. Building the line-grid image.

   1. Use the Piecewise Linear operator to create the line-grid image with minimum value 0 and maximum value 255. Look at Lab 1 in the Image Manipulation section, Trapezoidal Data Generation, to find out the proper parameter to generate this image. Use Period of 20 pixels, Pulse Width of 1 pixel, Rise and Fall Time of 0 pixels.

      1. Glyphs:Khoros 1:Generate Data:Piecewise Linear
      2. Glyphs:Visualization:Non-Interactive Display:Display Image

   2. Create and display another similar image, but with horizontal lines and make a union (maximum) of both using the operator Maximum. Display the resulting grid image.

      1. Glyphs:Arithmetic:Two Operand Arithmetic:Maximum

   3. The image created will have zero as the background, and the lines will have the value of 255. To invert the image, use the operator Subtract From with parameter 255.

      - Glyphs:Arithmetic:Two Operand Arithmetic:Subtract From

3. Combining the images.

   1. Use the operator Minimum to overlay the line-grid image onto the zoomed image. Display the results.

      - Glyphs:Arithmetic:Two Operand Arithmetic:Minimum

Exercises

1. Overlay the grid onto the image using the Blend Data operator instead of the Minimum operator.
2. Experiment by changing the pixel values for the line-grid image and by modifying the magnification factor.
3. Create your own grid image.

Khoros Workspace
Execute the visual program c3s3grid-on-zoom.wk