MTAT.03.260 Pattern Recognition and Image Analysis 1
1. Fundamentals of digital imaging and human perception
Silver Leinberg
MTAT.03.260 Pattern Recognition and Image Analysis 2
What Is Digital Image Processing?
● Image may be defined as 2D function f(x,y)– x, y – spatial coordinates
– f – grey level
● Image is called digital image, when f, x, y are finite and discrete quantities.
● Pixels● Low-, mid- and high level processing
MTAT.03.260 Pattern Recognition and Image Analysis 3
Contents
● Origins● Various digital image processing fields● Human perception● Basics in digital image processing● Programming environment
MTAT.03.260 Pattern Recognition and Image Analysis 4
The Origins
● Digital images– Submarine cable between London and New York
– 1920 Bartlane system with 5 levels of grey
– 1929 15 levels of grey
– 1964 pictures of moon taken by US spacecraft
MTAT.03.260 Pattern Recognition and Image Analysis 5
The Origins
● Digital computers– 1940 key concepts by John von Neumann
– 1948 transistor
– 1958 integrated circuit
– 1960s operating systems, high level programming languages (COBOL, FORTRAN)
– 1970s microprocessor
– 1981 personal computer
MTAT.03.260 Pattern Recognition and Image Analysis 6
Contents
● Origins● Various digital image processing fields● Human perception● Basics in digital image processing● Programming environment
MTAT.03.260 Pattern Recognition and Image Analysis 7
Applications by EM spectrum
● Gamma-ray Imaging● X-ray Imaging● Imaging in the Ultraviolet Band● Imaging in the Visible and Infra-red Band● Imaging in the Microwave Band● Imaging in the Radio Band● Other Imaging Modalities
MTAT.03.260 Pattern Recognition and Image Analysis 9
Gamma-ray Imaging
● Nuclear medicine– A small dose of radioactive isotope is injected to
patient and images are produces by gamma ray detectors, positron emission tomography (PET)
● Astronomical observation● Inspection of nuclear objects
MTAT.03.260 Pattern Recognition and Image Analysis 10
X-ray imaging
● Medical diagnostics– 2D: X-ray photography, contrast enhancement
radiography (angiography)
– 3D: Computerized axial tomography (CAT)
● Industry– Circuit board inspection
● Astronomy
MTAT.03.260 Pattern Recognition and Image Analysis 11
Imaging in the UV Band
● Fluorescence microscopy– Invisible ultraviolet light makes fluorescent
material to shine in visible region
● Astronomy
MTAT.03.260 Pattern Recognition and Image Analysis 12
Visible and Infra-red Band
● Microscopy● Remote sensing● Weather observation● Automated inspection of products● Law enforcement (fingerprints, reading serial
numbers from paper currency, vehicle licence plate etc.)
MTAT.03.260 Pattern Recognition and Image Analysis 13
Imaging in the Microwave Band
● Radar– Radiates microwave pulses to illuminate an area
of interest and registers microwaves that was reflected back to radar antenna.
MTAT.03.260 Pattern Recognition and Image Analysis 14
Imaging in the Radio Band
● Medicine– Magnetic resonance imaging (MRI)
● Astronomy
MTAT.03.260 Pattern Recognition and Image Analysis 15
Other Imaging Modalities
● Acoustic imaging– Geological exploration (minerals, oil)
– Industry
– Medicine (imaging of unborn baby with ultrasound)
● Electron microscopy (SEM, TEM)● Computer generated imaging (fractals, flight
simulators)
MTAT.03.260 Pattern Recognition and Image Analysis 16
Contents
● Origins● Various digital image processing fields● Human perception● Basics in digital image processing● Programming environment
MTAT.03.260 Pattern Recognition and Image Analysis 18
Cones and Rods
● Cones:– 6..7 million
– Located in centre of retina (fovea)
– Highly sensitive to colour
– Bright-light (photopic) vision
● Rods:– 75..150 million
– Distributed over the retina
– Not involved in colour vision
– Dim-light (scotopic) vision
MTAT.03.260 Pattern Recognition and Image Analysis 25
Contents
● Origins● Various digital image processing fields● Human perception● Basics in digital image processing● Programming environment
MTAT.03.260 Pattern Recognition and Image Analysis 26
Light
● Wavelength (λ), frequency (ν), energy (E)– λ = c / ν (400 nm .. 750 nm)– E = h * ν (3.1 eV .. 1.65 eV)
● Intensity: radiance, luminance, brightness● Spectral distribution● Polarisation
MTAT.03.260 Pattern Recognition and Image Analysis 28
Image Sensing and Acquisition
● Sensor arrangement– Single imaging sensor (SEM)
– Line sensor (scanner, CAT, PET, MRI)
– Array sensor (CCD, CMOS)
MTAT.03.260 Pattern Recognition and Image Analysis 30
Image Formation Model
● f(x,y) = i(x,y) * r(x,y)– i(x,y) – illumination (90000 .. 0.1 lm/m2)
– r(x,y) – reflectance or transmittance (0 .. 1)
● Gray level l = f(x,y) Lmin ≤ l ≤ Lmax
● Gray scale [Lmin, Lmax]– [0, L-1], L = 2^k– dynamic range
MTAT.03.260 Pattern Recognition and Image Analysis 31
Image Sampling and Quantization
● Digitalizing – by coordinate values – sampling (M x N)
– by amplitude values – quantization (L = 2^k)
MTAT.03.260 Pattern Recognition and Image Analysis 35
Zooming and Shrinking
● Zooming– nearest neighbour interpolation
● pixel replication● bilinear interpolation
● Shrinking– aliasing effect
● blurring
MTAT.03.260 Pattern Recognition and Image Analysis 36
Relationships Between Pixels
● Neighbours of a pixel– N4(p), horizontal and vertical neighbours
– ND(p), diagonal neighbours
– N8(p) = N4(p) + ND(p)
MTAT.03.260 Pattern Recognition and Image Analysis 37
Relationships Between Pixels
● Adjacency– 4-adjacency: same value & in N4
– 8-adjacency: same value & in N8
– m(ixed)-adjacency: same value &● In N4 or● In ND, without common 4-adjacent neighbour
● Closed path, connected set, region, boundary
MTAT.03.260 Pattern Recognition and Image Analysis 38
Relationships Between Pixels
● Distance
– Euclidean distance: De(p,q)=[(x-s)²+(y-t)²]^½– D4 distance: D4(p,q) = |x - s| + |y – t|– D8 distance: D8(p,q) = max(|x – s|, |y – t|)– Dm distance
MTAT.03.260 Pattern Recognition and Image Analysis 39
Linear and Non-linear Operations
● An operator H is said to be linear if
H(af + bg) = aH(f) + bH(g)
where a, b are scalars and f, g are images– Sum operator is linear
– Absolute value of difference of two images in not
MTAT.03.260 Pattern Recognition and Image Analysis 40
Contents
● Origins● Various digital image processing fields● Human perception● Basics in digital image processing● Programming environment
MTAT.03.260 Pattern Recognition and Image Analysis 41
Scilab: Basic Matrix Operations
– -->zeros(4,5), ones(2, 3)
– -->rand(2, 3)
– -->A = [11 12; 21 22]
– -->A(1, 2)
– -->A(1, 2:-1:1)
– -->A(1, 1:2)
– -->A(1, :)
– -->A(:)
– -->A(:,2) = 0
– -->size(A, 2)
– -->linspace(3, 1, 5)
– -->sum(A)
– -->plot(A(1,:))
– ==, ~=, >, >=, <, <=, &, |, ~
– -, +, *, .*, /, ./, \, .\, ^, .^, ', .'
– Transpose -->A.'
MTAT.03.260 Pattern Recognition and Image Analysis 42
Scilab: Basic Image Operations
– -->atomsInatall SIVP
– -->f = imread('image1.bmp');
– -->imshow(f)
– -->imwrite(f, 'image2.bmp')
– -->g = im2double(f);
– -->g = mat2gray(A)
– -->th = 0.3, g = im2bw(f, th)● th - treshold
MTAT.03.260 Pattern Recognition and Image Analysis 43
Scilab: Basic Image Operations
● imadd(im1, im2)● imsubtract(im1, im2)● immultiply(im1, im2)● imdivide(im1, im2)● imabsdiff(im1, im2)● imcomplement(im)● Imlincomb(...)