imageprocessing12-colourimageprocessing

Upload: phanikumar-parvatham

Post on 03-Apr-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    1/76

    Course Website:http://www.comp.dit.ie/bmacnamee

    Digital Image Processing

    Colour Image Processing

    http://www.comp.dit.ie/bmacnameehttp://www.comp.dit.ie/bmacnamee
  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    2/76

    2

    of

    39Introduction

    Today well look at colour image processing,covering:

    Colour fundamentals

    Colour models

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    3/76

    3

    of

    39Colour Fundamentals

    In 1666 Sir Isaac Newton discovered thatwhen a beam of sunlight passes through a

    glass prism, the emerging beam is split into a

    spectrum of colours

    ImagestakenfromGonzalez&Woods,

    DigitalIma

    geProcessing(2002)

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    4/76

    4

    of

    39Colour Fundamentals (cont)

    The colours that humans and most animalsperceive in an object are determined by the

    nature of the light reflected from the object

    For example, greenobjects reflect light

    with wave lengths

    primarily in the rangeof 500 570 nm while

    absorbing most of the

    energy at other

    wavelengths

    Colours

    Absorbed

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    5/76

    5

    of

    39Colour Fundamentals (cont)

    Chromatic light spans the electromagneticspectrum from approximately 400 to 700 nm

    As we mentioned before human colour vision

    is achieved through 6 to 7 million cones ineach eye

    ImagestakenfromGonzalez&Woods,

    DigitalIma

    geProcessing(2002)

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    6/76

    6

    of

    39Colour Fundamentals (cont)

    Approximately 66% of these cones aresensitive to red light, 33% to green light and

    6% to blue light

    Absorption curves for the different cones havebeen determined experimentally

    Strangely these do not match the CIE

    standards for red (700nm), green (546.1nm)and blue (435.8nm) light as the standards

    were developed before the experiments!

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    7/76

    7

    of

    39Colour Fundamentals (cont)

    ImagestakenfromGonzalez&Woods,

    DigitalIma

    geProcessing(2002)

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    8/76

    8

    of

    39Colour Fundamentals (cont)

    3 basic qualities are used to describe thequality of a chromatic light source:

    Radiance: the total amount of energy that flowsfrom the light source (measured in watts)

    Luminance: the amount of energy an observerperceives from the light source (measured inlumens)

    Note we can have high radiance, but low luminance

    Brightness: a subjective (practicallyunmeasurable) notion that embodies theintensity of light

    Well return to these later on

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    9/76

    9

    of

    39CIE Chromacity Diagram

    Specifying colours systematically can beachieved using the CIE chromacity diagram

    On this diagram the x-axis represents the

    proportion of red and the y-axis represents theproportion of red used

    The proportion of blue used in a colour is

    calculated as:z = 1(x + y)

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    10/76

    10

    of

    39CIE Chromacity Diagram (cont)

    ImagestakenfromGonzalez&Woods,

    DigitalIma

    geProcessing(2002) Green: 62% green,

    25% red and 13%

    blue

    Red: 32% green,67% red and 1%

    blue

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    11/76

    11

    of

    39CIE Chromacity Diagram (cont)

    Any colour located on the boundary of thechromacity chart is fully saturated

    The point of equal energy has equal amounts

    of each colour and is the CIE standard forpure white

    Any straight line joining two points in the

    diagram defines all of the different colours thatcan be obtained by combining these two

    colours additively

    This can be easily extended to three points

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    12/76

    12

    of

    39CIE Chromacity Diagram (cont)

    ImagestakenfromGonzalez&Woods,

    DigitalIma

    geProcessing(2002) This means the entire

    colour range cannot be

    displayed based on

    any three colours

    The triangle shows the

    typical colour gamut

    produced by RGB

    monitorsThe strange shape is

    the gamut achieved by

    high quality colour

    printers

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    13/76

    13

    of

    39Colour Models

    From the previous discussion it should beobvious that there are different ways to model

    colour

    We will consider two very popular modelsused in colour image processing:

    RGB (Red Green Blue)

    HIS (Hue Saturation Intensity)

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    14/76

    14

    of

    39RGB

    In the RGB model each colour appears in itsprimary spectral components of red, green and

    blue

    The model is based on a Cartesian coordinatesystem

    RGB values are at 3 corners

    Cyan magenta and yellow are at three other corners

    Black is at the origin

    White is the corner furthest from the origin

    Different colours are points on or inside the cube

    represented by RGB vectors

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    15/76

    15

    of

    39RGB (cont)

    Im

    agestakenfromGonzalez&Woods,

    DigitalIma

    geProcessing(2002)

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    16/76

    16

    of

    39RGB (cont)

    Images represented in the RGB colour modelconsist of three component images one for

    each primary colour

    When fed into a monitor these images arecombined to create a composite colour image

    The number of bits used to represent each

    pixel is referred to as the colour depthA 24-bit image is often referred to as a full-

    colour image as it allows = 16,777,216

    colours

    38

    2

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    17/76

    17

    of

    39RGB (cont)

    Im

    agestakenfromGonzalez&Woods,

    DigitalIma

    geProcessing(2002)

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    18/76

    18

    of

    39The HSI Colour Model

    RGB is useful for hardware implementationsand is serendipitously related to the way in

    which the human visual system works

    However, RGB is not a particularly intuitiveway in which to describe colours

    Rather when people describe colours they

    tend to use hue, saturation and brightnessRGB is great for colour generation, but HSI is

    great for colour description

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    19/76

    19

    of

    39The HSI Colour Model (cont)

    The HSI model uses three measures todescribe colours:

    Hue: A colour attribute that describes a pure

    colour (pure yellow, orange or red) Saturation: Gives a measure of how much a

    pure colour is diluted with white light

    Intensity: Brightness is nearly impossible to

    measure because it is so subjective. Instead weuse intensity. Intensity is the same achromatic

    notion that we have seen in grey level images

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    20/76

    20

    of

    39HSI, Intensity & RGB

    Intensity can be extracted from RGB imageswhich is not surprising if we stop to think about

    it

    Remember the diagonal on the RGB colourcube that we saw previously ran from black to

    white

    Now consider if we stand this cube on theblack vertex and position the white vertex

    directly above it

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    21/76

    21

    of

    39HSI, Intensity & RGB (cont)

    Im

    agestakenfromGonzalez&Woods,

    DigitalIma

    geProcessing(2002) Now the intensity component

    of any colour can be

    determined by passing a

    planeperpendiculartothe intenisty axis and

    containing the colour

    point

    The intersection of the plane

    with the intensity axis gives us the intensity

    component of the colour

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    22/76

    22

    of

    39HSI, Hue & RGB

    In a similar way we can extract the hue fromthe RGB colour cube

    Consider a plane defined by

    the three points cyan, blackand white

    All points contained in

    this plane must have thesame hue (cyan) as black

    and white cannot contribute

    hue information to a colourIm

    agestakenfromGonzalez&Woods,

    DigitalIma

    geProcessing(2002)

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    23/76

    23

    of

    39The HSI Colour Model

    Im

    agestakenfromGonzalez&Woods,

    DigitalIma

    geProcessing(2002) Consider if we look straight down at the RGB

    cube as it was arranged previously

    We would see a hexagonal

    shape with each primarycolour separated by 120

    and secondary colours

    at 60 from the primaries

    So the HSI model is

    composed of a vertical

    intensity axis and the locus of colour points that

    lie on planes perpendicular to that axis

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    24/76

    24

    of

    39The HSI Colour Model (cont)

    Im

    agestakenfromGonzalez&Woods,

    DigitalIma

    geProcessing(2002) To the right we see a hexagonal

    shape and an arbitrary colour

    point

    The hue is determined by anangle from a reference point,

    usually red

    The saturation is the distance from the origin to the

    point The intensity is determined by how far up the

    vertical intenisty axis this hexagonal plane sits (not

    apparent from this diagram

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    25/76

    25

    of

    39The HSI Colour Model (cont)

    Im

    agestakenfromGonzalez&Woods,

    DigitalImageProcessing(2002) Because the only important things are the angle

    and the length of the saturation vector this

    plane is also often represented as a circle or a

    triangle

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    26/76

    26

    of

    39HSI Model Examples

    Im

    agestakenfromGonza

    lez&Woods,

    DigitalImageProcessing(2002)

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    27/76

    27

    of

    39HSI Model Examples

    Im

    agestakenfromGonza

    lez&Woods,

    DigitalImageProcessing(2002)

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    28/76

    28

    of

    39Converting From RGB To HSI

    Given a colour as R, G, and B its H, S, and Ivalues are calculated as follows:

    H ifB G

    360 ifB G

    cos112

    R G R B R G

    2 R B G B 1

    2

    S13

    R G B

    min R,G,B

    I 13RG B

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    29/76

    29

    of

    39Converting From HSI To RGB

    Given a colour as H, S, and I its R, G, and Bvalues are calculated as follows:

    RG sector (0

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    30/76

    30

    of

    39Converting From HSI To RGB (cont)

    BR sector (240

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    31/76

    31

    of

    39HSI & RGB

    Im

    agestakenfromGonza

    lez&Woods,

    DigitalImageProcessing(2002)

    RGB Colour Cube

    H, S, and I Components of RGB Colour Cube

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    32/76

    32

    of

    39Manipulating Images In The HSI Model

    In order to manipulate an image under the HISmodel we:

    First convert it from RGB to HIS

    Perform our manipulations under HSI Finally convert the image back from HSI to RGB

    RGBImage HSI Image RGBImage

    Manipulations

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    33/76

    33

    of

    39RGB -> HSI -> RGB

    Im

    agestakenfromGonza

    lez&Woods,

    DigitalImageProcessing(2002)

    RGB

    Image

    Saturation

    Hue

    Intensity

    34

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    34/76

    34

    of

    39RGB -> HSI -> RGB (cont)

    Im

    agestakenfromGonza

    lez&Woods,

    DigitalImageProcessing(2002)

    Hue

    Intensity

    Saturation

    RGB

    Image

    35

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    35/76

    35

    of

    39Pseudocolour Image Processing

    Pseudocolour (also called falsecolour) image processing consists

    of assigning colours to grey values

    based on a specific criterionThe principle use of pseudocolour

    image processing is for human

    visualisation Humans can discern betweenthousands of colour shades and

    intensities, compared to only about

    two dozen or so shades of grey

    36 Pseudo Colour Image Processing

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    36/76

    36

    of

    39

    Pseudo Colour Image Processing

    Intensity Slicing

    Intensity slicing and colour coding is one of thesimplest kinds of pseudocolour image

    processing

    First we consider an image as a 3D functionmapping spatial coordinates to intensities (that

    we can consider heights)

    Now consider placing planes at certain levels

    parallel to the coordinate plane

    If a value is one side of such a plane it is

    rendered in one colour, and a different colour if

    on the other side

    37 Pseudocolour Image Processing

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    37/76

    37

    of

    39

    Pseudocolour Image Processing

    Intensity Slicing (cont)

    Im

    agestakenfromGonza

    lez&Woods,

    DigitalImageProcessing(2002)

    38 Pseudocolour Image Processing

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    38/76

    38

    of

    39

    Pseudocolour Image Processing

    Intensity Slicing (cont)

    In general intensity slicing can be summarisedas:

    Let [0, L-1] represent the grey scale

    Let l0 represent black [f(x, y) = 0] and let lL-1represent white [f(x, y) = L-1]

    SupposePplanes perpendicular to the intensity

    axis are defined at levels l1, l2, , lp

    Assuming that 0 < P < L-1 then thePplanes

    partition the grey scale intoP + 1 intervals V1,

    V2,,VP+1

    39 Pseudocolour Image Processing

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    39/76

    39

    of

    39

    Pseudocolour Image Processing

    Intensity Slicing (cont)

    Grey level colour assignments can then be madeaccording to the relation:

    where ckis the colour associated with the kth

    intensity level Vkdefined by the partitioning

    planes at l = k1 and l = k

    f(x,y) ck iff(x,y) Vk

    40

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    40/76

    40

    of

    39RGB -> HSI -> RGB (cont)

    Im

    agestakenfromGonza

    lez&Woods,

    DigitalImageProcessing(2002)

    41

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    41/76

    41

    of

    39RGB -> HSI -> RGB (cont)

    Im

    agestakenfromGonza

    lez&Woods,

    DigitalImageProcessing(2002)

    42

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    42/76

    42

    of

    39RGB -> HSI -> RGB (cont)

    Im

    agestakenfromGonza

    lez&Woods,

    DigitalImageProcessing(2002)

    43

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    43/76

    43

    of

    39RGB -> HSI -> RGB (cont)

    Im

    agestakenfromGonza

    lez&Woods,

    DigitalImageProcessing(2002)

    44

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    44/76

    44

    of

    39Chapter 6

    Color Image Processing

    45

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    45/76

    45

    of

    39Chapter 6

    Color Image Processing

    46

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    46/76

    46

    of

    39Chapter 6

    Color Image Processing

    47

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    47/76

    47

    of

    39Chapter 6

    Color Image Processing

    48

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    48/76

    48

    of

    39Chapter 6

    Color Image Processing

    49

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    49/76

    49

    of

    39Chapter 6

    Color Image Processing

    50

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    50/76

    50

    of

    39Chapter 6

    Color Image Processing

    51

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    51/76

    51

    of

    39Chapter 6

    Color Image Processing

    52

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    52/76

    52

    of

    39Chapter 6

    Color Image Processing

    53

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    53/76

    of

    39Chapter 6

    Color Image Processing

    54

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    54/76

    of

    39Chapter 6

    Color Image Processing

    55

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    55/76

    of

    39Chapter 6

    Color Image Processing

    56

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    56/76

    of

    39Chapter 6

    Color Image Processing

    57

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    57/76

    of

    39Chapter 6

    Color Image Processing

    58

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    58/76

    of

    39Chapter 6

    Color Image Processing

    59

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    59/76

    of

    39Chapter 6

    Color Image Processing

    60

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    60/76

    of

    39Chapter 6

    Color Image Processing

    61

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    61/76

    of

    39Chapter 6

    Color Image Processing

    62

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    62/76

    of

    39Chapter 6

    Color Image Processing

    63

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    63/76

    of

    39Chapter 6

    Color Image Processing

    64

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    64/76

    of

    39Chapter 6

    Color Image Processing

    65

    f

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    65/76

    of

    39Chapter 6

    Color Image Processing

    66

    f

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    66/76

    of

    39Chapter 6

    Color Image Processing

    67

    f h

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    67/76

    of

    39Chapter 6

    Color Image Processing

    68

    f Ch 6

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    68/76

    of

    39Chapter 6

    Color Image Processing

    69

    f Ch t 6

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    69/76

    of

    39Chapter 6

    Color Image Processing

    70

    of Ch t 6

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    70/76

    of

    39Chapter 6

    Color Image Processing

    71

    of Ch t 6

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    71/76

    of

    39Chapter 6

    Color Image Processing

    72

    of Chapte 6

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    72/76

    of

    39Chapter 6

    Color Image Processing

    73

    of Chapter 6

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    73/76

    of

    39Chapter 6

    Color Image Processing

    74

    of Chapter 6

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    74/76

    of

    39Chapter 6

    Color Image Processing

    75

    of Chapter 6

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    75/76

    of

    39Chapter 6

    Color Image Processing

    76

    of Chapter 6

  • 7/28/2019 ImageProcessing12-ColourImageProcessing

    76/76

    of

    39Chapter 6

    Color Image Processing