320 likes | 464 Views
Laboratory in Oceanography: Data and Methods. Image Processing/Analysis. MAR550, Spring 2013 Miles A. Sundermeyer. Image Processing/Analysis Image Processing Toolbox/Product Overview. Overview of Image Processing Toolbox
E N D
Laboratory in Oceanography: Data and Methods Image Processing/Analysis MAR550, Spring 2013 Miles A. Sundermeyer
Image 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
Image Processing/Analysis Image Processing Toolbox/Product Overview • Loading and writing images • To read an image, use ‘imread’ • Example: • >> imfinfo('pout2.png') • >> I = imread('pout.tif'); • >> imshow(I) • >> whos I • >> • >> II = imread(‘StarWars.tif’); • >> whos II • >> imshow(StarWars(:,:,1:3); • >> • >> imwrite (II(:,:,1:3), ‘StarWars.png');
Image Processing/Analysis Image Processing Toolbox/Introduction/Image Types in the Toolbox
Image Processing/Analysis Image Processing Toolbox/Introduction/Image Types in the Toolbox The Separated Color Planes of an RGB Image
Image Processing/Analysis Image Processing Toolbox/Introduction/Image Types in the Toolbox red green blue
Image Processing/Analysis Image Processing Toolbox Example: Lab Studies by: G. A. Stuart (2007)
Image Processing/Analysis Image Processing Toolbox • Example: Lab Studies (cont’d) • The time evolution of a centrally injected patch of green dye was observed in response to a preset sequence of 8 mixing events
Image Processing/Analysis Image Processing Toolbox Example: Lab Studies (cont’d)
Image Processing/Analysis Image Processing Toolbox • Example: Lab Studies (cont’d) • Computing and subtracting image background • >> bkgd = blkproc(newa,[5 5],[50 50],@(x) nanmedian(x(:)));
Image Processing/Analysis Image Processing Toolbox • Example: Lab Studies (cont’d) • Identify ‘dark bits’ • >> bkgcutoff = 165; • >> darkbits = find(ambkg<bkgcutoff • & ~(ambkg==nan));
Image Processing/Analysis Image Processing Toolbox • Example: Lab Studies (cont’d) • Linearly interpolate over masked portions of image • >> newdarkbits = griddata(Xgrid(lightbits),Ygrid(lightbits),a(lightbits), ... • Xgrid(darkbits),Ygrid(darkbits),'linear');
Image Processing/Analysis Image Processing Toolbox Example: Lab Studies (cont’d)
Image Processing/Analysis Image Processing Toolbox Example: Lab Studies (cont’d)
Image Processing/Analysis Image Processing Toolbox Example: Lab Studies (cont’d)
Image Processing/Analysis Image Processing Toolbox Example: Lab Studies (cont’d)
Image Processing/Analysis Image Processing Toolbox Example: Lab Studies (cont’d)
Image Processing/Analysis Image Processing Toolbox Example: Lab Studies (cont’d)
Image Processing/Analysis Image Processing Toolbox Example: Lab Studies (cont’d)
Image Processing/Analysis Image Processing Toolbox • Example: Lab Studies (cont’d) • 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)
Laboratory in Oceanography: Data and Methods Image Processing/Analysis Part II MAR550, Spring 2013 Miles A. Sundermeyer
Image 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
Image Processing/Analysis Mapping Toolbox/Getting Started/Your First Maps • Loading and plotting simple map data • Example: • >> worldmap world % create an empty map axis • >> load coast % load and plot coastlines • >> plotm(lat, long) • Example: • >> h = worldmap('Europe') % create a new map axes for Europe • >> % and add data to the map • >> geoshow('landareas.shp', 'FaceColor', [0.15 0.5 0.15]) • >> geoshow('worldlakes.shp', 'FaceColor', 'cyan') • >> geoshow('worldrivers.shp', 'Color', 'blue') • >> geoshow('worldcities.shp', 'Marker', '.', 'MarkerEdgeColor', 'red')
Image Processing/Analysis Mapping Toolbox/Getting Started/Your First Maps • The Map Viewer is an interactive tool for browsing map data • Example: • >> mapview • >> % To import Mapping Toolbox demo data, change directory to: • >> cd(fullfile(matlabroot,'toolbox','map','mapdemos')) • >> % (can also get here by navigating to 'toolbox/map/mapdemos') • >> % Import a vector data layer • >> boston_roads = shaperead('boston_roads.shp'); • ...
Image 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: • >> lat = [45.6 -23.47 78]; long = [13 -97.45 165];
Quanset Nurseries Unable to gauge Margaret's Brook (velocity only) Zylfee Brook (velocity only) TBD Isaac's Brook gauge Sylvan Nurseries Zylfee Brook gauge Fresh Pond (velocity only) Tide gauge (still need datum) Current Inlet (approximate location) Water Column sampling Inlet does not connect to this channel Audubon Field Station Image Processing/Analysis Mapping Toolbox Example: Allens Pond Nutrient Loading / Tidal Flushing Study Case Studies in Estuarine Dynamics (MAR620), Spring 2008
Image Processing/Analysis Mapping Toolbox Example: Allens Pond Nutrient Loading / Tidal Flushing Study Case Studies in Estuarine Dynamics (MAR620), Spring 2008
Image Processing/Analysis Mapping Toolbox Example: Allens Pond Nutrient Loading / Tidal Flushing Study Case Studies in Estuarine Dynamics (MAR620), Spring 2008
Image Processing/Analysis Mapping Toolbox Example: Allens Pond Nutrient Loading / Tidal Flushing Study Case Studies in Estuarine Dynamics (MAR620), Spring 2008
Image Processing/Analysis Mapping Toolbox Example: Allens Pond Nutrient Loading / Tidal Flushing Study Case Studies in Estuarine Dynamics (MAR620), Spring 2008
Image Processing/Analysis Mapping Toolbox Example: Allens Pond Nutrient Loading / Tidal Flushing Study Case Studies in Estuarine Dynamics (MAR620), Spring 2008
Image Processing/Analysis Mapping Toolbox • Useful Tidbits: • Mass GIS website: http://www.mass.gov/mgis/massgis.htm