Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
Image Processing
Ch2: Digital image Fundamentals
Prepared by: Hanan Hardan
Hanan Hardan 1
Image Acquisition:
The image is captured by a sensor (eg. Camera), and digitized if the output of the camera or sensor is not already in digital form, using analogue-to-digital convertor
Hanan Hardan 2
Image sampling and quantization
In order to process the image, it must be saved on computer.
The image output of most sensors (eg: Camera) is continuous voltage waveform.
But computer deals with digital images not with continuous images, thus: continuous images should be converted into digital form.
Hanan Hardan 3
Image sampling and quantization To convert continuous image (in real life) to digital image (in computer) we use Two processes: 1.sampling 2.quantization. Remember that: the image is a function f(x,y), x and y: are coordinates F: intensity value (Amplitude) Sampling: digitizing the coordinate values Quantization: digitizing the amplitude values Thus, when x, y and f are all finite, discrete quantities, we call the image a digital image.
Hanan Hardan 4
How does the computer digitize the continuous image?
Ex:
scan a line such as AB from the continuous image, and represent
the gray intensities.
How does the computer digitize the continuous image?
Ex:
scan a line such as AB from the continuous image, and represent
the gray intensities.
Hanan Hardan 5
How does the computer digitize the continuous image?
Sampling: digitizing coordinates
Quantization: digitizing intensities
sample is a small white square, located by a vertical tick mark as a point x,y
Quantization: converting each sample gray-level value into discrete digital quantity.
Gray-level scale that divides gray-level into 8 discrete levels
Hanan Hardan 6
How does the computer digitize the continuous image? Now:
the digital scanned line AB representation on computer:
The continuous image VS the result of digital image after sampling and quantization
Hanan Hardan 7
Digital Image Representation
The result of sampling and quantization is a matrix of real numbers
Assume that an image f(x,y) is sampled so that the resulting image has M rows and N columns. We say that the image is of size M x N. The values of the coordinates (x,y) are discrete quantities. For clarity, we use integer values for these discrete coordinates.
Hanan Hardan 8
Digital Image Representation
Images as Matrices
Each element of this array is called an image element, picture element, pixel or pel.
A digital image can be represented naturally as a MATLAB matrix:
Hanan Hardan 9
Pixels!
Every pixel has # of bits (k) so, the gray intensities ( L ) that the pixel can hold, is calculated
according to a number of pixels it has (k).
L= 2k Q: Suppose a pixel has 1 bit, how many gray levels can it represent? Answer: 2 intensity levels only, black and white. Bit (0,1) 0:black , 1: white Q:Suppose a pixel has 2 bit, how many gray levels can it represent? Answer: 4 gray intensity levels 2Bit (00, 01, 10 ,11). Now .. if we want to represent 256 intensities of grayscale, how many bits
do we need? Answer: 8 bits which represents: 28=256
Hanan Hardan 10
Number of storage of bits:
N * M: the no. of pixels in all the image.
K: no. of bits in each pixel
L: grayscale levels the pixel can represent
L= 2K
all bits in image= N*N*k
Hanan Hardan 11
Number of storage of bits:
EX: Here: N=32, K=3, L = 23 =8
# of pixels=N*N = 1024 . (because in this example: M=N)
# of bits = N*N*K = 1024*3= 3072
N=M in this table, which means no. of horizontal pixels= no. of vertical pixels. And thus:
# of pixels in the image= N*N Hanan Hardan 12
Spatial and gray-level resolution
Hanan Hardan 13
Spatial and gray-level resolution
Resolution: How Much Is Enough?
This all depends on what is in the image and what you would like to do with it
Key questions include
Can you see what you need to see within the image?
Hanan Hardan 14
Resolution: How Much Is Enough? (cont…)
The picture on the right is fine for counting the number of cars, but not for reading the number plate
Hanan Hardan 15
Spatial resolution:
Sampling is the principal factor determining the spatial resolution of an image
Basically, spatial resolution is the smallest discernible detail in an image.
Spatial Resolution
( .هي وحدة قياس الصغر جزء في الصورة يمكن تمييزة بالعين )
, فهو فقط يحد ابعاد الصورة , عدد البكسالت في الصورة ال يحدد وضوحها
فكلما , هو المسؤول عن تحديد الوضوح Spatial resolutionاما
اكثر كان لها قدرة كانت البكسالت متقاربة وتحمل قيم لونيه صحيحة
.اعلى على توضيح معالم الصورة بشكل اوضحHanan Hardan 16
How to choose the spatial resolution
= Sampling locations
Ori
gin
al i
mag
e
Sam
ple
d i
mag
e
Under sampling, we lost some image details!
Spatial resolution
Hanan Hardan 17
How to choose the spatial resolution : O
rigin
al i
mag
e
Spatial resolution
(sampling rate)
Sampled image
No detail is lost!
1m
m
Hanan Hardan 18
Effect of Spatial Resolution Example:
256x256 pixels
64x64 pixels
128x128 pixels
32x32 pixels
insufficient spatial resolution appearance of checkerboard pattern in the image
Hanan Hardan 19
Example: Spatial resolution
الصورة في اليسار تحمل عدد بكسالت اكبر من الصورة في الجهه اليمين
لماذا؟ ومع ذالك الصورة في اليسار تبدوا غير واضحة,
Hanan Hardan 20
gray-level resolution
Quantization is the principal factor determining the gray level resolution of an image
Gray-level resolution refers to the smallest discernible change in gray level.
يمكن تمييزها ( كثافة اللون الرمادي)وهي تعني اصغر تغيير في الكثافة
ورؤيتها
Color depth/ levels is given by
kL 2Hanan Hardan 21
Effect of Quantization Levels Example:
256 levels 128 levels
32 levels 64 levels Hanan Hardan 22
Effect of Quantization Levels (cont.)
16 levels 8 levels
2 levels 4 levels
In this image,
it is easy to see
false contour.
Hanan Hardan 23
Digital Image Types:
Binary image (B&W)
Grayscale image
Color image (RGB)
Hanan Hardan 24
Common image formats include:
1 sample per point (B&W or Grayscale)
3 samples per point (Red, Green, and Blue)
For most of this course we will focus on grey-scale images
Hanan Hardan 25
Binary Images
are images that have been Binary images quantized to two values, usually denoted 0 and 1, but often with pixel values 0 and 255, representing black and white.
Hanan Hardan 26
Image Types : Binary Image
Binary image or black and white image
Each pixel contains one bit :
1 represent white
0 represents black
1111
1111
0000
0000
Binary data
Hanan Hardan 27
Grayscale Images
A grayscale (or graylevel) image is simply one in which the only colors are shades of gray (0 – 255)
Hanan Hardan 28
Digital Image Types : Intensity Image
Intensity (monochrome or gray scale) image
each pixel corresponds to light intensity
normally represented in gray scale (gray
level).
39871532
22132515
372669
28161010
Gray scale values
Hanan Hardan 29
Color Images
Color image: A color image contains pixels each of which holds three intensity values corresponding to the red, green, and blue or( RGB)
Hanan Hardan 30
39871532
22132515
372669
28161010
39656554
42475421
67965432
43567065
99876532
92438585
67969060
78567099
Digital Image Types : RGB Image
Color image or RGB image:
each pixel contains a vector
representing red, green and
blue components.
RGB components
Hanan Hardan 31