mikucy / CS131

My own solutions for CS131_fall1718 homework release
81 stars 33 forks source link

iterative_lucas_kanade #5

Open duongkstn opened 5 years ago

duongkstn commented 5 years ago

in hw8, at iterative_lucas_kanade function you write: Ik = img1[y1, x1] - img2[y2, x2] bk = np.array([np.sum(IkA1), np.sum(IkA2)]) But in equations, Ik is an array which has different values at (x,y) with x = px-w-->px+w, y=py-w-->py+w, not just a number (your code) In my opinion, it would be Ik = img1[y1-w:y1+w+1,x1-w:x1+w+1] - img2[y2-w:y2+w+1,x2-w:x2+w+1] with y2 = int(round(y+gy+vy)); x2 = int(round(x+gx+vx)) as mentioned in the code image