Image Processin G: Landsat 7 Image of The Retreating Malaspina Glacier, Alaska
Image Processin G: Landsat 7 Image of The Retreating Malaspina Glacier, Alaska
Processin
Chapter 14
g Landsat 7 image of the retreating
Malaspina Glacier, Alaska
Image Basics
Earth science is a very visual discipline
Graphs
Maps
Field Photos
Landsat image of Death
Satellite images Valley, CA
Cathodoluminescenc
should have:
Basic knowledge about graphics file types
Pros/cons of different graphics file types
Photomicrograph of peridotite
(mantle rock)
Sediment
Core NED
Dataset
Image File Types: Raster vs
Vector
Raster Image
Made of pixels
When you scale it, quality changes (finite # pixels)
Common formats: jpg, png, gif, tif, bmp
Vector Image
Made of vector objects (not pixel-based)
Can scale to any size
Common Formats: ai, eps, ps, svg, wmf, pdf
imread, image,
Yukon River delta, Alaska
imagesc,
Mississippi River meanders &
oxbows near Memphis, TN colormap,
Novarupta Volcano, Aleutian Islands, Alaska
Purples/Reds: Volcanic ash from 1912 Eruption
Blues: Snow/Ice
Color Models
Before we start processing
images, we need to talk
about how computers
represent colors as
numbers
Three common color
models
RGB: An additive model
works like light
CMYK: A subtractive model
works like ink
HSV: A cone-shaped model
useful for shading colors
The RGB Color Model
For variables of class uint8 (and 8-bit images)
0-255 are the possible integer values (same for the uint8 class!)
0 is minimum for any RGB color
255 is max for any RGB color
To define any color, you must specify the Red (R), Green (G),
and Blue (B) values
Wait, color can be a vector!
Grayscale images only need one value (0=black, 255=white)
[000] [ 255 255 255 ] [ 75 75 75 ] [ 200 200 200] [ 255 0 0] [ 100 0 0] [ 0 255 0]
Total number of different colors: 256 = 16,777,216 3
[ 0 100 0 ] [ 0 0 255 ] [ 0 0 100 ] [ 255 255 0] [ 0 255 255] [ 255 0 255] [ 237 125 49]
Colormaps in MATLAB
Just to annoy us, MATLAB requires colormap RGB values to
be values between 0 and 1 for variables of class double
0 is minimum for any RGB color
1 is max for any RGB color
To define any color, you must specify the Red (R), Green (G),
and Blue (B) values
To convert from the 0-255 system, just divide by 255! Or cast as uint8
Grayscale images really only need one value (0=black, 1=white)
2) Indexed to a Colormap
Colors are stored as a single integer value that corresponds
to a row in a colormap matrix.
Colormap stores the RGB values 4 Pixel
Colormap Matrix
Image
Image Matrix
Images Represented as
Colormaps
image plots a
matrix as an image
Dont forget to
specify the colormap
If not, you get the
default 64 color jet
colormap
Built-In Colormaps
MATLAB provides several built-in
colormaps
The command colormap is rather
useful
It can set the current colormap
Can be a built-in map or a custom n x 3
matrix
Built-in colormaps can be easily
scaled
E.g. jet(256) returns a 256 x 3 matrix
that follows the color scheme of the built-
in jet colormap.
True Color Images
If image is given a
2D matrix, it
assumes the image
is indexed color
Reading in Grayscale
Images
How could I
figure out the %
dendrites?
Reading in True Color / RGB
Images
imread can read in most Landsat image of Yukon
River delta
standard RGB raster image types
.jpg .gif .png, etc
Stores image as a 3D matrix
Each entry represents one pixels R,
G, or B value
0-255 (min/max)
1st z-slice = Red values
2nd z-slice = Green values
3rd z-slice = Blue values
Google Earth Image (aerial
photo)
Lets read this image into MATLAB
The image is 1000 x 1001 pixels
Matrix will be 1001 x 1000 x 3