Lecture 3 and 4
Lecture 3 and 4
Scanners
Image Acquisition Cameras
Hard Drives
Image Storage Solid State Drives (SSD)
Image Enhancement
Image Restoration
Image Processing Image Segmentation
Image Analysis
Refer: https://www.lumitex.com/blog/visible-light-spectrum
3
Image Sampling and Quantization
4
Image Sampling and Quantization
Z
Sampling : Discretizing the time axis or coordinate.
A B
5
Representation of Digital images
0 0 0 0 0 0 0 0 0 0
0 1 1 1 0 0 255 255 255 0
0 0 0 1 0 0 0 0 255 0
0 1 1 1 0 0 255 255 255 0
R,G,B
0 0 0 1 0 0 0 0 255 0
0 1 1 1 0 0 255 255 255 0
0 0 0 0 0 0 0 0 0 0
6
Representation of digital image
It’s a two dimensional function f(x , y) where x, y are the spatial coordinate and the amplitude at that particular
coordinate will be the intensity or grey level.
7
Basic Terminologies
0 0 0 0 0 720 1080
0 255 255 255 0
0 0 0 255 0
F(4,4)
0 255 255 255 0 HD 1920
FULL HD
1320
1320 x 720 1920 x 1080
0 0 0 255 0
0 255 255 255 0
0 0 0 0 0 2100
3800
ULTRA 4k
3800 x 2100
8
Basic Terminologies
Spatial Domain
Lets say size of the image is M x N and its a 8-bit image. Total bits required = M x N x k.
No. of intensity levels = 2^k. if 8 bit image then 2^8 = 256 intensity levels or Grey levels (0 to 255).
9
Basic Terminologies
Dynamic Range, Contrast and Contrast Ratio
Dynamic Range: Dynamic range of any image processing system is the ratio of maximum measurable intensity
to minimum detectable intensity.
Dynamic range in terms of images or image contrast or contrast ratio: Difference between highest and lowest
intensity levels in an image.
Resolution means how many Dots per inch (DPI) or Pixel per inch (PPI). It directly refer to the clarity of the
image. If resolution is high, it means more information or details can be identified in better way.
10
Basic Terminologies
Spatial Resolution
Spatial Resolution: Capability of sensor to distinguish between two closely spaced objects.
Higher Spatial Resolution: Pixel size is small and one can see more details.
Lower Spatial Resolution: Pixel size is big and one can not distinguish between two closely spaced objects.
11
Basic Terminologies
Intensity Resolution
12
Basic Relationship Between Pixels
(x-1,y)
(x,y-1) p(x,y) (x,y+1) 8 Neighbors of P N8(p) = N4(P) + ND(P)
(x+1,y)
(x-1,y-1) (x-1,y) (x-1,y+1)
(x,y-1) p(x,y) (x+1,y+1)
Four Diagonal Neighbors of P,ND(P)
(x+1,y-1) (x+1,y) (x+1,y+1)
(x-1,y-1) (x-1,y+1)
p(x,y)
(x+1,y-1) (x+1,y+1)
13
Distance Measures
1.Euclidean Distance:
[(x-s)^2 + (y-t)^2]1/2
14
Basic Relationship Between Pixels
2 2 2 2 2 2
2 1 2 2 1 1 1 2
2 1 0 1 2 2 1 0 1 2
2 1 2 2 1 1 1 2
2 2 2 2 2 2
15
Image Enhancement in the Spatial Domain
Spatial Domain
17
Intensity Transformation
18
Intensity Transformation: Image
Negative
Motivation : These kind of transformation is used to enhance grey level information embedded in the dark region of
an image or it is required when black area is dominant in size as compared to white region.
S=L–1–r
where L = Maximum Intensity Level
r = Input Intensity Level
S = Output Intensity Level
Consider 8-bit (0 - 255). Where L = 255.
10
20
30
40
19
Intensity Transformation: Log Transformations
Motivation : These transformation used to expand the dark pixel in an image while compressing the higher-level
values.
S = clog(1+r), where L = Maximum Intensity Level
r = Input Intensity Level
S = Output Intensity Level, C = constant. C = L-1/log(1+rmax)
r S = C log(1+r)
Consider 8-bit image. Where L = 255 and rmax = 255
0
Calculate S value ?
1
5
200
220
240
20
Intensity Transformation: Power Law Transformations (Gamma Correction)
Motivation : Visual quality of image may be hampered by illumination condition or wrong setting of camera sensor.
To rectify the same, one can utilized power law transformation or Gamma Corrections.
Basic idea is to raise the pixel value with certain power to improve the overall brightness and contrast of
the image.
S = c r^y,
where
3 x 3 Input Image
10 200 150
20 100 90 S = c r^y
70 50 220
C = 255
r = image(x,y)/ 255
22
Piecewise Linear Transformation Function: Contrast Stretching
Motivation : Low Contrast image can result from poor illumination, lack of dynamic range in the imaging sensor
or even thought the wrong setting of a lens aperture during image acquisition.
Contrast stretching expands the intensity range to utilize the full dynamic range of the sensor.
23
Piecewise Linear Transformation Function: Contrast Stretching
S = (r – Imin) x ((Omax-Omin)/(Imax - Imin)) + Omin S = Output Intensity Level
r = Input Intensity Level
Omax = Maximum Output
Omin = Minimum Output
Before Transformation Imax = Maximum input
Imin = Minimum input
10 5 150
20 100 90
Apply Contrast Stretching for r =10
70 50 30
Omax = 255, Omin = 0
After Transformation Imax = 150, Imin = 5
24
Piecewise Linear Transformation Function: Thresholding
output Intensity s
If r1 = r2
S1 = 0 and S2 = L-1
Input Intensity r
25
26