Geoscience Reference
In-Depth Information
Hence, the command imfinfo can be used to obtain useful information
(name, size, format, and color type) concerning the newly-created image i le.
h ere are many ways of transforming the original satellite image into
a practical i le format. h e image data could, for instance, be stored as an
indexed color image , which consists of two parts: a colormap array and a
data array. h e colormap array is an m -by-3 array containing l oating-point
values between 0 and 1. Each column specii es the intensity of the red, green
and blue colors. h e data array is an x -by- y array containing integer elements
corresponding to the lines m of the colormap array, i.e., the specii c RGB
representation of a certain color. Let us transfer the above RGB image into
an indexed image. h e colormap of the image should contain 16 dif erent
colors. h e result of
[I4,map] = rgb2ind(I1,16);
imshow(I1), figure, imshow(I4,map)
saved as another JPEG i le using
imwrite(I4,map,'unconform_ind.jpg')
clearly shows the dif erence between the original 24-bit RGB image (256 3 or
about 16.7 million dif erent colors) and a color image of only 16 dif erent
colors. h e display of the image uses the default colormap of MATLAB.
Typing
imshow(I4,map)
cmap = colormap
actually retrieves the 16-by-3 array of the current colormap
cmap =
0.0588 0.0275 0.0745
0.5490 0.5255 0.4588
0.7373 0.7922 0.7020
0.3216 0.2706 0.2667
0.6471 0.6784 0.6157
0.7961 0.8549 0.9176
0.4510 0.3922 0.3333
0.2000 0.1451 0.1451
0.4824 0.5412 0.5843
0.4039 0.4078 0.4784
0.6667 0.7020 0.7451
0.8980 0.8745 0.7255
0.2824 0.2902 0.4039
0.9569 0.9647 0.9608
0.1765 0.1686 0.2902
0.5843 0.5843 0.6078
Search WWH ::




Custom Search