Title: Image Processing in IDL
1 Image Processing in IDL by, Jwan m AL-DOSKI
Farah Hijanah EddieUniversiti Putra
Malaysia
2 Image
Processing In IdlTopics 1-Introduction to
Image Processing in IDL 2-Digital Images and
Image Processing includes 1-Transforming
Image Geometry and Interpolation Methods
2- Mapping Images onto Surfaces Overview
3-Masking image . 4-warping image.
5- Specifying Regions of Interest (ROIs)
6- Manipulating Images in Various Domains
7- Enhancing Contrast and Filtering 8-
Extracting and Analyzing Shapes
3 1- Introduction to Image Processing in
IDL Today, the medical industry, astronomy,
physics, chemistry are just some of the many
fields that rely upon images to store, display,
and provide information about the world around
us. The challenge to scientists, engineers and
business people is to quickly extract valuable
information from raw image data. This is the
primary purpose of image processing converting
images to information.There are many soft wares
have been used for image processing one of them
is IDL. IDL software is a high-level
programming language that contains an extensive
library of image processing and analysis
routines.
4Within IDL, an image can be categorized as
follows
52-Digital Images and Image Processing A digital
image is composed of a grid of pixels and stored
as an array. A single pixel represents a value of
either light intensity or color. Images are
processed to obtain information beyond what is
apparent given the image's initial pixel values.
61-Transforming Image Geometry and Interpolation
Methods Geometric image transformation
functions use mathematical transformations to
crop, pad, scale, rotate, transpose or otherwise
alter an image array to produce a modified view
of an image. When an image undergoes a geometric
transformation, some or all of the pixels within
the source image are relocated from their
original spatial coordinates to a new position in
the output image. When a relocated pixel does not
map directly onto the center of a pixel location,
but falls somewhere in between the centers of
pixel locations, the pixel's value is computed by
sampling the values of the neighboring pixels.
This resampling, also known as interpolation,
affects the quality of the output
image.Interpolation methods in IDL include
1- Nearest-neighbor interpolation .2-Linear
interpolation .3- Bilinear interpolation
.4-Trilinear interpolation .5-Cubic Convolution
interpolation .
7Geometric image transformation functions
Cropping Images extracts a rectangular region of interest from the original image
Padding Images REPLICATE( Value, D1 , ..., D8 ) introduces new pixels around the edges of an image
Resizing Images or scaling CONGRID function to increase size . supports further image analysis by either shrinking or expanding an image
8Geometric image transformation functions
Shifting Images SHIFT(Array, S1, ..., Sn) The SHIFT function moves elements of a vector or array along any dimension by any number of elements
Reversing Images REVERSE(Array , Subscript_Index,/OVERWRITE) reverse any dimension of an array.
Rotating Images ROTATE(Array, Direction) To change the orientation of an image in IDL, use either the ROTATE or the ROT function.
Transposing image TRANSPOSE( Array , P ) Transposing an image array interchanges array dimensions, reflecting an image about a diagonal
9 The another Geometric image transformation
functions Planar Slicing of Volumetric Data
Volumetric displays are composed of a series of
2D slices of data which are layered to produce
the volume.IDL provides routines that allow
you to1- display a series of the 2D slices in a
single image window.2- display single
orthogonal or non-orthogonal slices of volumetric
data3- interactively extract slices from a 3D
volume.
10Steps for Displaying a Series of Planar Slices
11The result
12Steps for Extracting a Slice of Volumetric Data
13The result
14 2-Mapping Images onto Surfaces Overview
Mapping an image onto geometry, also known as
texture mapping, involves overlaying an image or
function onto a geometric surface.Mapping an
image onto a geometric surface is a two step
process1- the image is mapped onto the geometric
surface in object space. 2- the surface
undergoes view transformations (relating to the
viewpoint of the observer) and is then displayed
in 2D screen space.
15(No Transcript)
16Type of mapping by IDL1- Mapping an Image onto
Elevation Data This type provides a more
informative view of the area's topography. There
are many functions can be used by IDL for
example SHADE_SURF function The SHADE_SURF
procedure creates a shaded-surface representation
of a regular or nearly-regular gridded surface
with shading from either a light source model or
from a user-specified array of intensities..
17Syntax SHADE_SURF, Z , X, Y , AXdegrees
, AZdegrees , IMAGEvariable
, MAX_VALUEvalue , MIN_VALUEvalue
, PIXELSpixels , /SAVE , SHADESarray
, /XLOG , /YLOG
- Shaded Representations of a
Maroon Bells Data Shown as - Two-Dimensional Gaussian
a Shaded Surface
18XOBJVIEW function The XOBJVIEW procedure is a
utility used to quickly and easily view and
manipulate IDL Object Graphics on screen .
Syntax XOBJVIEW, Obj , BACKGROUNDr, g, b
, /BLOCK , /DOUBLE_VIEW , GROUPwidget_id
, /JUST_REG , /MODAL , REFRESHwidget_id
, RENDERER0  1 , SCALEvalue
, STATIONARYobjref(s) , /TEST
, TITLEstring , TLBvariable
, XOFFSETvalue , XSIZEpixels
, YOFFSETvalue , YSIZEpixels
192- Mapping an Image onto a Sphere
- A- Mapping an Image onto a Sphere Using Direct
Graphics
20Some functions for Mapping an Image onto a Sphere
Using Direct Graphics SCALE3
functionprocedure sets up transformation and
scaling parameters for basic 3-D viewing Syntax
SCALE3 , XRANGEvector , YRANGEvector
, ZRANGEvector , AXdegrees , AZdegrees
example SCALE3, XRANGE0, 20, YRANGE0,
20, ZRANGE0, 20, AX20, Â Â Â AZ55
21TVLCT The TVLCT procedure loads the display
color translation tables from the specified
variables. Syntax TVLCT, V1, V2, V3 , Start
, /GET , /HLS , /HSV orTVLCT, V , Start
, /GET , /HLS , /HSV IDL uses the RGB
color system internally, color tables can be
specified to TVLCT using any of the following
color systems RGB (Red, Green, Blue), HLS (Hue,
Lightness, Saturation), and HSV (Hue, Saturation,
Value). Mineral Image and Default Color Table
(Direct Graphics) Mineral Image and RAINBOW
Color Table (Direct Graphics) Mineral Image and
Derived Color Table (Direct Graphics)
22 B-Mapping an Image Object onto a Sphere This
example maps an image containing world elevation
data onto the surface of a sphere and displays
the result using the XOBJVIEW utility. This
utility automatically creates the window object
and the view object. Therefore, this example
creates an object based on IDLgrModel that
contains the sphere, the image and the image
palette, as shown in the conceptual
representation in the following figure. Figure
4-18 Conceptualization of XOBJVIEW Object
Graphics Example
233-Masking (also known as thresholding) is used
to isolate features within an image above, below,
or equal to a specified pixel value. The value
(known as the threshold level) determines how
masking occurs. In IDL, masking is performed with
the relational operators. IDL's relational
operators are shown in the following table
Table IDL's Relational Operators Table IDL's Relational Operators
Operator Description
EQ Equal to
NE Not equal to
GE Greater than or equal to
GT Greater than
LE Less than or equal to
LT Less than
- For example, if you have an image variable and
you want to mask it to include only the pixel
values equaling 125, the resulting mask variable
is created with the following IDL statement. - mask image EQ 125
24Oceans Mask (left) and the Resulting Image
(right) ocean Mask image LT 125
25Land Mask (left) and the Resulting Image (right)
land Mask image GE 125
26 1- Clipping Images Clipping is used to enhance
features within an image. clippedImage image gt
125 IDL's minimum and maximum operators are
shown in the following table.
Operator Description
lt Less than or equal to
gt Greater than or equal to
27Image of Hurricane Gilberttop ClippedImage
image gt 125
282- Locating Pixel Values in an Image Locating
pixel values within an image helps to segment
features. You can use IDL's WHERE function to
determine where features characterized by
specific values appear within the image. WHERE
function returns a vector of one-dimensional
indices, locating where the specified values
occur within the imagewhere index is the
result from the WHERE function and imageSize0
is the width of the image.
29Pixel Values Greater Than 125, TV (left) and
TVSCL (right)
30Pixel Values Less Than 125, TV (left) and TVSCL
(right)
31 3- IMAGE_STATISTICS procedure computes sample
statistics for a given array of values.Syntax
IMAGE_STATISTICS, Data , COUNTvariable
, DATA_SUMvariable , /LABELED , LUTarray
, MASKarray , MAXIMUMvariable
, MEANvariable , MINIMUMvariable
, STDDEVvariable , SUM_OF_SQUARESvariable
, VARIANCEvariable , /VECTOR , WEIGHT_SUM
variable , /WEIGHTED .
324. Warping Images
- image warping is used primarily to correct
optical distortions introduced by camera lenses,
or to register images acquired from either
different perspectives or different sensors. - corresponding control points (selected in the
input and reference images) control the geometry
of the warping transformation. - image warping is used primarily to correct
optical distortions introduced by camera lenses,
or to register images acquired from either
different perspectives or different sensors.
33(No Transcript)
34- image warping is often known as rubber sheeting.
- 3 step in image warping using IDL
- control points are selected between two displayed
images or between an image and a grid. - the resulting arrays of control points, Xi, Yi,
Xo, and Yo, are then input into one of IDL's
warping routines. - the warped image resulting from the translation
of the Xi, Yi points to the Xo, Yo points, is
displayed.
35Creating Transparent Image Overlays
- Using Direct Graphics
- requires devising a mask to alter the array of
the image that is to be displayed as a
transparency. - The mask retains only the pixel values that will
appear in the transparent overlay. - The base image and the transparent warped image
can then be displayed as a blended image
36(No Transcript)
37(No Transcript)
38Direct Graphics Example Selecting Control Points
39(No Transcript)
40(No Transcript)
41(No Transcript)
42WARP_TRI function
- This function uses the irregular grid of the
reference image, defined by Xo, Yo, as a basis
for triangulation, defining the surfaces
associated with (Xo, Yo, Xi) and (Xo, Yo, Yi).
Each pixel in the input image is then transferred
to the appropriate position in the resulting
output image as designated by interpolation.
43POLY_2D function
- warp the original image, mriImg, onto the CT bone
scan using the POLY_2D function
44XPALETTE function
455. Specifying Regions of Interest (ROIs)
- A region of interest (ROI) is an area of an image
defined for further analysis or processing.
46(No Transcript)
47XROI function
48(No Transcript)
49 DRAW_ROL function
506. Manipulating Images in Various Domains
51Transforming to the Frequency Domain
52(No Transcript)
53Transforming to the time-Frequency Domain
(Wavelet tranform)
547. Enhancing Contrast and Filtering
55Working with histogram
56(No Transcript)
57(No Transcript)
588. Extracting and Analyzing Shapes
59Smoothing with MORPH_OPEN
- applies the opening operation, which is erosion
followed by dilation, to a binary or grayscale
image.
60(No Transcript)