1 imaging techniques for flow and motion measurement lecture 2 lichuan gui university of mississippi...

24
1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Digital Image & Image Processing Processing

Upload: colleen-jackson

Post on 13-Jan-2016

232 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

1

Imaging Techniques for Flow and Motion Measurement

Lecture 2

Lichuan Gui

University of Mississippi

2011

Digital Image & Image ProcessingDigital Image & Image Processing

Page 2: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

2

Digital ImageDigital Image

Page 3: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

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

Page 4: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

4

• Sufficient pixels make image look continuous

Digital ImageDigital Image

Page 5: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

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

Page 6: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

6

Digital ImageDigital Image

Physical & logical pixels

Page 7: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

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)

Page 8: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

8

Digital ImageDigital Image

yxG , zyxG ,,

2D & 3D digital images

Page 9: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

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

Page 10: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

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

Page 11: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

11

Linear transformation

minminmaxminmaxmin ''',, GGGGGGyxGyxG

Pixel OperationPixel Operation

G '(x ,y )G (x ,y )

Page 12: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

12

g

g

GyxG

GyxGifyxG

,

,

0

1,

Binary operation

Pixel OperationPixel Operation

G (x ,y ) G '(x ,y )

Page 13: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

13

g

ggg

GyxG

GyxGif

GGGyxGyxG

,

,

5

5/,245, max

Threshold

Pixel OperationPixel Operation

G (x ,y ) G '(x ,y )

Page 14: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

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

Page 15: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

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

Page 16: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

16

Gradient filter

000

021

010

2

1C

Digital FilterDigital Filter

Page 17: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

17

Digital FilterDigital Filter

Laplace filter

010

141

010

4

1C

G (x ,y ) G '(x ,y )

Page 18: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

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 )

Page 19: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

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)

Page 20: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

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

Page 21: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

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

Page 22: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

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

Page 23: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

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

Page 24: 1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing

• 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”