Keywords: front-page

## Lab: Image Reduction

[Exercises] [Workspace]

Purpose: The purpose this experiment is show how reduce the size of an image without interpolation and with interpolation.

Activities:

1. Reduction without interpolation:

   1. Read the image $DIP/data/wksp-img.kdf and visualize with User defined and Display Image operators.

      1. Glyphs:Input/Output:Data Files:User defined
      2. Glyphs:Visualization:Non-Interactive Display:Display Image

   2. Create an image of size 256x256 with unitary impulses along the width and height separated by 4 pixels (`width spacing` using the Impulse operator. Take its FFT and display it using the operators FFT and Display Image.

      1. Glyphs:Input/Output:Generate Data:Impulse
      2. Glyphs:Arithmetic:Linear Transforms:FFT
      3. Glyphs:Visualization:Non-Interactive Display:Display Image

   3. Multiply the original image with the image with impulses using the Multiply operator and display it with Display Image, take its FFT e visualize it using the operators FFT and Display Image. Reduce the size of the result of the multiply using the Shrink operator and display it. Take the FFT and visualize it with FFT and Display Image operators.

      1. Glyphs:Arithmetic:Two Operand Arithmetic:Multiply
      2. Glyphs:Visualization:Non-Interactive Display:Display Image
      3. Glyphs:Arithmetic:Linear Transforms:FFT
      4. Glyphs:Data Manip:Size & Region Operators:Shrink

2. The previous reduced image was performed without any interpolation, just a subsampling. Now we will do the image reduction using an interpolation using a low pass filter before the subsampling:

   1. Of the $DIP/data/wksp-img.kdf take its FFT (Fast Fourier Transform) with Scale output by 1/sqrt(N) per transform axis using the FFT operator and display its spectrum, use the FFT and Display Image operators.

      1. Glyphs:Input/Output:Data Files:User defined
      2. Glyphs:Visualization:Non-Interactive Display:Display Image
      3. Glyphs:Arithmetic:Linear Transforms:FFT

   2. Generate a spatial frequency image with Low-Pass operator and multiply with the result of the FFT and display with Display Image. Extract the inverse FFT of the result of the multiplication with scale output by 1/N per transform axis. Specify calculation of the "Log (Magnitude +1)" and visualize using Complex to Real and Display Image operators.

      1. Glyphs:Image Proc:Frequency Filter:Low-Pass
      2. Glyphs:Arithmetic:Two Operand Arithmetic:Multiply
      3. Glyphs:Arithmetic:Linear Transforms:FFT
      4. Glyphs:Visualization:Non-Interactive Display:Display Image
      5. Glyphs:Arithmetic:Complex Operators:Complex to Real

   3. Multiply the output of the Complex to Real operator with the output of the Impulse operator and performance of the same manner that the item 3 of the Reduction without interpolation.

Khoros Workspace
Execute the visual program c6s7reduction.wk