BIM472 Image processing - PowerPoint PPT Presentation

1 / 57
About This Presentation
Title:

BIM472 Image processing

Description:

In the central portion of retina (which is called fovea) Highly sensitive to color ... Fovea versus CCDs. We can think fovea as 1.5 mm. 1.5 mm. with 337,000 elements ... – PowerPoint PPT presentation

Number of Views:103
Avg rating:3.0/5.0
Slides: 58
Provided by: MMF4
Category:

less

Transcript and Presenter's Notes

Title: BIM472 Image processing


1
BIM472 Image processing
  • Week 2

2
Contents
  • Visual Perception
  • Image Sensing and Acquisition
  • Sampling and Quantization
  • Representing Digital Images
  • Zooming and Shrinking Digital Images
  • Some Basic Relationships Between Pixels

3
Human Eye
4
Elements of Visual Perception
  • When the eye is properly focused, light from an
    object outside the eye is imaged on the retina
  • There are discrete light receptors on the retina
  • There are two classes of receptors Cones and Rods

5
Cones
  • Number of 6-7 million
  • In the central portion of retina (which is called
    fovea)
  • Highly sensitive to color
  • Humans can resolve fine details by them
  • Each one is connected to its own nerve end
  • Cone vision is called photopic or bright-light
    vision

6
Rods
  • Number of 75-150 millions
  • Several nodes are connected to a single nerve
  • Less detail is discernible by them
  • Serve to give a general, overall picture of the
    field of the view
  • Not involved in color vision
  • Sensitive to low-level illumination
  • We see colored-objects colorless at moonlight.
    This phenomena is called scotopic or dim-light
    vision

7
Fovea versus CCDs
  • We can think fovea as 1.5 mm. 1.5 mm. with
    337,000 elements
  • CCD can contain that number of receptors in an
    area of 5 mm. 5 mm.

8
Brightness Adaptation and Discrimination
  • Real brightness and perceived brightness are a
    bit different
  • Visual system tends to undershoot or overshoot
    around the boundary of regions of different
    intensities
  • A regions perceived brightness does not depend
    simply on its intensity
  • Optical illusions

9
Undershooting and Overshooting
10
Simultaneous Contrast
11
Optical Illusions
12
Light and EM Spectrum
  • The colors that humans perceive in an object are
    determined by the nature of the light reflected
    from the object
  • Electromagnetic spectrum was mentioned last week

13
Image Sensing and Acquisition
14
Image Sensing and Acquisition
  • The most familiar sensor is photodiode
  • Filter is used to improve selectivity (e.g. green
    light)

15
Single Sensor
16
Sensor Strips
17
Sensor Strips
  • Scanners
  • Photocopy machines
  • Geographical imaging
  • Medical imaging
  • Industrial imaging

18
Sensor Arrays
19
Sensor Arrays
  • Used in digital cameras
  • Sensor array is called Charged-Coupled Device
    (CCD)
  • In digital cameras there may be 4000 4000 CCDs

20
Sampling and Quantization
  • Digitizing the coordinate values is called
    sampling
  • Digitizing the amplitude values is called
    quantization
  • Remember that images are represented by 2D
    function f(x,y)
  • Digitizing x and y is called sampling
  • Digitizing f is called quantization

21
Sampling and Quantization
22
Sampling and Quantization
23
Digitizing Digital Images
24
Digitizing Digital Images
  • The number of gray levels typically is an integer
    power of 2 L 2k
  • We assume that the discrete levels are equally
    spaced and that they are in the interval 0, L -
    1
  • The number of bits required to store a digital
    image of size M N is b M N k

25
k-bit Image
  • The images that have 2k gray levels is called
    k-bit images
  • For example An image with 256 possible
    gray-level values is called an 8-bit image

26
Spatial and Gray-Level Resolution
  • Spatial resolution is the smallest discernible
    detail in an image
  • Gray-level resolution is the smallest discernible
    change in gray-level

27
Spatial Resolution
28
Spatial Resolution
29
Gray-Level Resolution
30
Gray-Level Resolution
31
Details in Digital Images
32
Zooming and Shrinking
  • Nearest neighbor interpolation
  • Example 500 500 ? 750 750
  • Pixel replication
  • Special case of nearest neighbor interpolation
  • Example 500 500 ? 1500 1500
  • Bilinear interpolation
  • Uses four nearest neighbors

33
Bilinear Interpolation
34
Some Basic Relationships Between Pixels
  • Neighbors of a pixel
  • Adjacency
  • Path
  • Connectivity
  • Region
  • Boundary
  • Edge
  • Distance measures

35
Neighbors of a Pixel
  • Let p be a pixel
  • 4-neighbors of p is N4(p)
  • Horizontal and vertical neighbors of p
  • Diagonal-neighbors of p is ND(p)
  • Diagonal neighbors of p
  • 8-neighbors of p is N8(p)
  • Both N4(p) and ND(p)
  • Some neighbors may fall outside of image

36
Adjacency
  • Let V be a set of gray-level values used to
    define adjacency
  • If the gray-level values of two neighbor pixels
    are in V, then they are connected
  • For binary images with values 0 and 1, V may be
    defined as V 1
  • For gray-scale images, V may be any subset of all
    possible gray-level values
  • For example V 250,251,252,253,254,255

37
Adjacency
  • 4-adjacency
  • p and q are 4-adjacent if q is in N4(p) and p and
    q have values from V
  • 8-adjacency
  • p and q are 8-adjacent if q is in N8(p) and p and
    q have values from V
  • m-adjacency (mixed adjacency)
  • p and q have values from V
  • i) q is in N4(p) or ii) q is in ND(p) and
    the set N4(p)?N4(q) has no pixels whose values
    are from V

38
Adjacency
N4(p)?N4(q)
39
Adjacency Example
40
Adjacency
  • Two image subsets S1 and S2 are adjacent if some
    pixel in S1 is adjacent to some pixel in S2
  • Here, adjacent means 4-, 8-, or m-adjacent

41
Path
  • A (digital) path (or curve) from p (x0 , y0) to
    q (xn , yn) is a sequence of distinct pixels
    with coordinates (x0 , y0), (x1 , y1), , (xn ,
    yn) and (xi , yi) and (xi-1 , yi-1) are adjacent
    for 1 i n
  • Here, n is the length of the path
  • If (x0 , y0) (xn , yn), the path is a closed
    path
  • 4-path, 8-path and m-path are defined according
    to the adjacency

42
Connectivity
  • Let S represent a subset of pixels in an image.
  • Two pixels p and q are said to be connected in S
    if there exists a path between them consisting
    entirely of pixels in S.
  • For any pixel p in S, the set of pixels that are
    connected to it in S is called a connected
    component of S.
  • If S has only one connected component, then the
    set S is called a connected set.

43
Region
  • Let R be a subset of pixels in an image.
  • We call R a region of the image if R is a
    connected set.

44
Boundary
  • The boundary (border or contour) of a region R is
    the set of pixels in the region that have one or
    more neighbors that are not in R.
  • If R happens to be an entire image, then its
    boundary is defined as the first and last rows
    and columns of the image.
  • The boundary of a finite region forms a closed
    path.

45
Edge
  • An edge is a set of connected pixels that lie on
    the boundary between two regions.
  • Edges are intensity discontinuities and
    boundaries are closed paths.

46
Distance Measures
  • For pixels p(x,y), q(s,t) and z(v,w), D is a
    distance function or metric if
  • a) D(p,q) 0 and D(p,q) 0 iff p q
  • b) D(p,q) D(q,p)
  • c) D(p,z) D(p,q) D(q,z).
  • The Euclidian distance between p and q is defined
    as
  • De(p,q) (x-s)2 (y-t)21/2

47
D4 and D8 Distances
  • D4 distance is also called city-block distance
  • D4(p,q) x s y t
  • D8 distance is also called chessboard distance
  • D8(p,q) max( x s , y t )

48
Using MATLAB for Image Processing
49
Image File Formats
  • TIFF Tagged Image File Format
  • JPEG Joint Photographic Experts Group
  • GIF Graphics Interchange Format
  • BMP Windows Bitmap
  • PNG Portable Network Graphics
  • XWD X Window Dump

50
Coordinate Conventions
51
Image Functions
  • f imread(cameraman.tif)
  • size(f)
  • M, N size(f)
  • imshow(f)
  • imshow(f, low high )
  • imshow(f, )
  • pixval
  • imshow(f) figure imshow(g)
  • imwrite(f, newpicture.jpg)
  • K imfinfo(cameraman.tif)

52
Image Types
  • The toolbox supports four types of images
  • Intensity images
  • Binary images
  • Indexed images
  • RGB images

53
Intensity Images
  • If the elements of an intensity image are of
    class uint8, or class uint16, then they have
    integer values in the range 0, 255 and 0,
    65535 respectively/
  • If the image is of class double, the values are
    floating-point numbers and take the values in the
    range 0, 1.

54
Binary Images
  • A binary image is a logical array of 0s and 1s.
  • A numeric array is converted to binary using the
    function logical.

55
Converting between Image Classes
  • im2uint8
  • im2uint16
  • mat2gray
  • Converts double matrices to double images in the
    range 0, 1
  • im2double
  • im2bw
  • Converts its input to logical image

56
Functions
  • This program sums and subtracts
  • two parameters
  • function sum, diff myfunc(a, b)
  • sum a b
  • diff a - b
  • return

Write this code into a file named myfunc.m
57
Exercises
  • How can you flip an image vertically?
  • How can you flip an image horizontally?
  • How can you crop an image?
  • How can you subsample an image (i.e. make
    smaller)?
Write a Comment
User Comments (0)
About PowerShow.com