Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 21

Digital Image Processing

Dr. M. Ilyas Fakhir

Lecture-3
2
of
36
Single-pixel Operations
 The simplest operation we perform on a digital image is to
alter the intensity of its pixels individually using a
transformation function, T, of the form: s = T(z)
 where z is the intensity of a
pixel in the original image and
s is the (mapped) intensity of
the corresponding pixel in the
processed image.
 Fig. shows the transformation
used to obtain the negative
(sometimes called the complement)
of an 8-bit image.
3
of
36
Neighbourhood Operations
 Let Sxy denote the set of coordinates of a neighborhood
centered on an arbitrary point (x, y) in an image, f.
 Neighborhood processing generates a corresponding
pixel at the same coordinates in an output (processed)
image, g, such that the value of that pixel is determined
by a specified operation on the neighborhood of pixels
in the input image with coordinates in the set Sxy.

 Where r & c are row and column coordinates of the


pixels whose coordinates are in the set Sxy.
4
of
36
Neighbourhood Operations
 Local averaging
using neighborhood
processing. The
procedure is illustrated
in (a) and (b) for a
rectangular
neighborhood.
(c) An aortic
angiogram.
(d) The result of
using with m = n = 41.
The original image is
of size 790 x 686
pixels.
5
of
36
Geometric Transformations
 These transformations are called rubber-sheet
transformations because they may be viewed as
analogous to “printing” an image on a rubber sheet, then
stretching or shrinking the sheet according to a predefined
set of rules.
 Geometric transformations of digital images consist of two
basic operations:
 Spatial transformation of coordinates.
 Intensity interpolation that assigns intensity values to
the spatially transformed pixels.
6
of
36
Geometric Transformations
 The transformation of coordinates may be
expressed as:

Where (x , y) are pixel coordinates in the original image


and (x’ , y’) are the corresponding pixel coordinates of the
transformed image. For example, the transformation (x , y)
(x/2 , y/2) shrinks the original image to half its size in both
spatial directions.
7
of
36
Geometric Transformations
 However, it is possible to use homogeneous
coordinates to express all four affine transformations
using a single 3 x 3 matrix in the following general form:

This transformation can scale, rotate, translate, or


sheer an image, depending on the values chosen for
the elements of matrix A.
8
of
36
Geometric Transformations
9
of
36
Image Registration
 Image registration is an important application of digital image
processing used to align two or more images of the same
scene.
 In image registration, we have available an input image and a
reference image.
 The objective is to transform the input image geometrically to
produce an output image that is aligned (registered) with the
reference image.
 Examples of image registration include aligning two or more
images taken at approximately the same time, but using
different imaging systems, such as an MRI (magnetic resonance
imaging) scanner and a PET (positron emission tomography)
scanner.
10
of
36
Image Registration

(a) A 541 x 421 image of the letter T. (b) Image rotated -21°using nearest-neighbor interpolation for intensity assignments. (c) Image rotated -21°using bilinear interpolation. (d) Image rotated -21°using bicubic interpolation. (e)-(h) Zoomed sections (each square
is one pixel, and the numbers shown are intensity values).
11
of
36
Image Registration
 One of the principal approaches for solving the problem just discussed is to
use tie points (also called control points). These are corresponding points
whose locations
are known precisely in the input and reference images.
 For example, suppose that we have a set of four tie points each in an input
and a reference image. A simple model based on a bilinear approximation is
given by
x = c1 v + c2 w + c3 vw + c4 (i)
and
y = c5 v + c6 w + c7 vw + c8 (ii)
 During the estimation phase, (v , w) and (x , y) are the coordinates of tie points in the
input and reference images, respectively. If we have four pairs of corresponding tie
points in both images, we can write eight equations using Eqs. (i) and (ii) and use
them to solve for the eight unknown coefficients, c1 to c8.
12
of
36
Image Registration
 (a) A digital image. (b) Rotated
image (note the counterclockwise
direction for a positive angle of rotation).
(c) Rotated image cropped to fit the
same area as the original image.
(d) Image enlarged to
accommodate the entire rotated image.
13
of
36
Image Registration
 Image registration.
(a) Reference image. (b) Input (geometrically
distorted image). Corresponding tie points are
shown as small white squares near the corners.
(c) Registered (output) image (note the errors in the
border).
(d) Difference between (a) and (c), showing more
registration errors.
14
of
36
Vector & Matrix Operations
 Multispectral image processing is a typical area in which
vector and matrix operations are used routinely. For
example each pixel of an RGB image has three
components, which can be organized in the form of a
column vector

where z1 is the intensity of the pixel in the red image, and z2


and z3 are the corresponding pixel intensities in the green
and blue images, respectively.
15
of
36
Vector & Matrix Operations
 A general multispectral case involving n component
images will result in n-dimensional vectors:

 The inner product (also called the dot product) of two n-


dimensional column vectors a and b is defined as
16
of
36
Vector & Matrix Operations

 Forming a vector from corresponding pixel values in three RGB component


images.
17
of
36
Vector & Matrix Operations
 We can use vector notation to express several of the concepts discussed earlier. For example, the Euclidean distance, D(z,
a), between points (vectors) z and a in
n-dimensional space is defined as the Euclidean vector norm:
18
of
36
Euclidean Distance
 Using the Pythagorean theorem to compute two-dimensional Euclidean distance
19
of
36
Image Transforms
 All the image processing approaches discussed thus far operate directly on
the pixels of an input image; that is, they work directly in the spatial domain.
 A particularly important class of 2-D linear transforms, denoted T(u , v), can
be expressed in the general form
(i)

 where f (x, y) is an input image, (r, x, y, u, v) is called a forward


transformation kernel, and the Eq. is evaluated for u = 0, 1, 2, …, M - 1 and
v = 0, 1, 2, …, N - 1. As before, x and y are spatial variables, while M and N
are the row and column dimensions of f. Variables u and v are called the
transform variables. T(u, v) is called the forward transform of f(x, y).
20
of
36
Image Transforms
 Given T(u, v) we can recover f (x , y) using the inverse
transform of T(u, v):

(ii)

 for x = 0, 1, 2, …, M - 1 and y = 0, 1, 2, …, N - 1, where s(x,


y, u, v) is called an inverse transformation kernel. Together,
Eqs. (i) and (ii) are called a transform pair.
 General approach for working in the linear transform domain.
21
of
36
Probabilistic Methods
 We treat image intensities as random quantities in numerous places in the
book. For example, let zi, i =0, 1, 2, …, L - 1 denote the values of all possible
intensities in an M × N digital image. The probability, p(zk), of intensity level zk
occurring in the image is estimated as

 where nk is the number of times that intensity zk occurs in the image and MN is
the total number of pixels. Clearly

 Once we have p(zk), we can determine a number of important image


characteristics. For example, the mean (average) intensity and variance of
intensities.

You might also like