[Classification of Digital Image Processing (B)] of the image

In the computer, in accordance with the color and gradation number capable of dividing an image into a gray image , binary image , index image , and an RGB image are four basic types. In the computer, typically in the form of an array (or matrix) of stored images.

Grayscale image:

  • Gray-scale image matrix elements in the range of usually [0, 255].

    So its data type is generally 8-bit unsigned integer [ uint8 ], 256 grayscale image which is often referred to. "0" indicates pure black, "255" indicates pure white. Middle number indicates the transition from small to large color from black to white.

  • however. In some areas (such as medical imaging), requested exceeds [ uint8 ] dynamic range. Will use [ uint16 ] and [ int16 ] data types.
  • An operation for calculating the gradation (such as Fourier transformation). Use [ double ] and [ single ] Type; [assumed that the image is double ] or [ single ] data type. Value of the gradation image is typically normalized standard orientation within the range [0-1], 0 for black and 1 for white . Decimal between 0 and 1 represent different shades of gray.

    Binary image can be seen as a special case of the grayscale image.

    ( Note : the type of image data and the image type are totally different concepts, the former representative image is the image itself which only is stored on the computer only.)

Binary image:

  • A two-dimensional matrix of binary image consists of only two values, 0, "0" represents black and "1" generation of white.

    Since each pixel (each element of the matrix) of two possible values ​​0 only, the computer data type binary image is typically a bit.

  • In MATLAB, the binary image has a very special meaning. Only the logical data type [] was only logical that is a binary image, even if only the array containing the data classes 0 and 1 (such as uint8 []), that is not in MATLAB binary image.

    Possible to use other kinds of logical array into a binary image: B = logical (A)


Index image :

  • Index image comprising a data matrix X- . A color image matrix the Map . Which comprises three Map is a data array of a plurality of rows. Which are values of each element [0, 1] double-precision floating-point data between.

    Map each row of the matrix represent the red, green and blue color values. In MATLAB, the index image is a value from the pixel values ​​to colormap "direct mapping." Color pixel data matrix X as the matrix Map index index points, for example, a point value of the first row of the matrix Map. Value of 2 refers to the second row, and so on.

  • Usually the index image only 256 colors can be displayed (in the range determined by the data matrix X), is different from the gray scale image, the gradation value of the color image of the table is from 0 to 255 continuous values, the gray scale image that data we can be seen as an actual pixel value. It can also be seen as an index value.
  • FIG index of strengths required storage capacity is small . And the index image is generally relatively simple color requirements for storing images, such as Windows, wallpaper colors constituting relatively simple to use more storage index image, the color assumed that the image is more complex, it is necessary to use RGB true color images.
 
         

RBG map image:

  • RGB image and the image as the index can be used to represent color images. As with indexed images. Which are red (R), green (G), blue (B) three primary colors represented by a combination of the color of each pixel. However, different from the index image is a color image the RGB values ​​for each pixel (represented by the three primary colors RGB) directly stored in the image matrix.
  • Because the color of each pixel is represented by the need to R, G, B three components, one needs three size M * N matrix of size M * N to RGB representation. Each matrix representing a color channel.

    RGB image data of the type generally [ uint ] data type (can also be [ double ]). Through storage and often used for representing true color images (with 2 ^ 24 colors), of course, capable of storing a gray scale image (assuming 3 values are the same channels. Compared grayscale image).

     

  • In operation with 3 channels cat MATLAB synthesized color image: rab_image = cat (3, R, G, B);
  • These commands can be extracted using the following three channels of an image:
    • R = rgb_image(:。:。1);
    • G = rgb_image(:。:,2);
    • B = rgb_image(:,:,3);














Guess you like

Origin www.cnblogs.com/mqxnongmin/p/10941601.html