Environmental Engineering Reference
In-Depth Information
Fig. 17.1 The MATLAB
file-select box for graphic files
®
The output of the uiget le command is the filename, which is stored in the
variable in le . The second output is the directory path of the graphics file, stored in
the variable path . Both these text strings are concatenated in the second command
by using strcat . The initial length lx and width ly scale of the image are set to
1,000. The imread demands the chosen file to be read.
After reading into the workspace, the image file is represented by two variables,
X and map . X contains the color information for each pixel and map the colormap
information. The dimension of X is 3; the content of the first and second entries
is equal to the corresponding pixel-numbers of the image. For RGB color images, the
third dimension is 3 because the color information is internally represented by three
color values. Altogether there is thus one R, one G and one B value for every pixel.
For those modelers wishing to work extensively with graphic files,
it
is
recommended to study the information in the MATLAB
help, the various types
of image representation and the various corresponding commands for input, output,
display and conversion. Using the imread command all standard type bitmap images
can be read by MATLAB
®
,suchas'bmp','cur','gif','ico','jpg','jpeg','pbm',
'pcx', 'pgm', 'png', 'pnm', 'ppm', 'ras', 'tif', 'tiff', and 'xwd'. The complete list of
formats is found in the MATLAB
®
help.
With the imagesc command the map is displayed in the figure that was opened
before. The following final commands of the presented sequence manipulate the
outlook of the coordinate axes.
®
17.3 Geo-Referencing
When the map appears on the display, the user may like to have the real world
coordinates displayed on the axes. The real world coordinates are of course not
unique. Very often the origin is chosen in the lower left or upper left corner of the
Search WWH ::




Custom Search