I'm trying to determine the moving direction of an object in x-axis only. Figure below shows part of my effort.
However, I got stuck. As you can see from the middle image, the green represent the dot moved to right (positive x), the black represent overlapped area and the purple represent the reference image relative to the moving image.
In bottom image, I got two directions for that one object. Left one is going through positive transition, and right negative transition. I mainly use the intensity differences to determine the direction., i.e. Moving image intensity - reference image intensity.
Is there other possible ways to determine the direction of a moving object (to and fro in x-direction only)? Or is there some ways of correction I can apply to?
Thanks in advance guys!