Page 201 - MATLAB Recipes for Earth Sciences
P. 201

196                                                 8 Image Processing

            map is an m-by-3 array of real numbers between 0.0 and 1.0. Each row is a

            RGB vector that defines one color by means of intensities of red, green and
            blue. Numerous global colormaps for the interpretation of 8-bit color im-
            ages exist that allow the cross-platform exchange of raster images, whereas
            local colormaps are often embedded in a graphics fi le.
               The disadvantage of 8-bit color images is that the 256 discrete colorsteps
            are not enough to simulate smooth transitions for the human eye. Therefore,
            in many applications a 24-bit system is used with 8 bits of data for each
              RGB channel giving a total of 256 =16,777,216 colors. Such a 24-bit image
                                          3
            is therefore stored in three 2D arrays or one 3D array of   intensity values
            between 0 and 255.
               195  189  203  217  217  221
               218  209  187  192  204  206
               207  219  212  198  188  190
               203  205  202  202  191  201
               190  192  193  191  184  190
               186  179  178  182  180  169

               209  203  217  232  232  236
               234  225  203  208  220  220
               224  235  229  214  204  205
               223  222  222  219  208  216
               209  212  213  211  203  206
               206  199  199  203  201  187
               174  168  182  199  199  203
               198  189  167  172  184  185
               188  199  193  178  168  172
               186  186  185  183  174  185
               177  177  178  176  171  177
               179  171  168  170  170  163

            Compared to 1-bit and 8-bit representation of raster data, the 24-bit stor-
            age certainly requires a lot more computer memory. In the case of very
            large data sets such as satellite images and digital elevation models the user
            should therefore carefully think about the suitable way to store the data.
            The default data type in MATLAB is the 64-bit array which allows to store

            the sign of a number (first bit), the exponent (bits 2 to 12) and roughly 16
            significant decimals digits in the range of roughly 10 -308  and 10 +308  (bits 13

            to 64). However, MATLAB also works with other data types such as 1-bit,
            8-bit and 24-bit raster data to save memory.
               The amount of memory required for storing an image depends on the data
            type and the raster dimension. The dimension of an image can be described
            by the numbers of pixels, which is the number of rows multiplied by the
            number of columns of the 2D array. Assume an image of 729x713 pixels, as
   196   197   198   199   200   201   202   203   204   205   206