mikucy/CS131

iterative_lucas_kanade

Opened this issue · 0 comments

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