Sunteți pe pagina 1din 102

Resmi N.G. Reference: Digital Image Processing Rafael C. Gonzalez Richard E.

Woods

Elements of Visual Perception

3/18/2012

CS04 804B Image Processing - Module1

Human Eye- nearly a sphere; diameter 20mm approx. Three membranes enclose it:
Cornea and sclera the outer cover Choroid Retina Cornea tough transparent tissue that covers anterior surface of the eye. Sclera opaque membrane enclosing remainder of the optical globe. Choroid directly below the sclera - contains network of blood vessels (major source of nutrition to eye).
3/18/2012 CS04 804B Image Processing - Module1 3

Choroid coat is heavily pigmented - helps to reduce the extraneous light entering the eye and backscatter within the optical globe. Choroid is divided into ciliary body and iris diaphragm at the anterior extreme. The diaphragm contracts and expands to control the amount of light that enters the eye. Iris is the central opening of the eye. Diameter varies from 2-8mm. Front of the iris contains the visible pigment of the eye. Back of the iris Black pigment.
3/18/2012 CS04 804B Image Processing - Module1 4

Lens made up of concentric layers of fibrous cells and is suspended by fibers that attach to the ciliary body. It contains 60-70% water, 6% fat and large amount of protein. It is colored by slightly yellow pigmentation. Excessive clouding of lens leads to cataract resulting in poor color discrimination and loss of clear vision. It absorbs 8% of visible light spectrum; higher absorption occurs at shorter wavelengths.

3/18/2012

CS04 804B Image Processing - Module1

Retina When eye is properly focused, light from an object outside the eye is imaged at the retina. Pattern vision by distribution of light receptors over the surface of retina. Two classes of receptors:
Cones Rods

3/18/2012

CS04 804B Image Processing - Module1

Cones 6-7 million cones in each eye at the central portion of retina called the fovea. - highly sensitive to color - each cone is connected to its own nerve end - can resolve high details - muscles controlling the eye rotate the eyeball until the image of object falls on fovea. Cone vision is bright light (or photopic) vision.

3/18/2012

CS04 804B Image Processing - Module1

Rods 75-150 million rods over the retinal surface. -larger area of distribution Several rods are connected to a single nerve. - reduces the amount of detail -gives overall picture of filed of view -not involved in color vision - sensitive to low levels of illumination Rod vision is dim light (or scotopic) vision Blind spot Area without receptors.
3/18/2012 CS04 804B Image Processing - Module1 8

Image formation in the eye


Principal difference between lens of eye and ordinary optical lens is that lens of eye is more flexible. The radius of curvature of anterior surface of lens is greater than radius of its posterior surface. The shape of the lens is controlled by tension in fibres of the ciliary body.

3/18/2012

CS04 804B Image Processing - Module1

To focus on farther objects, the controlling muscles cause lens to be relatively flattened. To focus on nearby objects, these muscles allow the lens to become thicker.

3/18/2012

CS04 804B Image Processing - Module1

10

Focal length- distance between center of lens and retina(varies from 17mm-14mm). 15/100 = h/17 Or, h=2.55mm

3/18/2012

CS04 804B Image Processing - Module1

11

Retinal image is reflected primarily in the area of fovea. Perception then takes place by relative excitation of light perceptors(transforms radiant energy into electric impulses that are ultimately decoded by the brain).

3/18/2012

CS04 804B Image Processing - Module1

12

Brightness Adaptation and Discrimination


Digital images are displayed as discrete set of intensities. So, ability of eye to discriminate between different intensity levels is important. Subjective brightness (intensity as perceived by human visual system) is a logarithmic function of light intensity incident on the eye.

3/18/2012

CS04 804B Image Processing - Module1

13

Visual system can adapt to large range of intensities by changing its overall sensitivity. This property is called brightness adaptation. Total range of distinct intensity levels it can discriminate simultaneously is small. The current sensitivity level of visual system for any given set of conditions is called brightness adaptation level.

3/18/2012

CS04 804B Image Processing - Module1

14

3/18/2012

CS04 804B Image Processing - Module1

15

Brightness Discrimination
Experiment to determine ability of human visual system for brightness discrimination: An opaque glass is illuminated from behind using a light source of intensity I. Add Is till a perceived change occurs.

3/18/2012

CS04 804B Image Processing - Module1

16

The ratio of the increment threshold to the background intensity, Ic/I, is called the Weber ratio. When Ic/I is small, small % change in intensity is discriminable, and hence there is good brightness discrimination. When Ic/I is large, large % change in intensity is required and hence there is poor brightness discrimination (at low levels of illumination). When in a noisy environment you must shout to be heard while a whisper works in a quiet room.
3/18/2012 CS04 804B Image Processing - Module1 17

3/18/2012

CS04 804B Image Processing - Module1

18

The brightness discrimination background illumination increases.

increases

as

As the eye roams about the image, a different set of incremental changes are detected at each new adaptation level. The eye is thus capable of a much broader range of overall intensity discrimination.

3/18/2012

CS04 804B Image Processing - Module1

19

Perceived brightness is not a simple function of intensity. Mach Bands:

3/18/2012

CS04 804B Image Processing - Module1

20

Simultaneous Contrast:

3/18/2012

CS04 804B Image Processing - Module1

21

Optical illusions:

3/18/2012

CS04 804B Image Processing - Module1

22

Light and Electromagnetic Spectrum

3/18/2012

CS04 804B Image Processing - Module1

23

Wavelength, and frequency are related by the expression

c =
where c is the speed of light. Energy of various components of electromagnetic spectrum is given by
E = h

where h is the Plancks constant.

3/18/2012

CS04 804B Image Processing - Module1

24

Electromagnetic wave is a stream of massless particles, each traveling in a wavelike pattern and at the speed of light. Each massless particle contains a certain amount of energy. Each bundle of energy is called a photon. Light is a particular type of electromagnetic radiation that can be seen and sensed by human eye.
3/18/2012 CS04 804B Image Processing - Module1 25

Visible band from violet to red (chromatic light). The colors that we perceive in an object are determined by the nature of the light reflected from the object. Three basic quantities describe the quality of chromatic light source:
Radiance Luminance Brightness

3/18/2012

CS04 804B Image Processing - Module1

26

Radiance total amount of energy that flows from the light source (measured in Watts). Luminance gives a measure of amount of energy an observer perceives from a light source (measured in Lumens). Brightness intensity as perceived by human visual system.

3/18/2012

CS04 804B Image Processing - Module1

27

Luminance is the amount of visible light that comes to the eye from a surface. Illuminance is the amount of light incident on a surface. Reflectance is the proportion of incident light that is reflected from a surface. Lightness is the perceived reflectance of a surface. Brightness is the perceived intensity of light coming from the image itself, and is also defined as perceived luminance.
3/18/2012 CS04 804B Image Processing - Module1 28

Achromatic or monochromatic light light that is void of color, its only attribute being the intensity (ranges from black to grays to white).

3/18/2012

CS04 804B Image Processing - Module1

29

Image Sensing and Acquisition


Images are generated by combination of an illumination source and reflection or absorption of energy from that source by objects to be imaged. Three principal sensor arrangements to transform illumination energy into digital images:
Single imaging sensor Line sensor Array sensor
3/18/2012 CS04 804B Image Processing - Module1 30

3/18/2012

CS04 804B Image Processing - Module1

31

Image Acquisition Using Single Sensor


Incoming energy is converted to a voltage by combination of input electric power and sensor material responsive to the type of energy being detected. Response of the sensor is the output voltage waveform which has to be digitized. Filter is used to improve selectivity.
3/18/2012 CS04 804B Image Processing - Module1 32

eg; photodiode
Constructed of silicon materials Output voltage waveform proportional to light.

3/18/2012

CS04 804B Image Processing - Module1

33

To generate 2D image using single sensor, there must be relative displacements in both x and y directions between sensor and the area to be imaged.

3/18/2012

CS04 804B Image Processing - Module1

34

Another example of imaging with single sensor


Place a laser source coincident with the sensor Moving mirrors are used to control the outgoing beam in a scanning pattern and to direct the laser signal onto the sensor.

3/18/2012

CS04 804B Image Processing - Module1

35

Image Acquisition Using Sensor Strips


Sensor strip has an in-line arrangement of sensors. The sensor strip provides imaging elements in one direction. Motion perpendicular to the strip provides imaging in the other direction, thereby completing the 2D image.

3/18/2012

CS04 804B Image Processing - Module1

36

3/18/2012

CS04 804B Image Processing - Module1

37

Image Acquisition Using Sensor Arrays

3/18/2012

CS04 804B Image Processing - Module1

38

Since, the sensor array is 2D, a complete image can be obtained by focusing the energy onto the surface of the array. Imaging system collects the incoming energy from an illumination source and focuses it onto an image plane. The front end of the imaging system is a lens (if illumination is light), which projects the viewed scene onto the lens focal plane.

3/18/2012

CS04 804B Image Processing - Module1

39

The sensor array coincident with the focal plane produces output proportional to the intensity of light received at each sensor. This output is then digitized by another section of the imaging system.

3/18/2012

CS04 804B Image Processing - Module1

40

A Simple Image Formation Model


Images are denoted using two-dimensional functions of the form f(x,y). The value of f is a positive scalar quantity. When an image is generated from a physical process, its values are proportional to energy radiated by a physical source. Hence, f(x,y) must be nonzero and finite. 0 < f(x,y) <
3/18/2012 CS04 804B Image Processing - Module1 41

The function f(x,y) is characterized by two components: Illumination component : The amount of source illumination incident on the scene being viewed. It is denoted by i(x,y). Reflectance component: The amount of illumination reflected by the objects in the scene. It is denoted by r(x,y). f(x,y) is expressed as a product of these two components. f(x,y) = i(x,y)r(x,y)
3/18/2012 CS04 804B Image Processing - Module1 42

where 0 < i(x,y) < and 0 < r(x,y) < 1 (total absorption) (total reflectance) The nature of i(x,y) is determined by the illumination source. The nature of r(x,y) is determined by the characteristics of the imaged objects. For images formed by transmission of the illumination through a medium (as in X-ray imaging), reflectivity is replaced by transmissivity.
3/18/2012 CS04 804B Image Processing - Module1 43

The intensity of a monochrome image at any point (x0,y0) is called the gray level l of the image at that point. l = f (x0,y0)
l lies in the range Lmin l Lmax Lmin : should be positive Lmax : should be finite

Lmin= imin rmin Lmax= imax rmax The interval [Lmin, Lmax] is called the gray scale.
3/18/2012 CS04 804B Image Processing - Module1 44

Image Sampling and Quantization


The output of most sensors is a continuous voltage waveform whose amplitude and spatial behaviour are related to the physical phenomenon being sensed. This continuous sensed data has to be converted to digital form. This involves two processes:
Sampling Quantization
3/18/2012 CS04 804B Image Processing - Module1 45

Basic Concepts
An image may be continuous with respect to the x- and y-coordinates and also in amplitude. To convert it to digital form, the function must be sampled in both coordinates and in amplitude. Digitizing the coordinate values is called sampling. Digitizing the quantization.
3/18/2012

amplitude

values

is

called

CS04 804B Image Processing - Module1

46

Generating Digital Image

3/18/2012

CS04 804B Image Processing - Module1

47

To sample the plot of amplitude values of the continuous image along AB, take equally spaced samples along AB. This set of discrete locations give the sampled function. The sample values still span a continuous range of gray-level values. These values also must be converted to discrete quantities(quantization) to obtain a digital image. The gray level scale can be divided into a number of discrete levels ranging from black to white.
3/18/2012 CS04 804B Image Processing - Module1 48

In the figure, one of the eight discrete gray levels is assigned to each sample. Starting at the top of the image and carrying out this procedure line by line for the entire image will produce a two-dimensional digital image.

3/18/2012

CS04 804B Image Processing - Module1

49

Method of sampling is determined by the sensor arrangement used to generate the image. Single sensing element combined with mechanical motion
Sampling by selecting the number of individual mechanical increments at which the sensor is activated to collect the data.

Sensing Strip
Sampling the number of sensors in the strip limits sampling in one direction.

Sensor array
Sampling the number of sensors in the array limits sampling in both the directions.
3/18/2012 CS04 804B Image Processing - Module1 50

Representing Digital Images


The result of sampling and quantization is a matrix of real numbers. Let the image f(x,y) be sampled such that the digital image has M rows and N columns. The values of coordinates are now discrete quantities.

3/18/2012

CS04 804B Image Processing - Module1

51

3/18/2012

CS04 804B Image Processing - Module1

52

The complete MxN image can be represented using matrix form. Each element of the matrix array is called an image element, picture element or pixel.

f (0,0) f (1,0) f ( x, y) = ... f ( N 1,0)


3/18/2012

f (0, M 1) ... ... f (1, M 1) ... ... ... f ( N 1,1) ... f ( N 1, M 1) f (0,1) ...
53

CS04 804B Image Processing - Module1

a0,0 a0,1 a0,N-1 a1,0 a1,1 a1,N-1 A = . . . . . . aM-1,0 aM-1,1 aM-1,N-1 where aij = f(x=i,y=j) = f(i,j). The sampling process may be viewed as partitioning the xy-plane into a grid. f(x,y) is a digital image if (x,y) are integers from Z2 and f is a function that assigns a gray-level value to each distinct pair of coordinates (x,y).
3/18/2012 CS04 804B Image Processing - Module1 54

The number of distinct gray-levels allowed for each pixel is an integer power of 2. L = 2k The range of values spanned by the gray scale is called the dynamic range of an image. High dynamic range high contrast image Low dynamic range low contrast image The number of bits required to store a digitized image, b=MxNxk When M =N, b = N2k. When an image can have 2k gray levels, it is referred to as a k-bit image.
3/18/2012 CS04 804B Image Processing - Module1 55

Spatial and Gray-Level Resolution


Sampling determines the spatial resolution of an image, which is the smallest discernible detail in an image. Resolution is the smallest number of discernible line pairs per unit distance. A line consists of a line and its adjacent space. Resolution can also be represented using number of pixel columns (width) and number of pixel rows (height).
3/18/2012 CS04 804B Image Processing - Module1 56

Resolution can also be defined as the total number of pixels in an image, given as number of megapixels. More the number of pixels in a fixed range, higher the resolution. Gray-level resolution refers to the smallest discernible change in gray level. More the number of bits, higher the resolution.
3/18/2012 CS04 804B Image Processing - Module1 57

Consider an image of size 1024 x 1024 pixels whose gray levels are represented by 8 bits. The image can be subsampled to reduce its size. Subsampling is done by deleting appropriate number of rows from the original image. eg; A 512 x 512 image can be obtained by deleting every other row and column from 1024 x 1024 image. The number of gray levels is kept constant.

3/18/2012

CS04 804B Image Processing - Module1

58

3/18/2012

CS04 804B Image Processing - Module1

59

3/18/2012

CS04 804B Image Processing - Module1

60

The number of samples is kept constant and the number of gray levels is reduced.

3/18/2012

CS04 804B Image Processing - Module1

61

The number of bits is reduced keeping spatial resolution constant.

3/18/2012

CS04 804B Image Processing - Module1

62

False contouring When the bit depth becomes insufficient to accurately sample a continuous gradation of color tone, the continuous gradient will appear as a series of discrete steps or bands. This is termed as false contouring.

3/18/2012

CS04 804B Image Processing - Module1

63

Images can be of low detail, intermediate detail, or high detail depending on the values of N and k.

3/18/2012

CS04 804B Image Processing - Module1

64

Each point in Nk-plane represents an image having values of N and k equal to coordinates of that point. Isopreference curves Curves that correspond to images of equal subjective quality.

3/18/2012

CS04 804B Image Processing - Module1

65

The quality of the images tends to increase as N and k are increased. A decrease in k generally increases the apparent contrast of an image. For images with a larger amount of detail, only a few gray levels are needed.

3/18/2012

CS04 804B Image Processing - Module1

66

Aliasing and Moire Patterns


Aliasing The distortion that results from undersampling when the signal reconstructed from samples is different from the original continuous signal. Shannon Sampling Theorem To avoid aliasing, the sampling rate should be greater than or equal to twice the highest frequency present in the signal.

3/18/2012

CS04 804B Image Processing - Module1

67

Sine Wave

Sine Wave sampled once per cycle

3/18/2012

CS04 804B Image Processing - Module1

68

Sine Wave sampled 1.5 times per cycle - results in a lower frequency wave

Sine Wave sampled twice per cycle

3/18/2012

CS04 804B Image Processing - Module1

69

For an image, aliasing occurs if the resolution is too low. To reduce the aliasing effects on an image, its high frequency components are reduced prior to sampling by blurring the image. Moire Pattern Interference patterns created when two grids are overlaid at an angle.

3/18/2012

CS04 804B Image Processing - Module1

70

3/18/2012

CS04 804B Image Processing - Module1

71

Zooming and Shrinking Digital Images


Zooming Oversampling Shrinking Undersampling Zooming involves two steps:
Creation of new pixel locations Assigning gray levels to new pixel locations

Nearest neighbour interpolation


Pixel Replication

Bilinear interpolation
3/18/2012 CS04 804B Image Processing - Module1 72

Nearest neighbour interpolation


Size of zoomed image need not be an integer multiple of size of original image. Fits a finer grid over the original image. Gray level corresponding to the closest pixel in original image is assigned as the gray level of new pixel. Expand the grid to the original size.

Pixel replication
Special case of nearest neighbour interpolation Size of zoomed image is an integer multiple of size of original image Duplication of columns and rows are done the required number of times. Produces checkerboard effect.
3/18/2012 CS04 804B Image Processing - Module1 73

Bilinear interpolation uses 4 nearest neighbours of a point.

3/18/2012

CS04 804B Image Processing - Module1

74

Linear interpolation: a straight line between the 2 known points.

This can be understood as a weighted average, where the weights are inversely related to the distance from the end points to the unknown point.

3/18/2012

CS04 804B Image Processing - Module1

75

The weights are

which are

the normalized distances between the unknown point and each of the end points.

3/18/2012

CS04 804B Image Processing - Module1

76

Interpolating in x-direction

Interpolating in y-direction

3/18/2012

CS04 804B Image Processing - Module1

77

3/18/2012

CS04 804B Image Processing - Module1

78

Bilinear interpolation uses 4 nearest neighbours of a point. The gray level assigned to the new pixel is given by v(x,y) = ax + by + cxy + d The coefficients are determined from the four equations in four unknowns written using the four nearest neighbours of (x,y).

3/18/2012

CS04 804B Image Processing - Module1

79

3/18/2012

CS04 804B Image Processing - Module1

80

Shrinking Shrinking by a non-integer factor


Expands the grid to fit over the original image. Does gray-level nearest neighbour or interpolation Shrinks the grid back to the original size. bilinear

3/18/2012

CS04 804B Image Processing - Module1

81

Basic Relationships Between Pixels


Neighbours of a pixel
4-neighbours diagonal-neighbours 8-neighbours (i-1,j-1) (i-1,j) (i-1,j+1)

Adjacency
4-adjacency 8-adjacency m-adjacency

(i,j-1)

(i,j)

(i,j+1)

(i+1,j-1)

(i+1,j)

(i+1,j+1)

3/18/2012

CS04 804B Image Processing - Module1

82

Neighbours of a pixel
A pixel p at (x,y) has 4 horizontal and vertical neighbours whose coordinates are given by: (x+1,y) , (x-1,y), (x, y+1) and (x,y-1) This set of pixels called the 4-neighbours of p is denoted by N4(p). Each pixel is of unit distance from p and may lie outside the digital image for a pixel on the border of the image.

3/18/2012

CS04 804B Image Processing - Module1

83

The 4 diagonal neighbours are given by: (x+1, y+1), (x+1, y-1), (x-1, y+1) and (x-1, y-1)
This set of pixels is denoted by ND(p). These points together with the 4-neighbours are called the 8neighbours of p, denoted by N8(p).

3/18/2012

CS04 804B Image Processing - Module1

84

Adjacency, Connectivity, Regions and Boundaries Connectivity Two pixels are connected if they are neighbours and if their gray levels satisfy a specified criterion of similarity (eg; if their gray levels are equal). Adjacency Let V be the set of gray-level values used to define adjacency. In binary image, V={1}, for adjacency of pixels with value 1. a) 4-adjacency: Two pixels p and q with values from V are 4-adjacent if q is in the set N4(p).

3/18/2012

CS04 804B Image Processing - Module1

85

b) 8-adjacency: Two pixels p and q with values from V are 8-adjacent if q is in the set N8(p). c) m-adjacency : Two pixels p and q with values from V are m-adjacent if :
q is in N4(p) Q is in ND(p) and the set N4(p)N4(q) has no pixels whose values are from V.

3/18/2012

CS04 804B Image Processing - Module1

86

3/18/2012

CS04 804B Image Processing - Module1

87

Two image subsets S1 and S2 are adjacent if some pixel in S1 is adjacent to some pixel in S2. A digital path or curve 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 pixels (xi,yi) and (xi-1,yi-1) are adjacent for 1 i n. n is the length of the path. If (x0,y0) = (xn,yn) ,the path is a closed path.
3/18/2012 CS04 804B Image Processing - Module1 88

We call the paths 4-, 8-, or m-paths depending on the type of adjacency.

3/18/2012

CS04 804B Image Processing - Module1

89

Let S be a subset of pixels in an image. Connectivity: 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. Connected Component: For any pixel p in S, the set of pixels that are connected to it in S is called a connected component of S.
Connected Set: If the set S has only one connected component, then it is called a connected set.
3/18/2012 CS04 804B Image Processing - Module1 90

Region: Let R be a subset of pixels in an image. If R is a connected set, it is called a region of the image. Boundary: Boundary of a region R is the set of pixels in the region that have one or more neighbours that are not in R. It forms a closed path
and is a global concept. Edge: Edges are formed from pixels with derivative values that exceed a threshold. It is based on measure of gray-level discontinuity at a point and is a local concept.
3/18/2012 CS04 804B Image Processing - Module1 91

Distance Measures For pixels p, q and z with coordinates (x,y), (s,t) and (v,w) respectively D is a distance function 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)

3/18/2012

CS04 804B Image Processing - Module1

92

The Euclidean distance between p and q is defined as


De(p,q) = [(x-s)2 + (y-t)2]1/2

D4 distance (or city-block distance) between p and q is defined as


D4(p,q) = |x-s|+|y-t| Pixels with D4 = 1 are 4-neighbours of (x,y).

D8 distance (or chessboard distance) between p and q is defined as


D8(p,q) = max(|x-s|,|y-t|) Pixels with D8 = 1 are 8-neighbours of (x,y).
3/18/2012 CS04 804B Image Processing - Module1 93

D4 and D8 distances between p and q are independent of any paths that might exist between the points because the distances involve only the coordinates of the points.

3/18/2012

CS04 804B Image Processing - Module1

94

Euclidean distance (2-norm)

D4 distance (city-block distance) 4 3 2 3 4 3 2 1 2 3 2 3 4 3 2 3 4

D8 distance (chessboard distance) 2 2 2 2 2 2 1 1 1 2 2 2 2 2 2 2 2

2 2 5 2

52 2
2

1 0 1

1 2 0 1 2 1 2 3

1 1 0 1 2 1 1 2

2
5
2 2

1
2

1
2

2
5

5 2

52 2

3/18/2012

CS04 804B Image Processing - Module1

95

Dm distance between p and q is defined as the shortest m-path between the two points. a) V= {1}

Dm = 2 pp2p4
3/18/2012 CS04 804B Image Processing - Module1 96

b) V= {1}

Dm = 3 pp1p2p4
3/18/2012 CS04 804B Image Processing - Module1 97

c) V= {1}

Dm = 3 pp2p3p4
3/18/2012 CS04 804B Image Processing - Module1 98

d) V= {1}

Dm = 4 pp1p2p3p4
3/18/2012 CS04 804B Image Processing - Module1 99

Image Operations on Pixels


Images are represented as matrices. Matrix division is not defined. Arithmetic operations including division are defined between corresponding pixels in the images involved.

3/18/2012

CS04 804B Image Processing - Module1

100

Linear and Non-linear Operations


Let H be an operator whose input and output are images. H is said to be linear operator if for any two images f and g and any two scalars a and b, H(af + bg) = aH(f) + bH(g) eg; adding 2 images. Non-linear operation does not obey the above condition.

3/18/2012

CS04 804B Image Processing - Module1

101

Thank You

3/18/2012

CS04 804B Image Processing - Module1

102

S-ar putea să vă placă și