IMAGES SPATIAL DATA AND MATLAB Data types and

IMAGES, SPATIAL DATA AND MATLAB

Data types and storage: Vector data- making polygons, outlines, like coastline

Data types and storage: � � Raster data, 2 D arrays, gridded data Color, or rainfall, or elevation

Raster data storage � � � 2 d data Computer stores data as bits (ones and zeros) 1 -bit array Ex: (1=white, 0=black) More complex data: eight bits=byte 1 byte=28=256 possibilities => gray scale with 256 intensities of black to white, or 256 values of a colorscale (use colormaps) Still not good enough for good maps… � 24 -bit system; 8 bits for each RGB channel=2563=16, 777, 216 colors � 24 bit storage requires lots of memory!!!

Data formats: � Compuserve Graphics Interchange Format (GIF): � � Microsoft Windows Bitmap Format (BMP) � � 256 colors, Compression without data loss-Designed for fast transfer over the internet, Good for line art, simple maps, cartoons, logos Native bitmap format for Windows OS, Converters exist to read and write BMP files on other platforms Tagged Image File Format (TIFF) Includes an image file header, a drectory, and the data in all available graphics and image file formats; Vector and raster versions; Designed to be very portable- any computer platform BUT, evolution caused incompatibilites…Thousands of Incompatible File Formats � � PICT � Apple; Rasters and vectors; PICT not supported by other platforms

Data formats, con’t: � Post. Script (PS) Encapsulated Post. Script (EPS) Xerox/ Aldus (Adobe)/Apple; Vector format � PS-generally single-page format, illustration of a text � EPS- included in other pages, contain combination of text, graphics, and images � � Joint Photographic Experts Group (JPEG) � � Image compression and format; Irreversible compression (data lost); Three channel- 24 bit true color Portable Document Format (PDF) � Adobe; Cross-platform; Contains complete formatting of vector illustrations, raster images, and text; Highly compressed; Fast internet download

Importing, Processing, Exporting Images lab activity: � http: //asterweb. jpl. nasa. gov/gallerymap. asp � Make new directory in your matlab space Download and save image �

Importing, Processing, Exporting Images, con’t � � � � On command line …. ( pg 231) Picture 1=imread(‘name of image. jpg’); imshow (Picture 1); Picture. Gray=rgb 2 gray (Picture 1); imshow (Picture 1), figure, imshow(Picture. Gray); Follow remaining instruction on pg 233 -235 NOTE there is a TYPO in Book: iminfo (‘Picture. Gray. jpg’); To hand in: the 3 images (rgb, grayscale, and indexed rgb)

Spatial Data � Raster data: Digital Elevation maps ETOPO 1: 1 arc minute resolution � GTOPO 30: 30 arc seconds (~1 km) resolution � Shuttle Radar Topography Mission (SRTM) 30, 90 m res. �

Spatial Data � Raster data: ETOPO 1 � http: //www. ngdc. noaa. gov/mgg/fliers/01 mgg 04. html � � � � Custom grids- ngdc Your grid ID: you pick a name, like mygrid 01 Grid databas: ETOPO 1 Latitude 30 E 60 E Longitude 20 N 20 S Grid Cell size 1 min Grid Format ASCII raster SUBMIT � � � w/software, w/ geography, w/coastline Compress and retrieve …wait while it processes…. Retrieve …wait while it downloads…. � � Save your data in a folder that matlab sees decompress (unzip)

Spatial Data, con’t � Let’s look at the data and header info � On command line of terminal window type !head My. Grid 01. asc (or whateer the name of your data) � You are now viewing the first few lines of the data that you imported � You want to plot the data, so you have to remove the header info from your data file: New. My. Grid=dlmread(‘My. Grid. asc’, ’’, 6, 0); � Now save your new data file save new. My. Grid. mat New. My. Grid � � � Now follow the directions from page 169 -171 With the same data, modify script on page 172
- Slides: 11