Page 1 of 1

Detecing Object Moving Which side

PostPosted: Sat Dec 16, 2017 12:09 am
by emir
I have to detect whether object moving from "left to right" or from "right to left" or "up to down" I want to control servo motors 2 axis "x" and "y" axis .I have already detect object coordinate as you can see.

Code: Select all
int objectX = objectRect.X + (objectRect.Width / 2);
                    int objectY = objectRect.Y + (objectRect.Height / 2);

but that alwasy give to me currrent coordinate , Am i have to create 2.frame and compare first and second objectX ? if so how can I create 2. frame becasue first image must arrive late.

Actually I want to follow the object with servos , working on arduino and c# maybe i can not set up the algorithm.
Sorry for my english

Thank you