Mathematical Preliminaries I

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 37

MATHEMATICAL

PRELIMINARIES PART I

Unit III
Pixel

 A pixel as the smallest element of an image.


 A pixel can store a value proportional to the light intensity at
that particular location.
Resolution

 The resolution can be defined in many ways,


 pixel resolution,
 spatial resolution,
 temporal resolution,
 spectral resolution.
 In our own computer settings, we have monitor resolution of
800 x 600, 640 x 480 etc
Pixel Resolution

 In pixel resolution, the term resolution refers to the total number of count of
pixels in an digital image.
For example. If an image has M rows and N columns, so,
resolution =M X N.
 Resolution is define the total number of pixels,
 Pixel resolution can be defined with set of two numbers,
 The first number the width of the picture, or the pixels across columns,
 The second number is height of the picture, or the pixels across its rows.
 Higher is the pixel resolution, the higher is the quality of the image.
 We can define pixel resolution of an image as 4500 X 5500.
Megapixels

 We can calculate mega pixels of a camera using pixel


resolution.
Column pixels (width ) x row pixels ( height ) / 1 Million.

 The size of an image can be defined by its pixel resolution.


Size = pixel resolution x bpp ( bits per pixel )

Note: Bpp or bits per pixel denotes the number of bits per pixel. The number of
different colors in an image is depends on the depth of color or bits per
pixel.
Calculating the mega pixels of the camera

 An image of dimension: 2500 X 3192.


 Its pixel resolution = 2500 * 3192 = 7982350 bytes.
 Dividing it by 1 million = 7.9 = 8 mega pixel (approximately).
Aspect ratio

 Aspect ratio is the ratio between width of an image and the


height of an image.

 It is commonly explained as two numbers separated by a colon


(8:9).

 This ratio differs in different images, and in different screens.


The common aspect ratios are:1.33:1, 1.37:1, 1.43:1, 1.50:1,
1.56:1, 1.66:1, 1.75:1, 1.78:1, 1.85:1, 2.00:1, etc
Gray level resolution

 Gray level resolution is a term that refers to the number of


shades of gray utilized in preparing the image for display.

 In short gray level resolution is equal to the number of bits per


pixel.

 Digital images having higher gray-level resolution are


composed with a larger number of gray shades and are
displayed at a greater bit depth than those of lower gray-level
resolution.
BPP

 The number of different colors in an image is depends on the


depth of color or bits per pixel.

 The mathematical relation that can be established between gray


level resolution and bits per pixel can be given as.
L=2^k
 In this equation L refers to number of gray levels. It can also
be defined as the shades of gray.
 k refers to bpp or bits per pixel. So the 2 raise to the power of
bits per pixel is equal to the gray level resolution.
Gray level resolution

For example:
 The image of Einstein is an gray scale image. Means it is an image
with 8 bits per pixel or 8bpp.
 Calculate the gray level resolution,

 It means it gray level resolution is 256. Or in other way we can say that
this image has 256 different shades of gray.
Spatial resolution

 Spatial resolution states that the clarity of an image cannot be determined


by the pixel resolution.

 The number of pixels in an image does not matter.

 Spatial resolution can be defined as the number of independent pixels


values per inch.

 In short what spatial resolution refers to is that we cannot compare two


different types of images to see that which one is clear or which one is
not. If we have to compare the two images, to see which one is more clear
or which has more spatial resolution, we have to compare two images of
the same size.
Spatial resolution: Example

 We cannot compare these two images


to see the clarity of the image.
 Although both images are of the same
person, but that is not the condition we
are judging on. The picture on the
above is zoomed out picture of Einstein
with dimensions of 227 x 222. Whereas
the picture on the below has the
dimensions of 980 X 749 and also it is
a zoomed image.
 We cannot compare them to see that
which one is more clear. Remember the
factor of zoom does not matter in this
condition, the only thing that matters is
that these two pictures are not equal.
Spatial resolution: Example

 Now we can compare these two pictures.


Both the pictures has same dimensions
which are of 227 X 222. Now when we
compare them, we will see that the
picture on the above has more spatial
resolution or it is more clear then the
picture on the below. That is because the
picture on the below is a blurred image.
Measuring spatial resolution

 Spatial resolution refers to clarity, so for different devices, different


measure has been made to measure it.

 For example
 Dots per inch: Dots per inch or DPI is usually used in monitors.

 Lines per inch: Lines per inch or LPI is usually used in laser
printers.

 Pixels per inch: Pixel per inch or PPI is measure for different
devices such as tablets , Mobile phones etc.
Some Basic Relationships Between Pixels

Definitions: f(x , y): digital image


Pixels: q, p
Subset of pixels of f(x , y): S

 Neighborhood

 Adjacency

 Connectivity

 Paths

 Regions and boundaries


Basic Relationships of Pixels
Neighbors of a Pixel

A pixel p at (x , y) has
2 horizontal and 2 vertical neighbors:

That’s are
Horizontal neighbors: (x+1,y), (x-1,y),
Vertical neighbors: (x,y+1), (x,y-1)

This set of pixels is called the 4-neighbors of p: N4(p)


4-neighbors of p

Neighborhood relation is used to tell adjacent pixels. It is useful


for analyzing regions.

4-neighborhood relation considers only vertical and horizontal


neighbors
Neighbors of a Pixel The 4 diagonal neighbors of p
are: (ND(p))

ND(p): (x+1,y+1), (x+1,y-1), (x-1,y+1), (x-1,y-1)


Neighbors of a Pixel The 4 diagonal neighbors of p
are: (ND(p))

Diagonal -neighborhood relation considers only diagonal


neighbor pixels.
ND(p): (x+1,y+1), (x+1,y-1), (x-1,y+1), (x-1,y-1)
Neighbors of a Pixel : 8 neighbors of p are:
(N8(p))
N4(p) = 4-neighbors of p: Neighbors of a Pixel

Total no of neighbors of one pixel,


=N4(p) + ND(p)
= N8(p): the 8-neighbors of p

 These points, together with the 4-neighbors, arecalled the 8


neighbors of p, denoted by N8(p).

 If some of the points in ND(p) and N8(p) fall outside the


image if (x, y) is on the border of the image
ADJACENCY

Types of Adjacency: Three types

1. 4- adjacency
2. 8-adjacency
3. M-adjacency
4- Adjacency

If P and Q are two pixel , Q is a adjacency of P if Q is the member of N4(p).

Example,

25 15 30
Q

80 150 72
P

51 70 17
8- Adjacency

If P and Q are two pixel , Q is a adjacency of P if Q is the member of N8(p).

Example,

25 15 30
Q

80 150 72
P

51 70 17
M- Adjacency

M-adjacency –Two pixel P and Q are called M adjacency v={0}


if (i) Q is in N4(p) or
(ii) Q is in ND(p) and the set N4(p) ∩ N4(q) has no pixel whose
values are from V.
Example, Let v={0}

0 1 1 1 1 0

0 Q0 0 0 0 0

0 1 P0 0 0 0

0 0 0 0 0 0

0 0 0 0 0 0
Connectivity

 In a binary (black and white) image, two neighboring pixels


are connected if their values are the same, i.e., both equal to 0 (black) or
255 (white).
 In a gray level image, two neighboring pixels are connected if their values
are close to each other, i.e., they both belong to the same subset of similar
gray levels: and , where is a subset of all gray levels in the image.
Types of Connectivity

 There are three types of connectivity on the basis of adjacency. They are:
 a) 4-connectivity: Two or more pixels are said to be 4-connected if they are
4-adjacent with each others.
 b) 8-connectivity: Two or more pixels are said to be 8-connected if they
are 8-adjacent with each others.
 c) m-connectivity: Two or more pixels are said to be m-connected if they
are m-adjacent with each others.
Region

 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.
 Region that are not adjacent are said to be disjoint.
 Example: the two regions (of Is) in figure, are adjacent only if 8-adjacany is
used.
Boundary

 BOUNDARY: The boundary (also called 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 set of


pixels in the first and last rows and columns in the image.
A Digital Path

 A digital path (or curve) from pixel p with coordinate (x,y) to pixel q with
coordinate (s,t) is a sequence of distinct pixels with coordinates (x0,y0),
(x1,y1), …, (xn, yn)
where (x0,y0) = (x,y) and
(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 closed.
A Digital Path
Distance Measures

 For pixel p,q and z with coordinate (x.y) ,(s,t) and (v,w) respectively D is a
distance function or metric if
D [p . q] ≥ O {D[p.q] = O iff p=q}
D [p.q] = D [p.q] and
D [p.q] ≥ O {D[p.q]+D(q,z) }
Distance Measures

The following are the different Distance measures:


 a. Euclidean Distance :
De (p, q) = [(x-s)^2 + (y-t)^2 ] ^1/2

Pixels having a distance less than or equal to some value r from (x,y) are the
points contained in a disk of radius ‘ r ‘centered at (x,y)
Distance Measures

b. City Block Distance:


D4 (p, q) = |x-s| + |y-t|

Pixels having a D4 distance from (x,y), less than or equal to some value r form
a Diamond centered at (x,y).
Example: The pixels with distance D4 ≤ 2 from (x,y) form the following
contours of constant distance.
The pixels with D4 = 1 are the 4-neighbors of (x,y)
Distance Measures

c. Chess Board Distance:


D8 (p, q) = max(|x-s|, |y-t|)

Pixels having a D8 distance from (x,y), less than or equal to some value r form
a square Centered at (x,y).
Example: D8 distance ≤ 2 from (x,y) form the following contours of constant
distance.
THANK YOU

You might also like