i was thinking that once i detect an object,i will have to move the robot towards it,is there an algorithm that can calculate the angle of the motors and how much it should move to reach near the object given an image.
how do you mean? which motor? which angle?
If you refer to robot drive motors: those might be step motors with defined angles ... - but anyways, not to answer in general. You'd have to check for your robot.
Typically you'd have to recalibrate in between.
You may add inertial sensors to detect some movements. But if it comes to precision it quickly comes to IP I guess
Retrieving data ...