Motion direction



Hi,

I?m performing an academy project regarding Motion Direction
Detection. It is based on webcam and I just have done the common
capture, gray scale and binary difference image with:
diff_img = imabsdiff(seg_Imagem, prim_Imagem);
I = rgb2gray(diff_img);
img_bin = im2bw(I);
imshow(img_bin);

Now I need a useful help to implement a detection and indication of
the motion direction on displayed binary image. I thought split my
image in four matrix and do a sum of each one, and for each refresh I
check the sum value and create a direction algorithm to indicate the
motion direction. Also, I read about fourier based registration which
can be a good idea to do this.
Please, some one can help me?
Thanks indeed
Best regards
.