Saturday, May 11, 2013

IMAGE TYPES AND CONVERSIONS

Unknown | 12:50 PM |

 
IMAGE TYPES
The Image Processing Toolbox supports four basic types of images:
  • Binary images
  • grayscale images
  • Indexed images
  • RGB images
This section discusses how MATLAB and the Image Processing Toolbox represent each of these image types.

Binary images
  • In a binary image, each pixel assumes one of only two discrete values.
  • Essentially, these two values correspond to on and off.
  • A binary image is stored as a two-dimensional matrix of 0’s (off pixels) and 1’s (on pixels).
  • Each pixel is just black or white. Since there are only two possible values for each pixel (0,1), we only need one bit per pixel.
  • Binary images are often created from gray-scale images via a threshold operation.
  • White (‘1’) if pixel value is larger than threshold.
  • Black (‘0’) if it is less.
  • A binary image is a digital image that has only two possible values for each pixel
  • Binary images are also called bi-level or two-level
  • A binary image is usually stored in memory as a bitmap, a packed array of bits
  • Binary images often arise in digital image processing as masks or as the result of certain operations such as segmentation, thresholding.
clip_image002
grayscale images

  • Also referred to as monochrome or one-color images.
  • Contain only brightness information. No color information.
  • Typically contain 8 bits/pixel data, which corresponds to 256 (0 to 255) different brightness (gray) levels
  • Why 8 bits/pixel?
                 Provides more than adequate brightness resolution.
                 Provides a “noise margin” by allowing approximately twice gray levels as  
                 required     
                 Byte (8-bits) is the standard small unit in computers
  • However, there are applications such as medical imaging or astronomy that requires 12 or 16 bits/pixel.
                 Useful when a small section of the image is enlarged.
                 Allows the user to repeatedly zoom a specific area in the image.
  • MATLAB stores an intensity image as a single matrix, with each element of the matrix corresponding to one image pixel.
  • The matrix can be of class double, in which case it contains values in the range [0,1], or of class uint8, in which case the data range is [0,255] (0 – black, 255 – white).
clip_image004
Indexed images
  • An indexed image consists of two arrays, an image matrix and a colormap.
  • The colormap is an ordered set of values that represent the colors in the image.
  • For each image pixel, the image matrix contains a value that is an index into the colormap.
  • The colormap is an m-by-3 matrix of class double. Each row of the colormap matrix specifies the red, green, and blue (RGB) values for a single color:
  • An indexed image is where the pixel values are indices to elements in a colour map or colour lookup table.
  • The colour map will contain entries corresponding to red, green and blue intensities for each index in the image.
clip_image006

RGB images
  • Like an indexed image, an RGB image represents each pixel color as a set of three values, representing the red, green, and blue intensities that make up the color.
  • Unlike an indexed image, however, these intensity values are stored directly in the image array, not indirectly in a colormap
  • In MATLAB, the red, green, and blue components of an RGB image reside in a single m-by-n-by-3 array.
  • m and n are the numbers of rows and columns of pixels in the image, and the third dimension consists of three planes, containing red, green, and blue intensity values.
  • For each pixel in the image, the red, green, and blue elements combine to create the pixel’s actual color.
 clip_image008
clip_image010

No comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

Search

Infolinks In Text Ads

Total Pageviews

Subscribe here

Enter your email address:

Delivered by FeedBurner