Chapter02 Osc

download Chapter02 Osc

of 51

Transcript of Chapter02 Osc

  • 8/12/2019 Chapter02 Osc

    1/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Chapter 2: Digital Image Fundamentals

    -Cornea(Gic mc)

    - Sclera (Mng cng)

    - Iris(Mng mt)

    - Lens(Thu knh)

    - Retina(Vng mc)

    - Visual Axis

  • 8/12/2019 Chapter02 Osc

    2/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Chapter 2: Digital Image Fundamentals

    - Cones: 6~7 millions are distributed around fovea. Highly sensitive to

    color. Human resolve fine details with these.

    - Rods: 75~150 millions are distributed over the retinal surface.

    Several rods are connected to a single nerve end. Reduce the amount of

    detail. Serve to give a general, overall picture of the field of view.

    Sensitive to low levels of illumination.

  • 8/12/2019 Chapter02 Osc

    3/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Chapter 2: Digital Image Fundamentals

    -Shape of the lens is controlled by the controlling muscles

    - The muscles make the lens to be relatively flattened for

    distant objects.

  • 8/12/2019 Chapter02 Osc

    4/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Brightness Adaptation

    The total range of intensity levels

    that it can discriminate

    simultaneously is rather small

    compared with the total adaptation

    range

    Ba

    is a brightness adaptation

    level The short intersecting curve

    represents the range of subjective

    brightness that the eye can

    perceive when adapted to this

    level.

  • 8/12/2019 Chapter02 Osc

    5/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Contrast Sensitivity

    The ability of the eye to

    discrimination between changes

    in brightness at specific

    adaptation level

    I is uniform illumination on

    a flat background area large

    enough to occupy the entire

    field of view

    is the change in the

    object brightness required to

    just distinguish the object

    from the background

    Weber ratio: I/I

    - Bad brightness discrimination

    if Weber Ratio is large,

  • 8/12/2019 Chapter02 Osc

    6/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Weber Ratio

    Brightness discrimination is

    poor (the Weber ratio is large) at

    low levels of illumination and

    improves significantly (the ratiodecreases) as background

    illumination increases.

    hard to distinguish the

    discrimination when it is brightarea but easier when the

    discrimination is on a dark area.

  • 8/12/2019 Chapter02 Osc

    7/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Brightness vs. Function of intensity

    Visual system tends toundershoot or overshoot around

    the boundary of regions of

    different intensities.

  • 8/12/2019 Chapter02 Osc

    8/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Simultaneous Contrast

    All the small squares have exactly the same intensity, butthey appear to the eye progressively darker as the background

    becomes brighter.

    Regions perceived brightness does not depend simply onits intensity.

  • 8/12/2019 Chapter02 Osc

    9/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Optical Illusions

  • 8/12/2019 Chapter02 Osc

    10/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Electromagnetic Spectrum

  • 8/12/2019 Chapter02 Osc

    11/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Signal

    A signal is a function that carries information.

    Usually content of the signal changes over some set of

    spatiotemporal dimensions.Time-Varying Signal: f(t)

    Ex) audio signal

  • 8/12/2019 Chapter02 Osc

    12/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Spatially-Varying Signal

    Signals can vary over space as well.

    An image can be thought of as being a function of 2

    spatial dimensions:

    f(x,y)for monochromatic images, the value of the function is the

    amount of light at that point.

    medical CAT and MRI scanners produce images that are

    functions of 3 spatial dimensions:

    f(x,y,z)

    Spatiotemporal Signals:

    f(x,y,t)

    ex) a video signal, animation

  • 8/12/2019 Chapter02 Osc

    13/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Analog and Digital Signal

    Most naturally-occurring signals also have a real-

    valued range in which values occur with infinite

    precision.To store and manipulate signals by computer we

    need to store these numbers with finite precision.

    thus, these signals have a discrete range.

    signal has continuous domain and range = analog

    signal has discrete domain and range = digital

  • 8/12/2019 Chapter02 Osc

    14/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Sampling

    sampling = the spacing of discrete values in the domain ofa signal.

    sampling-rate = how many samples are taken per unit ofeach dimension. e.g.,samples per second, frames per second

  • 8/12/2019 Chapter02 Osc

    15/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Quantization

    Quantization = spacing of discrete values in therange of a signal.

    Usually thought of as the number of bits persample of the signal.

    e.g., 1, 8, 24 bit images, 16-bit audio.

    l d d

  • 8/12/2019 Chapter02 Osc

    16/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Digital Image Representation

    A digital image is an image f(x,y)

    that has been digitized both in spatialcoordinates and brightness.

    The value of f at any point (x,y) is

    proportional to the brightness (or

    gray level) of the image at that point.

    Di i l I P i 2 d d

  • 8/12/2019 Chapter02 Osc

    17/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    2D Image Sensor

    Di it l I P i 2 d d

  • 8/12/2019 Chapter02 Osc

    18/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Coordinate Conversion used in this book

  • 8/12/2019 Chapter02 Osc

    19/51

    Di it l I P i 2 d d

  • 8/12/2019 Chapter02 Osc

    20/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Digital Image Acquisition Process

    Di it l I P i 2 d d

  • 8/12/2019 Chapter02 Osc

    21/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Sampling and Quantization

    Di it l I P i 2 d d

  • 8/12/2019 Chapter02 Osc

    22/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Example of Digital Image

    Digital Image Processing 2nd ed

  • 8/12/2019 Chapter02 Osc

    23/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Sampling Effect

    Digital Image Processing 2nd ed

  • 8/12/2019 Chapter02 Osc

    24/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Sampling Effect

    Digital Image Processing 2nd ed

  • 8/12/2019 Chapter02 Osc

    25/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Sampling Effect

    Digital Image Processing 2nd ed

  • 8/12/2019 Chapter02 Osc

    26/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Quantization Effect

    Digital Image Processing 2nd ed

  • 8/12/2019 Chapter02 Osc

    27/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Quantization Effect

    if the gray scale is not

    enough, the smooth area willbe affected.

    False contouring can occur

    on the smooth area which has

    fine gray scales.

    Digital Image Processing 2nd ed

  • 8/12/2019 Chapter02 Osc

    28/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Light-intensity function

    image refers to a 2D light-intensityfunction, f(x,y)

    the amplitude of f at spatial coordinates

    (x,y) gives the intensity (brightness) of the

    image at that point.

    light is a form of energy thus f(x,y) mustbe nonzero and finite.

    0 < f(x,y)<

    Digital Image Processing 2nd ed

  • 8/12/2019 Chapter02 Osc

    29/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Illumination and Reflectance

    The basic nature of f(x,y) may becharacterized by 2 components:

    the amount of source light incident

    on the scene being viewed

    Illumination, i(x,y)

    the amount of light reflected by the

    objects in the scene

    Reflectance, r(x,y)

    Digital Image Processing 2nd ed

  • 8/12/2019 Chapter02 Osc

    30/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Illumination and Reflectance

    f(x,y) = i(x,y)r(x,y)

    i(x,y):

    determined by the nature of the light sourcebounded by

    0 < i(x,y)<

    r(x,y) :

    determined by the nature of the objectsbounded by

    0 < r(x,y)< 1

    Digital Image Processing 2nd ed

  • 8/12/2019 Chapter02 Osc

    31/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Gray Level

    we call the intensity of a monochrome image f at

    coordinate (x,y) the gray level (l) of the image at

    that point.thus, l lies in the range Lmin l Lmax

    Lminand Lmaxare positive and finite.

    gray scale = [Lmin, Lmax]

    common practice, shift the interval to [0, L ]0 = black , L = white

    Digital Image Processing 2nd ed

  • 8/12/2019 Chapter02 Osc

    32/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Resolution

    Resolution (how much you can see the detail of

    the image) depends on sampling and gray levels.

    the bigger the sampling rate (n) and the gray scale(g), the better the approximation of the digitized

    image from the original. But the size of the image

    gets bigger

    Digital Image Processing 2nd ed

  • 8/12/2019 Chapter02 Osc

    33/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Non-uniform Sampling

    For a fixed value of spatial resolution, the

    appearance of the image can be improved by

    using adaptive sampling rates.Fine sampling

    Required in the neighborhood of sharp

    gray-level transitions.Coarse sampling

    Utilized in relatively smooth regions.

    Digital Image Processing, 2nd ed.

  • 8/12/2019 Chapter02 Osc

    34/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Chapter 2: Digital Image Fundamentals

    Digital Image Processing, 2nd ed.

  • 8/12/2019 Chapter02 Osc

    35/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Chapter 2: Digital Image Fundamentals

    For the images with a

    large amount of detail

    only a few gray levelsmay be needed.

    Digital Image Processing, 2nd ed.

  • 8/12/2019 Chapter02 Osc

    36/51

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Non-uniform Quantization

    unequally spaced levels in quantization process

    influences on the decreasing the number of gray

    level.use few gray levels in the neighborhood of

    boundaries.

    use more gray levels on smooth area in order to

    avoid the false contouring.

    Digital Image Processing, 2nd ed.

  • 8/12/2019 Chapter02 Osc

    37/51

    igital mage rocessing, nd ed.www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Basic Relationship amongpixels

    Neighbors of a pixelConnectivity

    Labeling of Connected ComponentsDistance Measures

    Arithmetic/Logic Operations

    Digital Image Processing, 2nd ed.i i b k

  • 8/12/2019 Chapter02 Osc

    38/51

    g g g,www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Neighbors of a Pixels

    Digital Image Processing, 2nd ed.i i b k

  • 8/12/2019 Chapter02 Osc

    39/51

    g g g,www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Connectivity

    Let V be the set of gray-level values used to defined connectivity4-connectivity :

    2 pixels p and q with values from V are 4-connected if q is in the

    set N4(p)

    8-connectivity :

    2 pixels p and q with values from V are 8-connected if q is in the set

    N8(p)

    m-connectivity (mixed connectivity):

    2 pixels p and q with values from V are m-connected if

    q is in the set N4(p) orq is in the set ND(p) and the set N4(p)N4(q) is empty.(the set of pixels that are 4-neighbors of both p and q whose

    values are from V )

    Digital Image Processing, 2nd ed.i i b k

  • 8/12/2019 Chapter02 Osc

    40/51

    g g g,www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Example of Connectivity

    Path 8 neighbors m neighbors

    m-connectivity eliminates the multiple pathconnections that arise in 8-connectivity.

    Digital Image Processing, 2nd ed.www imageprocessingbook com

  • 8/12/2019 Chapter02 Osc

    41/51

    g g g,www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Path

    a path from pixel p with coordinates (x,y) to pixel

    q with coordinates (s,t) is a sequence of distinct

    pixels with coordinates(x0,y0),(x1,y1),(xn,yn)

    , where (x0,y0) = (x,y) , (xn,yn) = (s,t) and (xi,yi) is

    adjacent to (xi-1,yi-1)

    n is the length of the pathwe can define 4-,8-, or m-paths depending on

    type of adjacency specified.

    Digital Image Processing, 2nd ed.www imageprocessingbook com

  • 8/12/2019 Chapter02 Osc

    42/51

    g g gwww.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Adjacent

    A pixel p is adjacent to a pixel q if they are

    connected.

    Two image area subsets S1 and S2 areadjacent if some pixel in S1 is adjacent to

    some pixel S2.

    Digital Image Processing, 2nd ed.www imageprocessingbook com

  • 8/12/2019 Chapter02 Osc

    43/51

    g g gwww.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Labeling 1

    Scan the image from left to right

    Let p denote the pixel at any step in the scanning

    process.

    Let r denote the upper neighbor of p.Let t denote the left-hand neighbors of p,

    respectively.

    When we get to p, points r and t have already

    been encountered and labeled if they were 1s.r

    t p

    Digital Image Processing, 2nd ed.www imageprocessingbook com

  • 8/12/2019 Chapter02 Osc

    44/51

    g g gwww.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Labeling 2

    if the value of p = 0, move on.

    if the value of p = 1, examine r and t.

    if they are both 0, assign a new label to p.

    if only one of them is 1, assign its label to p.if they are both 1

    if they have the same label, assign that label to p.

    if not, assign one of the labels to p and make a note that

    the two labels are equivalent. (r and t are connected

    through p).At the end of the scan, all points with value 1 have been

    labeled.

    Do a second scan, assign a new label for each equivalent

    labels.

    Digital Image Processing, 2nd ed.www imageprocessingbook com

  • 8/12/2019 Chapter02 Osc

    45/51

    g g gwww.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Labeling with 8 connected components

    do the same way but examine also the upper

    diagonal neighbors of p.

    if p is 0, move on.

    if p is 1

    if all four neighbors are 0, assign a new label to p.if only one of the neighbors is 1, assign its label to p.

    if two or more neighbors are 1, assign one of the

    label to p and make a note of equivalent classes.

    after complete the scan, do the second round and

    introduce a unique label to each equivalent class.

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

  • 8/12/2019 Chapter02 Osc

    46/51

    www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Distance Measures

    for pixel p, q and z with coordinates (x,y),

    (s,t) and (u,v) respectively,

    D is a distance function or metric if

    (a) D(p,q) 0 ; D(p,q) = 0 iff p=q

    (b) D(p,q) = D(q,p)(c) D(p,z) D(p,q) + D(q,z)

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

  • 8/12/2019 Chapter02 Osc

    47/51

    www.imageprocessingbook.com

    2002 R. C. Gonzalez & R. E. Woods

    Euclidean Distance

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

  • 8/12/2019 Chapter02 Osc

    48/51

    g p g

    2002 R. C. Gonzalez & R. E. Woods

    City-Block Distance

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

  • 8/12/2019 Chapter02 Osc

    49/51

    g p g

    2002 R. C. Gonzalez & R. E. Woods

    Chessboard Distance

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

  • 8/12/2019 Chapter02 Osc

    50/51

    g p g

    2002 R. C. Gonzalez & R. E. Woods

    M-connectivity distances

    distances of m-connectivity of the pathbetween 2 pixels depends on values of pixelsalong the path.

    e.g., if only connectivity of pixels valued 1 isallowed. find the m-distance between p and p4

    p3 p4 0 1 1 1 1 1

    p1 p2 0 1 0 1 1 1

    p 1 1 1

    d = 2 d=3 d=4

    Digital Image Processing, 2nd ed.www.imageprocessingbook.com

  • 8/12/2019 Chapter02 Osc

    51/51

    Linear and Nonlinear Operations

    An operator H is said to be alinearoperatorif it satisfy the following conditions.

    H(af - bg) = aH(f) + bH(g)

    where f and g are images and a and b are scalarsThe sum of two images is identical to applyingthe operator to the image individually, muliplyingthe results by the constants, and adding those

    results.An operator that fails the test of aboveequation is nonlinear. Ex) |afbg|