ch1-introduction to digital image

Upload: mahmoud-awney

Post on 06-Apr-2018

232 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 Ch1-Introduction to Digital Image

    1/28

    Chapter 1: Introduction to Digital Image Processing 1

    1-Introduction:

    Human beings are predominantly visual creatures: we rely heavily on our vision

    to make sense of the world around us.

    We not only look at things to identify and classify them, but we can scan for

    differences, and obtain an overall rough "feeling" for a scene with a quick glance.

    Humans have evolved very precise visual skills:

    we can identify a face in an instant;

    we can differentiate colours;

    we can process a large amount of visual information very quickly.

    2-What is Digital Image Processing?

    Image processing involves changing the nature of an image in order to either:1. Improve its pictorial information for human interpretation.2. Render it more suitable for autonomous machine perception.We shall be concerned with digital image processing, which involves using a

    computer to change the nature of a digital image.

    It is necessary to realize that these two aspects represent two separate but equally

    important aspects of image processing.

    A procedure which satisfies condition (1) (a procedure which makes an image

    look better) may be the very worst procedure for satisfying condition (2).

    Humans like their images to be sharp, clear and detailed; machines prefer their

    images to be simple and uncluttered.

    2-1-Examples of improve the pictorial information on an image

    1-Enhancing the edges of an image to make it appear sharper

    An example is shown in Figure 1.1.

    Note how the second image appears cleaner; it is a more pleasant image.

    Sharpening edges is a vital component of printing: in order for an image to appear

    at its best on the printed page; some sharpening is usually performed.

    2-Removing _noise_ from an image.Noise being random errors in the image.

    An example is given in Figure 1.2.Noise is a very common problem in data transmission: all sorts of electronic

    components may affect data passing through them, and the results may be

    undesirable.

    As we shall see, noise may take many different forms; each type of noiserequiring a different method of removal.

  • 8/3/2019 Ch1-Introduction to Digital Image

    2/28

    Chapter 1: Introduction to Digital Image Processing 2

    (a) The Original Image (b) Result after sharpeningFigure 1.1: Image sharpening

    (a) The Original Image (b) After removing noise

    Figure 1.2: Removing noise from an image

    3-Removing motion blur from an image.

    An example is given in Figure 1.3.Note that in the deblurred image (b) it is easier to read the numberplate, and to

    see the spikes on the fence behind the car, as well as other details not at all clear

    in the original image (a).Motion blur may occur when the shutter speed of the camera is too long for the

    speed of the object.

    In photographs of fast moving objects: athletes, vehicles for example, the

    problem of blur may be considerable.

  • 8/3/2019 Ch1-Introduction to Digital Image

    3/28

    Chapter 1: Introduction to Digital Image Processing 3

    (a) The Original Image (b) After removing the blur

    Figure 1.3: Image deblurring

    2-2-Examples of processing for autonomous machine perception.

    1-Obtaining the edges of an image.

    This may be necessary for the measurement of objects in an image; an example is

    shown in Figures 1.4.

    Once we have the edges we can measure their spread, and the area contained

    within them.We can also use edge detection algorithms as a first step in edge enhancement, as

    we saw above.From the edge result, we see that it may be necessary to enhance the original

    image slightly, to make the edges clearer.

    (a) The Original Imag (b) Its edge image

    Figure 1.4: Finding edges in an image

    2-Removing detail from an image.For measurement or counting purposes, we may not be interested in all the detail

    in an image.

    For example, a machine inspected items on an assembly line, the only matters of

    interest may be shape, size or colour.

  • 8/3/2019 Ch1-Introduction to Digital Image

    4/28

    Chapter 1: Introduction to Digital Image Processing 4

    For such cases, we might want to simplify the image.

    3- Image Acquisition and sampling

    Sampling refers to the process of digitizing a continuous function.

    For example, suppose we take the function:

    )x3sin(3

    1

    )xsin()x(y + and sample it at ten evenly spaced values of x only.

    The resulting sample points are shown in Figure 1.5.

    Figure (1.5) Sampling a function

    Undersampling

    Figure (1.6) Sampling a function with

    more points.

    This shows an example of undersampling, where the number of points is notsufficient to reconstruct the function.

    Suppose we sample the function at 100 points, as shown in Figure 1.6.

    We can clearly now reconstruct the function; all its properties can be determined

    from this sampling.In order to ensure that we have enough sample points, we require that the

    sampling period is not greater than one-half the finest detail in our function.

    This is known as the Nyquistcriterion, and can be formulated more precisely interms of "frequencies".

    The Nyquist criterion can be stated as the sampling theorem, which says, in

    effect, that a continuous function can be reconstructed from its samples provided

    that the sampling frequency is at least twice the maximum frequency in the

    function.

    Sampling an image again requires that we consider the Nyquist criterion, when

    we consider an image as a continuous function of two variables, and we wish to

    sample it to produce a digital image.

    An example is shown in Figure 1.7 where an image is shown, and then with anundersampled version.

    The jagged edges in the undersampled image are examples of aliasing.The sampling rate will of course affect the final resolution of the image; we

    discuss this below.

  • 8/3/2019 Ch1-Introduction to Digital Image

    5/28

    Chapter 1: Introduction to Digital Image Processing 5

    In order to obtain a sampled (digital) image, we may start with a continuousrepresentation of a scene.

    To view the scene, we record the energy reflected from it.

    We may use visible light, or some other energy source.

    Correct sampling; no aliasing An undersampled version with aliasing

    Figure 1.7: Effects of sampling

    3-1-Using light

    Light is the predominant energy source for images; simply because it is the

    energy source which human beings can observe directly.

    We are all familiar with photographs, which are a pictorial record of a visual

    scene.

    Many digital images are captured using visible light as the energy source; this has

    the advantage of being safe, cheap, easily detected and readily processed with

    suitable hardware.

    Two very popularmethods of producing a digital image are with a digital cameraor a flat-bed scanner.

    3-2-Digital camera, CCD.Such a camera has, in place of the usual film, an array of photosites; these aresilicon electronic devices whose voltage output is proportional to the intensity of

    light falling on them.

    For a camera attached to a computer, information from the photosites is then

    output to a suitable storage medium.

    Generally this is done on hardware, as being much faster and more efficient than

    software, using a frame-grabbing card.

    This allows a large number of images to be captured in a very short time, in the

    order of one ten-thousandth of a second each.The images can then be copied onto a permanent storage device at some later

    time.

    This is shown schematically in Figure 1.8.

  • 8/3/2019 Ch1-Introduction to Digital Image

    6/28

    Chapter 1: Introduction to Digital Image Processing 6

    The output will be an array of values, each representing a sampled point from theoriginal scene.

    The elements of this array are called picture elements, or more simply pixels.

    Digital still cameras use a range of devices, from floppy discs and CD's, to

    various specialized cards and "memory sticks".

    The information can then be downloaded from these devices to a computer hard

    disk.

    Figure (1.8) Capturing an image with a CCD array

    3-3-Flat bed scanner

    This works on a principle similar to the CCD camera.

    Instead of the entire image being captured at once on a large array, a single row

    of photosites is moved across the image, capturing it row-by-row as it moves.This is shown schematically in Figure 1.9.

    Figure (1.9) Capturing an image with a CCD scanner

    Since this is a much slower process than taking a picture with a camera, it is quitereasonable to allow all capture and storage to be processed by suitable software.

  • 8/3/2019 Ch1-Introduction to Digital Image

    7/28

    Chapter 1: Introduction to Digital Image Processing 7

    3-4-Other energy sources

    Although light is popular and easy to use, other energy sources may be used to

    create a digital image.

    Visible light is part of the electromagnetic spectrum: radiation in which the

    energy takes the form of waves of varying wavelength.

    These range from cosmic rays of very short wavelength, to electric power, which

    has very long wavelength.

    Figure 1.10 illustrates this. For microscopy, we may use x-rays, or electron

    beams.

    Figure (1.10) The electromagnetic spectrum

    As we can see from Figure 1.10, x-rays have a shorter wavelength than visiblelight, and so can be used to resolve smaller objects than are possible with visible

    light.

    X-rays are of course also useful in determining the structure of objects usually

    hidden from view: such as bones.A further method of obtaining images is by the use of X-ray tomography, where

    an object is encircled by an x-ray beam.As the beam is fired through the object, it is detected on the other side of the

    object, as shown in Figure 1.11.As the beam moves around the object, an image of the object can be constructed;

    such an image is called a tomogram.

    In a CAT (Computed Axial Tomography) scan, the patient lies within a tube

    around which x-ray beams are fired.

    This enables a large number of tomographic "slices" to be formed, which can

    then be joined to produce a three-dimensional image.

  • 8/3/2019 Ch1-Introduction to Digital Image

    8/28

    Chapter 1: Introduction to Digital Image Processing 8

    Figure (1.11) X-ray tomography

    4-What Is A Digital Image?

    Suppose we take an image, a photo, say. For the moment, lets make things easy

    and suppose the photo is monochromatic (that is, shades of grey only), so no

    colour.

    We may consider this image as being a two dimensional function, where the

    function values give the brightness of the image at any given point, as shown inFigure 1.12.

    We may assume that in such an image brightness values can be any real numbers

    in the range 0.0 (black) to 1.0 (white).

    The ranges of x and y will clearly depend on the image, but they can take all realvalues between their minima and maxima.

    Such a function can of course be plotted, as shown in Figure 1.13.

    However, such a plot is of limited use to us in terms of image analysis.

    The concept of an image as a function, however, will be vital for the development

    and implementation of image processing techniques.A digital image differs from a photo in that the x, y, and f (x,y) values are all

    discrete.

    Usually they take on only integer values, so the image shown in Figure 1.12 willhave x and y ranging from 1 to 256 each, and the brightness values also ranging

    from 0 (black) to 255 (white).

    A digital image, as we have seen above, can be considered as a large array of

    sampled points from the continuous image, each of which has a particular

    quantized brightness.

    These points are the pixels which constitute the digital image.

  • 8/3/2019 Ch1-Introduction to Digital Image

    9/28

    Chapter 1: Introduction to Digital Image Processing 9

    Figure (1.12) An image as a function

    Figure (1.13) The image of Figure 1.12 plotted as a function of two variables

    The pixels surrounding a given pixel constitute its neighbourhood.

    A neighbourhood can be characterized by its shape in the same way as a matrix:

    we can speak, for example, of a 3 x 3 neighbourhood, or of a 5 x 7

    neighbourhood.

    Except in very special circumstances, neighbourhoods have odd numbers of rows

    and columns.

    This ensures that the current pixel is in the centre of the neighbourhood.

    An example of a neighbourhood is given in Figure 1.14.

    If a neighbourhood has an even number of rows or columns (or both), it may be

    necessary to specify which pixel in the neighbourhood is the "current pixel".

  • 8/3/2019 Ch1-Introduction to Digital Image

    10/28

    Chapter 1: Introduction to Digital Image Processing 10

    Figure (1.14) Pixels, with a neighbourhood

    5-Some applications

    Image processing has an enormous range of applications; almost every area of

    science and technology can make use of image processing methods.

    Here is a short list just to give some indication of the range of image processing

    applications.

    5-1- Medicine

    Inspection and interpretation of images obtained from X-rays, MRI or CATscans.

    Analysis of cell images, of chromosome karyotypes

    5-2- Agriculture

    Satellite/aerial views of land, for example to determine how much land is being

    used for different purposes, or to investigate the suitability of different regions for

    different crops.Inspection of fruit and vegetables, distinguishing good and fresh produce from

    old.

    5-3- Industry

    Automatic inspection of items on a production line.

    Inspection of paper samples.

    5-4- Law enforcement

    Fingerprint analysis, and

    Sharpening or de-blurring of speed-camera images.

    6- Aspects of image processing

    It is convenient to subdivide different image processing algorithms into broad

    subclasses.

  • 8/3/2019 Ch1-Introduction to Digital Image

    11/28

    Chapter 1: Introduction to Digital Image Processing 11

    There are different algorithms for different tasks and problems, and often wewould like to distinguish the nature of the task at hand.

    6-1-Image enhancement.

    This refers to processing an image so that the result is more suitable for a

    particular application. Examples include:

    1. Sharpening or de-blurring an out of focus image,2. Highlighting edges.3. Improving image contrast, or brightening an image.4. Removing noise.

    6-2-Image restoration.

    This may be considered as reversing the damage done to an image by a known

    cause, for example:

    1. Removing of blur caused by linear motion.2. Removal of optical distortions.3. Removing periodic interference.

    6-3-Image segmentation

    This involves subdividing an image into constituent parts, or isolating certain

    aspects of an image as:

    1. Finding lines, circles, or particular shapes in an image.2. In an aerial photograph, identifying cars, trees, buildings, or roads.These classes are not disjoint; a given algorithm may be used for both image

    enhancement or for image restoration.

    However, we should be able to decide what it is that we are trying to do with our

    image: simply make it look better (enhancement), or removing damage

    (restoration).

    7-An image processing task

    We will look in some detail at a particular real-world task, and see how the above

    classes may be used to describe the various stages in performing this task.The job is to obtain, by an automatic process, the postcodes from envelopes.

    Here is how this may be accomplished:

    7-1-Acquiring the image

    First we need to produce a digital image from a paper envelope.

    This is done using either a CCD camera, or a scanner.

    7-2-Preprocessing.

    This is the step taken before the "major" image processing task.

    The problem here is to perform some basic tasks in order to render the resultingimage more suitable for the job to follow.

    In this case, it may involve enhancing the contrast, removing noise, or identifying

    regions likely to contain the postcode.

  • 8/3/2019 Ch1-Introduction to Digital Image

    12/28

    Chapter 1: Introduction to Digital Image Processing 12

    7-3-Segmentation.

    Here is where we actually "get" the postcode; in other words we extract from the

    image that part of it which contains just the postcode.

    7-4-Representation and description.

    These terms refer to extracting the particular features which allow us to

    differentiate between objects.

    Here we will be looking for curves, holes and corners which allow us to

    distinguish the different digits which constitute a postcode.

    7-5 Recognition and interpretation.

    This means assigning labels to objects based on their descriptors (from the

    previous step), and assigning meanings to those labels.

    So we identify particular digits, and we interpret a string of four digits at the end

    of the address as the postcode.

    8-Representing Digital Images

    The result of sampling and quantization is a matrix of real numbers.

    We will use two principal ways to represent digital images.

    Assume that an image f(x,y) is sampled so that the resulting digital image has M

    rows and N columns as shown in Figure (1.15).

    Figure 1.15 The 2-D Cartesian coordinate space of an M x N digital image

    The values of the coordinates (x,y) now become discrete quantities.

    For notational clarity and convenience, we shall use integer values for these

    discrete coordinates.Thus, the values of the coordinates at the origin are (x, y) = (0,0).

    The next coordinate values along the first row of the image are represented as (x,

    y) = (0,1).

  • 8/3/2019 Ch1-Introduction to Digital Image

    13/28

    Chapter 1: Introduction to Digital Image Processing 13

    It is important to keep in mind that the notation (1,1) is used to signify the secondsample along the first row.

    It does not mean that these are the actual values of physical coordinates when the

    image was sampled.

    Figure 1.16 shows the coordinate convention used.

    The notation introduced allows us to write the complete M x N digital image in

    the following compact matrix form:

    The right side of this equation is by definition a digital image.

    Each element of this matrix array is called an image element, picture element,pixel, or pel.

    Figure (1.16) Coordinate convention used to represent digital images.

    It is advantageous to use a more traditional matrix notation to denote a digitalimage and its elements:

    This digitization process requires decisions about values for M, N, and for the

    number, L, of discrete gray levels allowed for each pixel.

    There are no requirements on M and N, other than that they have to be positive

    integers.

  • 8/3/2019 Ch1-Introduction to Digital Image

    14/28

    Chapter 1: Introduction to Digital Image Processing 14

    However, due to processing, storage, and sampling hardware considerations, thenumber of gray levels typically is an integer power of 2:

    k2L =

    We assume that the discrete levels are equally spaced and that they are integers in

    the interval [0, L-1].Sometimes the range of values spanned by the gray scale is called the dynamic

    range of an image, and we refer to images whose gray levels span a significantportion of the gray scale as having a high dynamic range.

    When an appreciable number of pixels exhibit this property, the image will have

    high contrast.

    Conversely, an image with low dynamic range tends to have a dull, washed outgray look.

    The number, b, of bits required to store a digitized image is:

    kNMb When M = N, for a square image, this equation becomes:

    kNb2

    When an image can have 2k

    gray levels, it is common practice to refer to the

    image as "k-bit image."

    For example, an image with 256 possible gray-level values is called an 8-bit

    image.

    8-1- Image colour

    An image contains one or more colour channels that define the intensity or colour

    at a particular pixel location f(m,n).

    In the simplest case, each pixel location only contains a single numerical value

    representing the signal level at that point in the image.

    The conversion from this set of numbers to an actual (displayed) image is

    achieved through a colour map.

    A colour map assigns a specific shade of colour to each numerical level in the

    image to give a visual representation of the data.

    The most common colour map is the greyscale, which assigns all shades of grey

    from black (zero) to white (maximum) according to the signal level.

    The greyscale is particularly well suited to intensity images, namely imageswhich express only the intensity of the signal as a single value at each point in

    the region.

    In certain instances, it can be better to display intensity images using a false-

    colour map.

    One of the main motives behind the use of false-colour display rests on the fact

    that the human visual system is only sensitive to approximately 40 shades ofgrey in the range from black to white, whereas our sensitivity to colouris much

    finer.

    False colour can also serve to accentuate or delineate certain features orstructures, making them easier to identify for the human observer. This approach

    is often taken in medical and astronomical images.

  • 8/3/2019 Ch1-Introduction to Digital Image

    15/28

    Chapter 1: Introduction to Digital Image Processing 15

    Figure 1.17 shows an astronomical intensity image displayed using bothgreyscale and a particular false-colour map.

    In this example the jet colour map (as defined in Matlab) has been used tohighlight the structure and finer detail of the image to the human viewer using

    a linear colour scale ranging from dark blue (low intensity values) to dark red

    (high intensity values).

    (a) Greyscale (b) false colour

    Figure 1.17 Example of grayscale (left) and false colour (right) image display

    The definition of colour maps, i.e. assigning colours to numerical values, can be

    done in any way which the user finds meaningful or useful.

    Although the mapping between the numerical intensity value and the colour or

    greyscale shade is typically linear, there are situations in which a nonlinear

    mapping between them is more appropriate.In addition to greyscale images where we have a single numerical value at each

    pixel location, we also have true colour images where the full spectrum of

    colours can be represented as a triplet vector, typically the (R,G,B) components

    at each pixel location.

    Here, the colour is represented as a linear combination of the basis colours or

    values and the image may be considered as consisting ofthree 2-D planes.

    Other representations of colour are also possible and used quite widely, such as

    the (H,S,V) (hue, saturation and value (or intensity)).

    In this representation, the intensity V of the colour is decoupled from thechromatic information, which is contained within the H and S components.

    9- Resolution and quantization

    The size of the 2-D pixel grid together with the data size stored for each

    individual image pixel determines the spatial resolution and colour

    quantization of the image.

    The representational power (or size) of an image is defined by its resolution.

    The resolution of an image source (e.g. a camera) can be specified in terms of

    three quantities:

    9-1-Spatial Resolution:

    The column (C) by row (R) dimensions of the image define the number of

    pixels used to cover the visual space captured by the image.

  • 8/3/2019 Ch1-Introduction to Digital Image

    16/28

    Chapter 1: Introduction to Digital Image Processing 16

    This relates to the sampling of the image signal and is sometimes referred to asthe pixel or digital resolution of the image.

    It is commonly quoted as C x R (e.g. 640 x 480, 800 x 600, 1024 x 768, etc.)

    9-2-Temporal resolution.

    For a continuous capture system such as video, this is the number of images

    captured in a given time period.

    It is commonly quoted in frames per second (fps), where each individual image

    is referred to as a video frame (e.g. commonly broadcast TV operates at 25 fps;2530 fps is suitable for most visual surveillance; higher frame-rate cameras are

    available for specialist science/engineering capture.

    9-3-Bit resolution.

    This defines the number of possible intensity/colour values that a pixel may

    have and relates to the quantization of the image information.For instance a binary image has just two colours (black or white).

    A grey-scale image commonly has 256 different grey levels ranging from black

    to white

    Whilst for a colour image it depends on the colour range in use.

    The bit resolution is commonly quoted as the number of binary bits required

    for storage at a given quantization level, e.g. binary is 2 bit, grey-scale is 8 bit

    and colour (most commonly) is 24 bit.

    The range of values a pixel may take is often referred to as the dynamic range of

    an image.

    10- Image formats.

    From a mathematical viewpoint, any meaningful 2-D array of numbers can be

    considered as an image.

    In the real world, we need to effectively display images, store them (preferably

    compactly), transmit them over networks and recognize bodies of numerical data

    as corresponding to images.

    This has led to the development of standard digital image formats.

    In simple terms, the image formats comprise a file header (containinginformation on how exactly the image data is stored) and the actual numeric pixel

    values themselves.There are a large number of recognized image formats now existing, dating back

    over more than 30 years of digital image storage. Some of the most common 2-D

    image formats are listed in Table 1.1.

    As suggested by the properties listed in Table 1.1, different image formats aregenerally suitable for different applications.

    GIF images are a very basic image storage format limited to only 256 grey levels

    or colours, with the latter defined via a colour map in the file header as discussed

    previously.By contrast, the commonplace JPEG format is capable of storing up to a 24-bit

    RGB colour image, and up to 36 bits for medical/scientific imaging applications,

    and is most widely used for consumer-level imaging such as digital cameras.

  • 8/3/2019 Ch1-Introduction to Digital Image

    17/28

    Chapter 1: Introduction to Digital Image Processing 17

    Other common formats encountered include the basic bitmap format (BMP),originating in the development of the Microsoft Windows operating system, and

    The new PNG format, designed as a more powerful replacement for GIF.

    TIFF, tagged image file format, represents an overarching and adaptable file

    format capable of storing a wide range of different image data forms.

    In general, photographic-type images are better suited towards JPEG or TIF

    storage.

    Whilst images of limited colour/detail (e.g. logos, line drawings, text) are bestsuited to GIF or PNG (as per TIFF), as a lossless, full-colour format, is adaptableto the majority of image storage requirements.

    11-Image data types

    The choice of image format used can be largely determined by not just the

    image contents, but also the actual image data type that is required for storage.

    In addition to the bit resolution of a given image discussed earlier, a number of

    distinct image types also exist:

    11-1-Binary imagesAre 2-D arrays that assign one numerical value from the set {0; 1} to each pixel

    in the image as shown in Figure (1.16).

    These are sometimes referred to as logical images: black corresponds to zero (an

    off or background pixel) and white corresponds to one (an on or

    foreground pixel).

    As no other values are permissible, these images can be represented as a simple

    bit-stream, but in practice they are represented as 8-bit integer images in the

    common image formats.

    A fax (or facsimile) image is an example of a binary image.Each pixel is just black or white.

    Since there are only two possible values for each pixel, we only need one bit per

    pixel.

  • 8/3/2019 Ch1-Introduction to Digital Image

    18/28

    Chapter 1: Introduction to Digital Image Processing 18

    Such images can therefore be very efficient in terms of storage.Images for which a binary representation may be suitable include text (printed or

    handwriting), fingerprints, or architectural plans.

    An example was the image shown in Figure 1.18.

    In this image, we have only the two colours: white for the edges, and black for

    the background.

    Figure (1.18) A Binary Image

    11-2-Intensity or grey-scale imagesAre 2-D arrays that assign one numerical value to each pixel which is

    representative of the intensity at this point.

    As discussed previously, the pixel value range is bounded by the bit resolution of

    the image and such images are stored as N-bit integer images with a given

    format.

    Figure (1.19)A greyscale image

    Each pixel is a shade of grey, normally from 0 (black) to 255 (white).This range means that each pixel can be represented by eight bits, or exactly one

    byte.

    This is a very natural range for image file handling.

  • 8/3/2019 Ch1-Introduction to Digital Image

    19/28

    Chapter 1: Introduction to Digital Image Processing 19

    Other greyscale ranges are used, but generally they are a power of 2.Such images arise in medicine (X-rays), images of printed works, and indeed 256

    different grey levels is sufficient for the recognition of most natural objects.

    11-3-RGB or true-colour imagesAre 3-D arrays that assign three numerical values to each pixel, each value

    corresponding to the red, green and blue (RGB) image channel component

    respectively as shown in Figure (1.20).

    Conceptually, we may consider them as three distinct, 2-D planes so that they are

    of dimension C by R by 3, where R is the number of image rows and C the

    number ofimage columns.

    Commonly, such images are stored as sequential integers in successive channel

    order (e.g. R0G0B0, R1G1B1, . . .) which are then accessed (as in Matlab) byI(C; R; channel) coordinates within the 3-D array.

    Figure (1.20 ) A true colour image

    Here each pixel has a particular colour; that colour being described by the amount

    of red, green and blue in it.

    If each of these components has a range 0-255, this gives a total of 2553

    =

    16777216 different possible colours in the image.This is enough colours for any image. Since the total number of bits required for

    each pixel is 24-bit, such images are also called 24-bit colour images.

  • 8/3/2019 Ch1-Introduction to Digital Image

    20/28

    Chapter 1: Introduction to Digital Image Processing 20

    11-4-IndexedMost colour images only have a small subset of the more than sixteen million

    possible colours.

    For convenience of storage and file handling, the image has an associated colour

    map, or colour palette, which is simply a list of all the colours used in that image.

    Each pixel has a value which does not give its colour (as for an RGB image), but

    an index to the colour in the map.

    It is convenient if an image has 256 colours or less, for then the index values will

    only require one byte each to store.

    Some image file formats (for example, Compuserve GIF), allow only 256 colours

    or fewer in each image, for precisely this reason.

    Figure 1.21 shows an example.

    In this image the indices, rather then being the grey values of the pixels, are

    simply indices into the colour map.

    Without the colour map, the image would be very dark and colourless.In the figure, for example, pixels labelled 5 correspond to 0.2627 0.2588 0.2549,

    which is a darkgreyish colour.

    Figure (1.21) An indexed colour image

    11-5-Floating-point imagesDiffer from the other image types we have discussed.

    By definition, they do not store integer colour values.

    Instead, they store a floating-point number which, within a given range defined

    by the floating-point precision of the image bit resolution, represents the

    intensity.

    They may (commonly) represent a measurement value other than simple

    intensity or colour as part of a scientific or medical image.

    Floating point images are commonly stored in the TIFF image format or a

    more specialized, domain-specific format (e.g. medical DICOM).

    Although the use of floating-point images is increasing through the use of high

    dynamic range and stereo photography, file formats supporting their storage

    currently remain limited.

  • 8/3/2019 Ch1-Introduction to Digital Image

    21/28

    Chapter 1: Introduction to Digital Image Processing 21

    Figure 1.22 shows an example of the different image data types we discuss withan example of a suitable image format used for storage.

    Although the majority of images we will encounter in this text will be of integer

    data types, Matlab, as a general matrix-based data analysis tool, can of course be

    used to process floating-point image data.

    Figure 1.22 Examples of different image types and their associated storage formats

    12-Image File Sizes

    Image files tend to be large.

    We shall investigate the amount of information used in different image type of

    varying sizes.

    For example, suppose we consider a 512 x 512 binary image.

    The number of bits used in this image (assuming no compression, and neglecting,

    for the sake of discussion, any header information) is:

    MByte0.033

    Kbyte32.768Bytes32768bits2621441512512

    =

    =

  • 8/3/2019 Ch1-Introduction to Digital Image

    22/28

    Chapter 1: Introduction to Digital Image Processing 22

    A greyscale image of the same size requires:

    MByte0.262

    Kbyte262.14

    Byte262144(Byte)1512512

    ==

    If we now turn our attention to colour images, each pixel is associated with 3bytes of colour information. A 512 x 512 colure image requires:

    MByte0.768

    Kbyte432.786

    Byte786432(Byte)3512512

    ==

    Many images are of course such larger than this; satellite images may be of the

    order of several thousand pixels in each direction.

    13-Image compression

    The other main consideration in choosing an image storage format is

    compression.

    Whilst compressing an image can mean it takes up less disk storage and can be

    transferred over a network in less time, several compression techniques in useexploit what is known as lossy compression.

    Lossy compression operates by removing redundant information from the image.

    It is possible to remove some information from an image without any apparent

    change in its visual appearance.Essentially, if such information is visually redundant then its transmission is

    unnecessary for appreciation of the image.

    The form of the information that can be removed is essentially twofold.

    It may be in terms of fine image detail or it may be through a reduction in thenumber of colours/grey levels in a way that is not detectable by the human eye.

    Some of the image formats we have presented, store the data in such a

    compressed form (Table 1.1).

    Storage of an image in one of the compressed formats employs various

    algorithmic procedures to reduce the raw image data to an equivalent imagewhich appears identical (or at least nearly) but requires less storage.

    It is important to distinguish between compression which allows the original

    image to be reconstructed perfectly from the reduced data without any loss of

    image information (lossless compression)

    And so-called lossy compression techniques which reduce the storage volume

    (sometimes dramatically) at the expense of some loss of detail in the original

    image as shown in Figure 1.23.

    The lossless and lossycompression techniques used in common image formats

    can significantly reduce the amount of image information that needs to be stored,but in the case of lossy compression this can lead to a significant reduction in

    image quality.

  • 8/3/2019 Ch1-Introduction to Digital Image

    23/28

    Chapter 1: Introduction to Digital Image Processing 23

    Figure 1.23 Example image compressed using lossless and varying levels of lossy

    compression.

    Lossy compression is also commonly used in video storage due to the even larger

    volume of source data associated with a large sequence of image frames.This loss of information, itself a form of noise introduced into the image as

    compression artefacts, can limit the effectiveness of later image enhancement andanalysis.

    In terms of practical image processing in Matlab, it should be noted that an image

    written to file from Matlab in a lossy compression format (e.g. JPEG) will

    not be stored as the exact Matlab image representation it started as.Image pixel values will be altered in the image output process as a result of the

    lossy compression.

    This is not the case if a lossless compression technique is employed.

    14-Fundamental Steps in Digital Image Processing

    It is helpful to divide the material covered in the following chapters into the two

    broad categories: methods whose input and output are images, and methods

  • 8/3/2019 Ch1-Introduction to Digital Image

    24/28

    Chapter 1: Introduction to Digital Image Processing 24

    whose inputs may be images, but whose outputs are attributes extracted fromthose images. This organization is summarized in Figure. 1.24.

    Figure (1.24) Fundamental steps in digital image processing.

    The diagram does not imply that every process is applied to an image.

    Rather, the intention is to convey an idea of all the methodologies that can be

    applied to images for different purposes and possibly with different objectives.

    Image acquisition is the first process shown in Figure 1.24.

    Image enhancement is among the simplest and most appealing areas of digital

    image processing.

    Basically, the idea behind enhancement techniques is to bring out detail that is

    obscured, or simply to highlight certain features of interest in an image.A familiar example of enhancement is when we increase the contrast of an image

    because "it looks better." It is important to keep in mind that enhancement is a

    very subjective area of image processing.

    Image restoration is an area that also deals with improving the appearance of an

    image.

    However, unlike enhancement, which is subjective, image restoration is

    objective, in the sense that restoration techniques tend to be based on

    mathematical or probabilistic models of image degradation.

    Enhancement, on the other hand, is based on human subjective preferencesregarding what constitutes a "good" enhancement result.

    Color image processing is an area that has been gaining in importance because of

    the significant increase in the use of digital images over the Internet.

  • 8/3/2019 Ch1-Introduction to Digital Image

    25/28

    Chapter 1: Introduction to Digital Image Processing 25

    Color is used also as the basis for extracting features of interest in an image.Wavelets are the foundation for representing images in various degrees of

    resolution.

    In particular, this material is used for image data compression and for pyramidal

    representation, in which images are subdivided successively into smaller regions.

    Compression, as the name implies, deals with techniques for reducing the storage

    required to save an image, or the bandwidth required to transmit it.

    Although storage technology has improved significantly over the past decade, the

    same cannot be said for transmission capacity.

    This is true particularly in uses of the Internet, which are characterized by

    significant pictorial content.

    Image compression is familiar (perhaps inadvertently) to most users of computers

    in the form of image file extensions, such as the jpg file extension used in the

    JPEG (Joint Photographic Experts Group) image compression standard.

    Morphological processing deals with tools for extracting image components thatare useful in the representation and description of shape.

    Segmentation procedures partition an image into its constituent parts or objects.

    In general, autonomous segmentation is one of the most difficult tasks in digital

    image processing.

    A rugged segmentation procedure brings the process a long way toward

    successful solution of imaging problems that require objects to be identified

    individually.

    On the other hand, weak or erratic segmentation algorithms almost alwaysguarantee eventual failure. In general, the more accurate the segmentation, the

    more likely recognition is to succeed.

    Representation and description almost always follow the output of a segmentation

    stage, which usually is raw pixel data, constituting either the boundary of a region

    (i.e., the set of pixels separating one image region from another) or all the points

    in the region itself.

    In either case, converting the data to a form suitable for computer processing is

    necessary.

    The first decision that must be made is whether the data should be represented asa boundary or as a complete region.

    Boundary representation is appropriate when the focus is on external shapecharacteristics, such as corners and inflections.

    Regional representation is appropriate when the focus is on internal properties,

    such as texture or skeletal shape.

    In some applications, these representations complement each other.Choosing a representation is only part of the solution for transforming raw data

    into a form suitable for subsequent computer processing.

    A method must also be specified for describing the data so that features of

    interest are highlighted.Description, also called feature selection, deals with extracting attributes that

    result in some quantitative information of interest or are basic for differentiating

    one class of objects from another.

  • 8/3/2019 Ch1-Introduction to Digital Image

    26/28

    Chapter 1: Introduction to Digital Image Processing 26

    Recognition is the process that assigns a label to an object based on itsdescriptors.

    We conclude our coverage of digital image processing with the development of

    methods for recognition of individual objects.

    15-Components of an Image Processing System

    Figure 1.25 shows the basic components comprising a typical general-purpose

    system used for digital image processing.

    The function of each component is discussed in the following paragraphs,

    starting with image sensing.

    Figure (1.25) Components of a general-purpose image processing system.

    With reference to sensing, two elements are required to acquire digital images.

    The first is a physical device that is sensitive to the energy radiated by the

    object we wish to image.

    The second, called a digitizer, is a device for converting the output of the

    physical sensing device into digital form.

    For instance, in a digital video camera, the sensors produce an electrical

    output proportional to light intensity.

    The digitizer converts these outputs to digital data.

  • 8/3/2019 Ch1-Introduction to Digital Image

    27/28

    Chapter 1: Introduction to Digital Image Processing 27

    Specialized image processing hardware usually consists of the digitizer justmentioned, plus hardware that performs other primitive operations, such as an

    arithmetic logic unit (ALU), which performs arithmetic and logical operations

    in parallel on entire images.

    One example of how an ALU is used is in averaging images as quickly as they

    are digitized, for the purpose of noise reduction.

    This unit performs functions that require fast data throughputs (e.g., digitizing

    and averaging video images at 30 frames/s) that the typical main computer

    cannot handle.

    The computer in an image processing system is a general-purpose computer

    and can range from a PC to a supercomputer.

    In dedicated applications, sometimes specially designed computers are used to

    achieve a required level of performance, but our interest here is on general-

    purpose image processing systems.

    In these systems, almost any well-equipped PC-type machine is suitable foroffline image processing tasks.

    Software for image processing consists of specialized modules that perform

    specific tasks.

    A well-designed package also includes the capability for the user to write code

    that, as a minimum, utilizes the specialized modules.

    More sophisticated software packages allow the integration of those modules

    and general-purpose software commands from at least one computer language.

    Mass storage capability is a must in image processing applications.

    An image of size 1024 x 1024 pixels, in which the intensity of each pixel is an8-bit quantity, requires one megabyte of storage space if the image is not

    compressed.

    When dealing with thousands, or even millions, of images, providing adequate

    storage in an image processing system can be a challenge.

    Digital storage for image processing applications falls into three principal

    categories:

    i- Short term storage for use during processing,

    ii- On-line storage for relatively fast recall, and

    iii- Archival storage, characterized by infrequent access.Storage is measured in bytes (eight bits), Kbytes (one thousand bytes), Mbytes

    (one million bytes), Gbytes (meaning giga, or one billion, bytes), and T bytes(meaning tera, or one trillion, bytes).

    One method of providing short-term storage is computer memory.

    Another is by specialized boards, called frame buffers, that store one or more

    images and can be accessed rapidly, usually at video rates (e.g., at 30 completeimages per second).

    The latter method allows virtually instantaneous image zoom, as well as scroll

    (vertical shifts) and pan (horizontal shifts).

    Frame buffers usually are housed in the specialized image processinghardware unit shown in Figure 1.24.

    Online storage generally takes the form of magnetic disks or optical-media

    storage.

  • 8/3/2019 Ch1-Introduction to Digital Image

    28/28

    Chapter 1: Introduction to Digital Image Processing 28

    The key factor characterizing on-line storage is frequent access to the storeddata.

    Finally, archival storage is characterized by massive storage requirements but

    infrequent need for access.

    Image displays in use today are mainly color (preferably flat screen) TV

    monitors.

    Monitors are driven by the outputs of image and graphics display cards that

    are an integral part of the computer system.

    Hardcopy devices for recording images include laser printers, film cameras,

    heat-sensitive devices, inkjet units, and digital units, such as optical and CD-

    ROM disks.

    Film provides the highest possible resolution, but paper is the obvious medium

    of choice for written material.For presentations, images are displayed on film transparencies or in a digital

    medium if image projection equipment is used.

    The latter approach is gaining acceptance as the standard for image

    presentations.

    Networking is almost a default function in any computer system in use today.

    Because of the large amount of data inherent in image processing applications,

    the key consideration in image transmission is bandwidth.

    In dedicated networks, this typically is not a problem, but communicationswith remote sites via the Internet are not always as efficient.

    Fortunately, this situation is improving quickly as a result of optical fiber and

    other broadband technologies.