Image Processing Computer Vision State space gradient descent

  • Slides: 21
Download presentation
Image Processing & Computer Vision State space gradient descent & Gibbs sampler 1

Image Processing & Computer Vision State space gradient descent & Gibbs sampler 1

State space gradient descent E = xy[(Fxy – Ixy)2 + (Fx+1, y – Fxy)2

State space gradient descent E = xy[(Fxy – Ixy)2 + (Fx+1, y – Fxy)2 + (Fx, y+1 – Fxy)2] Algorithm Initial F 0(x, y) = Random 0…. 255 For each pixel x, y For each possible state S if F(x, y) = 0, E 0 = ………… Noise 50% if F(x, y) = 1, E 1 = …………. . . if F(x, y) = 255, E 255 = ………. . Select state with minimum E Let’s F(x, y) = S Repeat until no change in E Restore 4

State space gradient descent E = xy [(Fxy – Ixy)2 + (Fx+1, y –

State space gradient descent E = xy [(Fxy – Ixy)2 + (Fx+1, y – Fxy)2 + (Fx, y+1 – Fxy)2] Data Constraint Smoothness Constraint F(x, y) ��������� update ���������� Random ������� Random E ��� Energy ����������� 0 - 255 Ixy ��� Image Intensity ����� weight ������� (Neighbor) 5

Energy (Global Energy) ���������� 3 ��� (x+1, y) (x+1, y+1) (x, y+1 E =

Energy (Global Energy) ���������� 3 ��� (x+1, y) (x+1, y+1) (x, y+1 E = xy [(Fxy – Ixy)2 + (Fx+1, y – Fxy)2 + (Fx+1, y+1 – Fxy)2 + (Fx, y+1 – Fxy)2] 7

State space gradient descent ��������G �������������� Energy ��� local minimum ���� Global minimum ��������

State space gradient descent ��������G �������������� Energy ��� local minimum ���� Global minimum �������� 8

Gradient descent Algorithm 1. 2. 3. Initial F 0(x, y) = Random 0… 255

Gradient descent Algorithm 1. 2. 3. Initial F 0(x, y) = Random 0… 255 For each Pixel(x, y For each state S = 0… 255 if F(x, y) = 0, E 0 = ……. if F(x, y) = 1, E 1 = ……. ………. if F(x, y) = 255, E 255 = ……. Choose state with minimum E F(x, y) = S Repeat step 2 until E is stable (not decrease) 9

Example (state space gradient) 0 1 2 3 4 0 0 0 1 1

Example (state space gradient) 0 1 2 3 4 0 0 0 1 1 2 2 3 3 4 4 F(x, y) 1 2 3 4 I(x, y) E = xy [(Fxy – Ixy)2 + (Fx+1, y – Fxy)2 + (Fx, y+1 – Fxy)2] Data Constraint Smoothness Constraint 10

Gibbs Sampler 1. Start temperature T is high 2. Initial F 0(x, y) =

Gibbs Sampler 1. Start temperature T is high 2. Initial F 0(x, y) = Random 0… 255 3. For each Pixel(x, y) For each state S = 0… 255 if F(x, y) = 0; E 0 = …. . ; Prob 0=…. if F(x, y) = 1; E 1 = …. . ; Prob 1=…. …………. if F(x, y) = 255; E 255 = …. . ; Prob 255= For each Probi = Pi / sum(Pi) 4. Sample for state S from pdf Probi F(x, y) = S 5. Reduce T = T * 0. 9 6. Repeat step 3 -4 until E is stable 12

Gibbs Sampler ���� 3 state 0, 1, 2 P 0=exp(-2/T) P 1=exp(-3/T) P 2=exp(-4/T)

Gibbs Sampler ���� 3 state 0, 1, 2 P 0=exp(-2/T) P 1=exp(-3/T) P 2=exp(-4/T) 0. 1 17

Example (gibbs sampler) 0 1 2 3 4 0 0 0 1 1 2

Example (gibbs sampler) 0 1 2 3 4 0 0 0 1 1 2 2 3 3 4 4 F(x, y) 1 2 3 4 I(x, y) E = xy [(Fxy – Ixy)2 + (Fx+1, y – Fxy)2 + (Fx, y+1 – Fxy)2] Data Constraint Smoothness Constraint 18

Noise removal with missing data E = xy [(Fxy – Ixy)2 Axy+ (Fx+1, y

Noise removal with missing data E = xy [(Fxy – Ixy)2 Axy+ (Fx+1, y – Fxy)2 + (Fx, y+1 – Fxy)2] Axy ���� 0 ��� no data ���� 1 ��� has data 21