[Servos tracking project] Help with tracking algorithm

Hello to all.
I'm working on a tracking project with arduino.
The project consists of an Arduino DUE + OV7670 Camera. Currently I am able to follow the colors (knwing where they are I mean). And now I have my system with two servos set up. Now I would like a little help in the design of the controller. The system would have as input the coordinates of the object to be tracked (which we want to focus) and the output could be the action of the servos. How many degrees should be moved

Thank you very much in advance

aturcitu:
The system would have as input the coordinates of the object to be tracked (which we want to focus) and the input would be the action of the servos. How many degrees should be moved

Is the second 'input' supposed to be output?

The easiest way to solve this would depend whether the servos are moving the camera that is being used to steer them. If it is then all you need to do is moving each server in the direction which moves the tracking object towards the center of the field of view. For example, if the object is left of center then move the servo a bit to the right. You'll want to do some smoothing and damping, but conceptually the solution is very simple.

Is the second 'input' supposed to be output?

Yes sorry! fixed

The easiest way to solve this would depend whether the servos are moving the camera that is being used to steer them. If it is then all you need to do is moving each server in the direction which moves the tracking object towards the center of the field of view. For example, if the object is left of center then move the servo a bit to the right. You'll want to do some smoothing and damping, but conceptually the solution is very simple.

Thanks for the reply. Yes I already had this idea, but I would like to learn a little more how to do it in a proper way, in order to, as you said, do it smooth, accurate and as quickly as possible.

You will need to decide how you’re going to trade off development effort, speed and accuracy of the response. I suggest that to start with you just get something that works using a straight forward crude algorithm, and if the speed/smoothness/accuracy are not good enough then look for more complex control algorithms such as PID. But do the simple version first.