Upload
colleen-jackson
View
232
Download
0
Tags:
Embed Size (px)
Citation preview
1
Imaging Techniques for Flow and Motion Measurement
Lecture 2
Lichuan Gui
University of Mississippi
2011
Digital Image & Image ProcessingDigital Image & Image Processing
2
Digital ImageDigital Image
3
• Images constitute a continuous spatial distribution of the irradiance at a plane.
• Computers cannot handle continuous images but only arrays of digital numbers.
• Digital images consist of pixels. Each pixel represents a square region of the image on a square grid.
• Pixel value (gray value) representsintensity of the irradiance
– 1-bit: 0 1– 8-bit: 0 255– 10-bit: 0 1,023– 12-bit: 0 4,095– 24-bit: 0 16,777,215
• Bitmap data in file.
Digital ImageDigital Image
4
• Sufficient pixels make image look continuous
Digital ImageDigital Image
5
Color models- True color model: (Red,Green,Blue)=(0255, 0255, 0255)- Others: Palettes/look-up table (LUT)/color map/index map/etc.
Digital ImageDigital Image
6
Digital ImageDigital Image
Physical & logical pixels
7
Digital PIV Image SampleDigital PIV Image Sample
PIV image example ( 5050 pixels) Left: displayed on a PC screen Right: presented as a 2D-function G(x,y)
0
10
20
30
40
50
x [pixels]
0
10
20
30
40
50
y [pixel]
40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250
G(x,y)
8
Digital ImageDigital Image
yxG , zyxG ,,
2D & 3D digital images
9
Digital ImageDigital Image
Histogram (PDF) of digital image
Gray value
Num
ber
ofpi
xels
0 50 100 150 200 2500
20000
40000
60000
80000
100000
120000
PDF – Probability density function
10
Pixel operation Changing gray value of single pixel without considering the
neighborhood
Filter operation Changing gray value of single pixel considering the
neighborhood of (2r+1)(2r+1) pixels
Many others
yxGyxPyxG ,,,,
r
ri
r
rj
jyixGjiyxCyxG ,,,,,
Digital Image ProcessingDigital Image Processing
11
Linear transformation
minminmaxminmaxmin ''',, GGGGGGyxGyxG
Pixel OperationPixel Operation
G '(x ,y )G (x ,y )
12
g
g
GyxG
GyxGifyxG
,
,
0
1,
Binary operation
Pixel OperationPixel Operation
G (x ,y ) G '(x ,y )
13
g
ggg
GyxG
GyxGif
GGGyxGyxG
,
,
5
5/,245, max
Threshold
Pixel OperationPixel Operation
G (x ,y ) G '(x ,y )
14
Pixel OperationPixel Operation
Invert
Square
Root
5,245, 2min
2max
2min
2 GGGyxGyxG
5,245, 5.0min
5.0max
5.0min
5.0 GGGyxGyxG
yxGyxG ,255,
O rig ina l In ve rt S qu are R o o t
15
Smooth filter
111
111
111
)12)(12(
1C
rr
016
3248
64016
3248
64
50100150200250
50100150200250
016
3248
64016
3248
64
50100150200250
50100150200250
G(x,y) G'(x,y)
r =2
Digital FilterDigital Filter
16
Gradient filter
000
021
010
2
1C
Digital FilterDigital Filter
17
Digital FilterDigital Filter
Laplace filter
010
141
010
4
1C
G (x ,y ) G '(x ,y )
18
Digital FilterDigital Filter
Regional normalization
5,,,,
245, min
minmax
yxGyxGyxGyxG
yxG ooo
rjrrirjyixGyxGo ,,,max,max
rjrrirjyixGyxGo ,,,min,min
G (x ,y ) G '(x ,y )
19
Digital FilterDigital Filter
(Removing) unsharp mask
G x y G x y
r rG x i y j C
j r
r
i r
r
, , ,1
2 1 2 1
G’(x,y)G(x,y)
20
Digital FilterDigital Filter
Median
Expansion
Erosion 1,0,1;1,0,1,,min, jijyixGyxG
1,0,1;1,0,1,,max, jijyixGyxG
1,0,1;1,0,1,,median, jijyixGyxG
O rig ina l M ed ian E xpansion E rosion
21
Digital image filesDigital image files
Device independent image files- Microsoft Windows Bitmap “*.bmp”- Tag Image File Format “*.tif”- Graphics Interchange Format “*.gif”- JPEG File Interchange Format “*.jpg”- Many others
Device dependent image files - Raw image formats (e.g. *.raww)
- TSI image file Format “*.img”- DANTEC image file format “*.img”- LAVISION image file format “*.img” - Others
22
Digital image filesDigital image files
• Basic components of a digital image – Header, Palette, Bitmap Data, Footer etc.
• Information in a bitmap header – File Identifier– File Version– Number of Lines per Image– Number of Pixels per Line– Number of Bits per Pixel– Number of Color Planes– Compression Type– X & Y Origin of Image– Text Description– Others– Unused Space
23
Digital image filesDigital image files
• Microsoft Windows Bitmap– 14-byte file header (Version 2.x +)
Byte 12 File type, always 4D42h (“BM”);Byte 36 Size of the file in bytes;Byte 78 Reserved 1, always 0; Byte 910 Reserved 2, always 0; Byte 1114 Starting position of image data in bytes.
– Bitmap headerByte 14 Size of this header in bits; Byte 58 Image width in pixels; (2 bytes for version 2.x) Byte 912 Image height in pixels; (2 bytes for version 2.x) Byte 1314 Number of color planes;Byte 1516 Number of bits per pixel; (end of version 2.x) Byte 1720 Compression methods used; Byte 2124 Size of bitmap in Bytes; Byte 2528 Horizontal resolution in pixels per meter; Byte 2932 Vertical resolution in pixels per meter; Byte 3336 Number of colors in the image; Byte 3740 Minimum number of important colors. (end of version 3.x)Up to 108 bytes for Version 4.x
• Microsoft Windows Bitmap– Color Palette
One-, 4-, and 8-bit BMP files always contain a color palette24-bit BMP files never contain color palettes
– A 124×124-pixel uncompressed 8-bit gray-scale BMP file
File header: 14 bytesBitmap header: 40 bytes Color palette: 1024 bytesBitmap data: 15376 bytesTotal size: 16454 bytes
24
Digital image filesDigital image files
Homework: write a program to read gray values at the center
and 4 corners of image “image01.bmp”