[Exercises]
[Workspace]
Purpose:
The purpose of this lab exercise is to use non-interactive
and interactive methods to extract regions from an image, and to
experiment with various ways of visualizing this data. The second
exercise in the lab demonstrates how to extract and plot a 1D
intensity profile of an image.
Activities:
-
Extract a region from an image, expand it for a "zoomed" display,
print the data values, and visualize the region using a Display 3D Plot.
-
Read the image $DIP/data/gull.kdf and display it. Select the
following operators from the cantata menus
-
Glyphs:Input/Output:Data Files:User defined
-
Glyphs:Visualization:Non-Interactive Display:Display Image
-
Connect these operators
-
There is an alternative way to select the images used in the course:
When the File Browser is opened in the User defined operator, click
in the icon on the top left part of the browser. The browser toggles
to what is called "Aliases Browser". Select "dip-image:" category
and then you can select the image file.
-
Extract a Region of Interest (ROI) around the seagull's eye
using the Extract operator. From the cantata menu, select
-
Glyphs:Data Manip:Size & Region Operators:Extract
-
Open the Extract pane, and set the following parameters
Region Size: Width 10
Height 10
Region Origin: Width 194
Height 23
-
Connect the User defined operator to the Extract operator
-
Zoom the ROI image for better visualization using the Expand
operator. From the cantata menus, select the following operators
-
Glyphs:Data Manip:Size & Region Operators:Expand
-
Glyphs:Visualization:Non-Interactive Display:Display Image
-
Open the Expand pane and select a proper magnification factor.
-
Connect the output of Expand to the input of Display Image and
run the operators to visualize the "zoomed" data
-
Print the pixel values of the ROI image (10 x 10) by first
converting the image to ASCII . From the cantata menus, select
the following operators
-
Glyphs:Input/Output:Export Data:Supported Formats
-
Glyphs:Input/Output:Information:File Viewer
-
Open the Supported Formats pane and select "ASCII"
-
Connect the the output of Extract to Supported Formats
-
Connect the the output of Supported Formats to File Viewer
-
Run the operators to print the actual values
-
Print the data using the Print Data operator in place
of Supported Formats. The Print Data operator allows each pixel in a line
along with its coordinates. From the cantata menu, select the
following operator
-
Glyphs:Input/Output:Information:Print Data
-
Connect the output of Extract to Print Data
-
Connect the output of Print Data to File Viewer
-
Run these operators to display this type of formatting
-
Display a surface plot of the ROI image using the operator Display 3D Plot.
From the cantata menu, select
-
Glyphs:Visualization:Plot Display:Display 3D Plot
-
connect the output of Extract to the input of Display 3D Plot and run Display 3D Plot
-
Select the following parameters by clicking on the options button of
the plot display window:
Plot Type: Wireframe
Rotation About X: 130
Rotation About Z: 0
Eye Distance: 1
In this surface plot, the pixel intensity values are the height information.
-
Use Non-Interactive and Interactive Region of Interest extraction
to extract a vertical intensity profile of the image and visualize as
an image and as a Display 2D Plot.
-
Get a vertical intensity profile of the image using the Extract
operator. The vertical line extracted is a 1D signal. You can display
it using the Display Image operator, but this data can be better
visualized using the Display 2D Plot operator. From the cantata menu, select
-
Glyphs:Data Manip:Size & Region Operators:Extract
-
Glyphs:Visualization:Plot Display:Display 2D Plot
-
Open the Extract pane. In this case we are extracting the
entire vertical line, thus is is not necessary to specify any
parameters in the height direction. Select only the width parameters:
Region Size: Width 1
Region Origin: Width 128
-
Connect the output of the User defined to the input of Extract
-
Connect the output of Extract to the input of Display 2D Plot
-
Run these Operators
-
Get a vertical intensity profile of the image using interactive
ROI Extraction. From the cantata menu, select
-
Glyphs:Visualization:Interactive ROI Extraction:Extract ROI
-
Open the Extract ROI pane and change the "ROI Presentation"
option to "Signal". Select "Line" as the ROI shape.
-
Close the pane and run Extract ROI
-
Place the mouse cursor at the top of the image so that the
position window reads (128 x 0 = 61). Press the left mouse button
down. While keeping the button depressed, drag the cursor down to the
bottom of the image, drawing a straight line. Release the mouse
button. The line will be extracted, and a plot of it displayed.
Khoros Workspace
Execute the visual program c1s2image-visual.wk
Main DIP Menu
DIP Feedback Form
Copyright © 1997-1995 KRI, ISTEC, Ramiro Jordán, Roberto Lotufo. All Rights Reserved