suppose the object is red...run a mean filter...then a red filter...hen a threshold....
after that u shl get the objct filtered out...then what do u do is that u use the centre of gravity module.,...
if the centreof gravity is on left...then go left...if the centre o gravity is on right ...then go right...simple...