Lab: Translation, Rotation, Scaling / Geometric Transformations I

[Exercises] [Workspace]

Purpose: The purpose of this experiment is to visualize the effects on an object when we perform translation, rotation, and scaling operations.

Activities:

  1. Perform geometric rotation, scaling, and translation on the image the image $DIP/data/drawing.kdf.

    1. Display $DIP/data/drawing.kdf and get size information about the data object using the following operators and expand the image with Expand operators:

      1. Glyphs:Input/Output:Data Files: User defined

      2. Glyphs:Visualization:Non-Interactive Display: Display Image

      3. Glyphs:Input/Output:Information: Data Object Info

      4. Glyphs:Input/Output:Information: File Viewer

      5. Glyphs:Data Manip:Size & Region Operators: Expand

    2. Rotate the original object by 45 degrees. Use the following operator:

      1. Glyphs:Image Proc:Geometric Operators: Rotate

      2. Display the results

    3. Geometrically scale the object by a factor of three. Consider the origin as the center of the image. The operator to use is:

      1. Glyphs:Data Manip:Size & Region Operators: Resample

      2. When using the Resample operator, if you wish to keep the output image the same size as the input image, set the "Resize dimensions?" parameter to "No".
      3. Display the results.

    4. Translate the object by an offset of 32 in both the width and height dimensions using the "Translate" operator.

      1. Glyphs:Data Manip:Reorganize Data: Translate

      2. Display the results

    5. Do a periodic translation of the object by an offset of 32 in the width and height dimensions. To mimic the periodic or wrap translation, use the Inset operator two times to build a tile of four images. Perform the translation and finally use the Extract operator to get the resultant image. Use cantata variables to implement this procedure. Select the following operators from the cantata menus:

      1. Glyphs:Data Manip:Size & Region Operators: Inset (2 of these)

      2. Glyphs:Data Manip:Reorganize Data: Translate

      3. Glyphs:Data Manip:Size & Region Operators: Extract

      4. Connect the output of Expand to both inputs of Inset. Set the "Width Coordinate" to the width size of the input object.
      5. Connect the output of the Inset in step iv. to both inputs of the next Inset. Set the "Width Coordinate" to zero, and the "Height Coordinate" to the height size of the original input object.
      6. Use the Translate operator to translate by an offset of in the width and height dimensions.
      7. Extract the center of the image. Use width and height offsets of 1/2 the original image size, and region sizes equal to the original image size.

      8. Display the results


Exercises

  1. Perform the same experiment with different objects. Experiment by modifying the width and/or height of your objects.
  2. Create an encapsulated workspace to create the periodic translation operator.


Khoros Workspace
Execute the visual program c2s9geo-transformations.wk



Main DIP Menu
DIP Feedback Form
Copyright © 1997-1995 KRI, ISTEC, Ramiro Jordán, Roberto Lotufo. All Rights Reserved