Title: Laboratory in Oceanography: Data and Methods
1Laboratory in Oceanography Data and Methods
Image Processing/Analysis
- MAR599, Spring 2009
- Miles A. Sundermeyer
2Image Processing/Analysis Image Processing
Toolbox/Product Overview
- Overview of Image Processing Toolbox
- A collection of functions that extend the
capability of MATLAB numeric computing for image
processing operations, including - Spatial image transformations
- Morphological operations
- Neighborhood and block operations
- Linear filtering and filter design
- Transforms
- Image analysis and enhancement
- Image registration
- Deblurring
- Region of interest operations
3Image Processing/Analysis Image Processing
Toolbox/Product Overview
- Loading and writing images
- To read an image, use imread
- Example
- gtgt imfinfo('pout2.png')
- gtgt I imread('pout.tif')
- gtgt imshow(I)
- gtgt whos I
- gtgt
- gtgt II imread(StarWars.tif)
- gtgt whos II
- gtgt imshow(StarWars(,,13)
- gtgt
- gtgt imwrite (II(,,13), StarWars.png')
4Image Processing/Analysis Image Processing
Toolbox/Introduction/Image Types in the Toolbox
5Image Processing/Analysis Image Processing
Toolbox/Introduction/Image Types in the Toolbox
The Separated Color Planes of an RGB
Image           Â
6Image Processing/Analysis Image Processing
Toolbox/Introduction/Image Types in the Toolbox
red
green
blue
7Image Processing/Analysis Image Processing Toolbox
Example Lab Studies by G. A. Stuart (2007)
8Image Processing/Analysis Image Processing Toolbox
- Example Lab Studies (contd)
- The time evolution of a centrally injected patch
of green dye was observed in response to a preset
sequence of 8 mixing events
9Image Processing/Analysis Image Processing Toolbox
Example Lab Studies (contd)
10Image Processing/Analysis Image Processing Toolbox
- Example Lab Studies (contd)
- Computing and subtracting image background
- gtgt bkgd blkproc(newa,5 5,50 50,_at_(x)
nanmedian(x()))
11Image Processing/Analysis Image Processing Toolbox
- Example Lab Studies (contd)
- Identify dark bits
- gtgt bkgcutoff 165
- gtgt darkbits find(ambkgltbkgcutoff
- (ambkgnan))
12Image Processing/Analysis Image Processing Toolbox
- Example Lab Studies (contd)
- Linearly interpolate over masked portions of
image - gtgt newdarkbits griddata(Xgrid(lightbits),Ygr
id(lightbits),a(lightbits), ... - Xgrid(darkbits),Ygrid(darkbits),'l
inear')
13Image Processing/Analysis Image Processing Toolbox
Example Lab Studies (contd)
14Image Processing/Analysis Image Processing Toolbox
Example Lab Studies (contd)
15Image Processing/Analysis Image Processing Toolbox
Example Lab Studies (contd)
16Image Processing/Analysis Image Processing Toolbox
Example Lab Studies (contd)
17Image Processing/Analysis Image Processing Toolbox
Example Lab Studies (contd)
18Image Processing/Analysis Image Processing Toolbox
Example Lab Studies (contd)
19Image Processing/Analysis Image Processing Toolbox
Example Lab Studies (contd)
20Image Processing/Analysis Image Processing Toolbox
- Example Lab Studies (contd)
- Calculate growth rate of dye variance to
determine effective horizontal diffusivity
Two-Dimensional dye variance
kH 2.3 x 10-5 m2 s-1
Area of Ellipse (m2)
Inferred Eddy Diffusivity
Observed area
Fitted slope
Time (s)
21Image Processing/Analysis Mapping Toolbox/Getting
Started/Product Overview
- Overview of Mapping Toolbox
- A collection of functions that extend the
capability of MATLAB numeric computing for
mapping and GIS operations, including - Geospatial data import and access
- Vector map data and geographic data structures
- Geo-referenced images and data grids
- Map projections and coordinates
- Map display and interaction
- Geographic calculations for vector and raster
data - A map viewer and other graphical user interfaces
22Image Processing/Analysis Mapping Toolbox/Getting
Started/Your First Maps
- Loading and plotting simple map data
- Example
- gtgt worldmap world create an empty map axis
- gtgt load coast load and plot coastlines
- gtgt plotm(lat, long)
- Example
- gtgt h worldmap('Europe') create a new map axes
for Europe - gtgt and add data to the map
- gtgt geoshow('landareas.shp', 'FaceColor', 0.15
0.5 0.15) - gtgt geoshow('worldlakes.shp', 'FaceColor', 'cyan')
- gtgt geoshow('worldrivers.shp', 'Color', 'blue')
- gtgt geoshow('worldcities.shp', 'Marker', '.',
'MarkerEdgeColor', 'red')
23Image Processing/Analysis Mapping Toolbox/Getting
Started/Your First Maps
- The Map Viewer is an interactive tool for
browsing map data - Example
- gtgt mapview
- gtgt To import Mapping Toolbox demo data, change
directory to - gtgt cd(fullfile(matlabroot,'toolbox','map','mapdemo
s')) - gtgt (can also get here by navigating to
'toolbox/map/mapdemos') - gtgt Import a vector data layer
- gtgt boston_roads shaperead('boston_roads.shp')
- ...
24Image Processing/Analysis Mapping
Toolbox/Understanding Map Data/Understanding
Vector Geo-Data
- Points, Lines, Polygons
- Vector geospatial data is used to represent
linear features such as rivers, coastlines,
boundaries, and highways - Example
- gtgt lat 45.6 -23.47 78 long 13 -97.45 165
25Image Processing/Analysis Mapping Toolbox
Example Allens Pond Nutrient Loading / Tidal
Flushing Study Case Studies in Estuarine Dynamics
(MAR620), Spring 2008
26Image Processing/Analysis Mapping Toolbox
Example Allens Pond Nutrient Loading / Tidal
Flushing Study Case Studies in Estuarine Dynamics
(MAR620), Spring 2008
27Image Processing/Analysis Mapping Toolbox
Example Allens Pond Nutrient Loading / Tidal
Flushing Study Case Studies in Estuarine Dynamics
(MAR620), Spring 2008
28Image Processing/Analysis Mapping Toolbox
Example Allens Pond Nutrient Loading / Tidal
Flushing Study Case Studies in Estuarine Dynamics
(MAR620), Spring 2008
29Image Processing/Analysis Mapping Toolbox
Example Allens Pond Nutrient Loading / Tidal
Flushing Study Case Studies in Estuarine Dynamics
(MAR620), Spring 2008
30Image Processing/Analysis Mapping Toolbox
Example Allens Pond Nutrient Loading / Tidal
Flushing Study Case Studies in Estuarine Dynamics
(MAR620), Spring 2008
31Image Processing/Analysis Mapping Toolbox
- Useful Tidbits
- Mass GIS website http//www.mass.gov/mgis/massgis
.htm