[Exercises]
[Workspace]
Purpose:
The purpose of this lab is to experiment with techniques of
image contrast enhancement achieved by applying logarithmic functions
and logarithmic colormaps to images.
Activities:
-
Contrast Enhancement using the log function explicitly.
-
Read and display the $DIP/data/myelin.kdf image using the
operators User defined and Display Image.
-
Glyphs:Input/Output:Data Files:User defined
-
Glyphs:Visualization:Non-Interactive Display:Display Image
-
Apply the Logarithm operator the image and display the result
using the Display Image operator. The resultant image has a much
better contrast in the dark areas.
-
Glyphs:Arithmetic:NonLinear Functions:Logarithm
-
Glyphs:Visualization:Non-Interactive Display:Display Image
-
You will notice that the pixels values of the previous image
are of type float varying from 0 to log(1+255) which is approximately
2.4. Use the operator Normalize to convert the image to pixels of
type unsigned byte varying from 0 to 255.
-
Glyphs:Data Manip:Data Conversion:Normalize
-
Glyphs:Visualization:Non-Interactive Display:Display Image
-
Contrast Enhancement using a logarithmic color table. This
experiment shows three ways of enhancing the image using the
logarithm colormap.
-
Visualize the color table data. Read the colormap
file $DIP/data/log-256-lut.kdf, and print its data using the
operator Print Data with the parameters "Map Indexing" and "Map Data"
selected.
-
Glyphs:Input/Output:Data Files:User defined
-
Glyphs:Input/Output:Information:Print Data
-
Glyphs:Input/Output:Information:File Viewer
-
Plot this file. This requires that you first transfer the data
to the VALUE segment using the Copy to Value operator, then plot the
results using Display 2D Plot.
-
Glyphs:Data Manip:Segment Operators:Copy to Value
-
Glyphs:Visualization:Plot Display:Display 2D Plot
-
Open the Copy to Value and set the parameters so that the
map segment is copied to the value segment.
-
Use the operator Display Image to display
the $DIP/data/myelin.kdf image. Connect the colormap file to the last
entry of the Display Image operator ("Colormap Image").
-
Glyphs:Visualization:Non-Interactive Display:Display Image
-
Insert the colortable in the image file using the
operator Insert Segments. Insert the "Value" segment
of $DIP/data/myelin.kdf file with the colortable file. Display it
with Display Image.
-
Glyphs:Data Manip:Segment Operators:Insert Segments
-
Glyphs:Visualization:Non-Interactive Display:Display Image
-
Use the image generated in the previous method and explicitly
map the data through the colormap using the operator Map Data.
-
Glyphs:Data Manip:Map Operators:Map Data
-
Glyphs:Visualization:Non-Interactive Display:Display Image
Exercises
-
Explain the differences between the three methods of using the
color table. Use the operator Data Object Info to see the
differences between the file contents of methods 2 and 3.
Glyphs:Input/Output:Information:Data Object Info
Glyphs:Input/Output:Information:File Viewer
Khoros Workspace
Execute the visual program c4s6contrast-log.wk
Main DIP Menu
DIP Feedback Form
Copyright © 1997-1995 KRI, ISTEC, Ramiro Jordán, Roberto Lotufo. All Rights Reserved