instructor: lichuan gui lichuan-gui@uiowa lcgui

29
Measurements in Fluid Mechanics 058:180:001 (ME:5180:0001) Time & Location: 2:30P - 3:20P MWF 218 MLH Office Hours: 4:00P – 5:00P MWF 223B-5 HL Instructor: Lichuan Gui [email protected] http://lcgui.net Students are encouraged to attend the class. You may not be able to understand by just reading the lecture notes.

Upload: jayme-bowen

Post on 01-Jan-2016

37 views

Category:

Documents


6 download

DESCRIPTION

Students are encouraged to attend the class. You may not be able to understand by just reading the lecture notes. Measurements in Fluid Mechanics 058:180:001 (ME:5180:0001) Time & Location: 2:30P - 3:20P MWF 218 MLH Office Hours: 4:00P – 5:00P MWF 223B-5 HL. Instructor: Lichuan Gui - PowerPoint PPT Presentation

TRANSCRIPT

Measurements in Fluid Mechanics058:180:001 (ME:5180:0001)

Time & Location: 2:30P - 3:20P MWF 218 MLH

Office Hours: 4:00P – 5:00P MWF 223B-5 HL

Instructor: Lichuan [email protected]

http://lcgui.net

Students are encouraged to attend the class. You may not be able to understand by just reading the lecture notes.

2

Lecture 35. Particle image identification & tracking

3

Particle Image Identification

Purposes

- To determined image specifics for particle tracking

- To analyze particle size and distribution in flows

- To separated phases according to image size

- To mask unexpected objects in the flow field

- To mask flow boundaries

- Others

4

Particle Image Identification

Original Norm alization Regional normalization Binarization

Step 1: Preprocess particle images

- Increase contrast of the PIV recording

- Increase brightness of dark images

- Binarize particle images

5

Particle Image Identification

Step 2: Identify particle images (method in EDPIV)

- Number every image pixel and give a large number to background pixels

- Reconstruct number field with minimum in 3×3 neighborhood of image pixels

- Iterate until no changes can be made

1 111

5 6 75 6 78 9 1 08 9

1 6 1 6 1 8 1 8 1 91 6 1 6 1 6 1 8 1 92 1 2 1 2 4 2 4 2 5

6

Particle Image Specifics

- Particle image position (xs,ys) determined at center of mass

- Particle size in pixels (F)

- Average brightness of all pixels belong to one image (H)

- Particle shape coefficient, e.g. roundness =F/(R2max)

x s

y s

R m ax

F H

7

Particle Image Specifics

- Insect image identification example

X [pixel]

Y[p

ixel

]

0 4 8 12 160

4

8

12

16

ri

(Xn ,Yn)

re

Equivalent circle

Ie= 0.5Snre2

= 0.5Sn2 /

In= ri2

=In / Ie

Roundness () & Orientation angle ()

n X Y F H 1 30.33 4.33 15 170.1 1.86 -1.27

2 84.29 28.11 17 171.1 2.25 -0.37

3 176.43 45.68 16 166.7 2.39 -1.25

4 103.00 46.50 16 167.7 2.55 -0.62

5 149.56 56.81 16 172.9 2.95 1.23

6 133.53 55.66 15 163.9 2.60 0.05

7 167.62 83.31 39 169.4 2.69 -0.47

8 241.65 85.94 17 172.4 2.15 0.15

9 85.21 110.00 14 190.6 2.26 -1.20

10 89.50 114.00 20 176.4 2.00 1.41

11 155.50 122.25 16 171.5 2.63 1.55

8

Create Phase Mask

1. Original 2. Binary 3. Big particles

4. Expanded 5. Inverted

9

Painting Tools

Paste – help for generating masksOriginal Mask Effect

Mask EffectPasted

10

Painting Tools

Line - help for identifying big particles

Original Line cut

Effect Effect

11

Painting Tools

Fill – Used to create a boundary mask

Fill flow field with 250Original Fill boundary with 0

12

Tracking of Big Particle images

Tow-frame tracking of big particles

- Information from particle image identificationRecording pair: 1st frame 2nd frame

Particle image number: l1=1,2,···, L1 l2=1,2,···, L2

Size in pixels of particle images F1(l1) F2(l2)

Average brightness H1(l1) H2(l2)

Shape coefficient 1(l1) 2(l2)

Position of particle image x1 (l1),y1 (l1) x2 (l2),y2 (l2)

2

11

2211

2

11

2211

2

11

221121,

l

ll

lH

lHlH

lF

lFlFll HFg

- Tracking function

- Weighting coefficients: F +H +=1

13

Tracking of Big Particle images

Tow-frame tracking of big particles

- Pairing criterion: 21*21

1*2

,3,2,1,,min,when

asparticlesamethetorelatedisimageParticle

Lkklll

ll

gg

11

*22

11*22

lylyS

lxlxS

y

x

- Particle image displacement:

- Deformation limits:

11

*2211

11

*2211

11

*2211 ,,

l

ll

lH

lHlH

lF

lFlFHF

14

Tracking of Big Particle images

Example

Tracking results1st frame 2nd frame

15

Tracking of Insect Motion

Example: Tracking fire ant in successive image frames

x [mm]y

[mm

]

-60 -50 -40 -30 -20 -10 0 10 20 30 40-20

-10

0

10

20

30

40

50

(a)

Time [s]

Spe

ed[m

m/s

]

0 2 4 6 8 10 12 14 16 18 200

10

20

30

40

(b)

Fire ant trace

Fire ant speed time history

16

Position of LID particle images

Maxima search

B

B

C

C

ErosionB

C

Combine

One pixel for one particle

17

Evaluation of LID recordings

LID recordings Evaluation with large window

Evaluation at identified particles

LID recordings with small interrogation window

Individual particle image pattern tracking

18

Tracking of small particle images

- Nearest displacement criterion (distance between particles >> displacement)

- Pairing with help of neighbor particle images (e.g. Okamoto et al. 1995)

- Multi-frame tracking (e.g. Hassan & Canaan 1991 )

- Displacement determined according to particle image center positions

Simulated PIV recording pair of uniform flow

Particle image diameter: 24 pixels

Particle image displacement: Sx=2.3, Sy=1.5 pixels

Particle tracking results

RMS error=0.25 pixels

Pattern tracking results

4x4-pixel pattern

RMS error=0.06 pixels

- Individual particle image pattern tracking recommended for LID PIV

19

• Gui L, Merzkirch W, Shu JZ (1997) Evaluation of low image density PIV recordings with the MQD method and application to the flow in a liquid bridge. Journal of Flow Visualization and Image Processing, vol. 4: 333-343 

• Gui L and Seiner JM (2009) Application of an Image Tracking Algorithm in Fire Ant Motion Experiment. Algorithms 2, no. 2:735-749

References

Fast computation of unsharp mask

A

sm jyixGA

yxG ,1

,

𝑛𝑦−

2𝑟

𝑛𝑥− 2𝑟

A

- Compute Gsm(x,y) close to the edges of the image

for x r+1 or x> nx -r or y< r+1 or y>ny-r

20

CyxGyxGCjyixGrr

yxGyxG sm

r

ri

r

rj

,,,1212

1,,

r

rjsmsm jyrxGjyrxG

rryxGyxG ,1,

1212

1,1,

Fast computation of unsharp mask

21

𝑛𝑦−

2𝑟

𝑛𝑥− 2𝑟

𝑦

𝑥−1𝑥

- Compute Gsm(x,y) away from the edges of the image

CyxGyxGCjyixGrr

yxGyxG sm

r

ri

r

rj

,,,1212

1,,

Fast computation of unsharp maskfunction [F]=unsharpmask(G,fr) % G - gray value distribution of the image [nx ny]=size(G); % fr - radius of the filterG=double(G);

for y=1:ny for x=1:nx nr=0; % used to count pixels in effective area A Gm(x,y)=0; for i=-fr:fr for j=-fr:fr if x+i>0 & x+i<=nx & y+j>0 & y+j<=ny % limit calculation in the image Gm(x,y)=Gm(x,y)+double(G(x+i,y+j)); nr=nr+1; end end end Gm(x,y)=Gm(x,y)/nr; % average gray value endendF=double(G)-double(Gm); % remove unsharp mask

nx

ny

A

x

y

23

Fast computation of unsharp mask

𝑛𝑦

r+1

function [F]=unsharpmask2(G,fr) % G - gray value distribution of the image [nx ny]=size(G); % fr - radius of the filterG=double(G);

for y=1:ny for x=1:fr+1 nr=0; Gsm(x,y)=0; for i=-fr:fr for j=-fr:fr if x+i>0 & x+i<=nx & y+j>0 & y+j<=ny Gsm(x,y)=Gsm(x,y)+G(x+i,y+j); nr=nr+1; end end end Gsm(x,y)=Gsm(x,y)/nr; end end

function [F]=unsharpmask2(G,fr) % G - gray value distribution of the image [nx ny]=size(G); % fr - radius of the filterG=double(G);

for y=1:ny for x=1:fr+1 nr=0; Gsm(x,y)=0; for i=-fr:fr for j=-fr:fr if x+i>0 & x+i<=nx & y+j>0 & y+j<=ny Gsm(x,y)=Gsm(x,y)+G(x+i,y+j); nr=nr+1; end end end Gsm(x,y)=Gsm(x,y)/nr; end Endfor y=1:ny for x=nx-fr:nx nr=0; Gm(x,y)=0; for i=-fr:fr for j=-fr:fr if x+i>0 & x+i<=nx & y+j>0 & y+j<=ny Gm(x,y)=Gm(x,y)+G(x+i,y+j); nr=nr+1; end end end Gm(x,y)=Gm(x,y)/nr; end end

Fast computation of unsharp mask

𝑛𝑦

r+1 nx-r

Fast computation of unsharp mask

r+2

for y=1:fr for x=fr+2:nx-fr-1 nr=0; Gm(x,y)=0; for i=-fr:fr for j=-fr:fr if x+i>0 & x+i<=nx & y+j>0 & y+j<=ny Gm(x,y)=Gm(x,y)+G(x+i,y+j); nr=nr+1; end end end Gm(x,y)=Gm(x,y)/nr; end end

nx-r-1

r

for y=1:fr for x=fr+2:nx-fr-1 nr=0; Gm(x,y)=0; for i=-fr:fr for j=-fr:fr if x+i>0 & x+i<=nx & y+j>0 & y+j<=ny Gm(x,y)=Gm(x,y)+G(x+i,y+j); nr=nr+1; end end end Gm(x,y)=Gm(x,y)/nr; end end

for y=ny-fr:ny for x=fr+2:nx-fr-1 nr=0; Gm(x,y)=0; for i=-fr:fr for j=-fr:fr if x+i>0 & x+i<=nx & y+j>0 & y+j<=ny Gm(x,y)=Gm(x,y)+G(x+i,y+j); nr=nr+1; end end end Gm(x,y)=Gm(x,y)/nr; end end

Fast computation of unsharp mask

r+2 nx-r-1

r

nr=(2*fr+1)*(2*fr+1);for y=fr+1:ny-fr-1 for x=fr+2:nx-fr-1 D=0; x1=x-fr-1; x2=x+fr; for j=-fr:fr D=D-G(x1,y+j)+G(x2,y+j); end Gm(x,y)=Gm(x-1,y)+D/nr; endEnd

F=G-Gm; % function output

Fast computation of unsharp mask

r+2 nx-r-1

ny-r-1

r+1

Fast computation of unsharp maskTest program clear;A=imread('D001_1.bmp'); % input image file G=img2xy(A); % convert image to gray value distributionfr=5;F=unsharpmask2(G,fr);

D=xy2img(F);imshow(D);