I think you should read a few books on the subject first. (seriously, this isnt a beginner level project
For example, how would your robot know the difference between that object and the background? How would you know if the object is really big but far away, or really small but close up?
And even if your robot correctly determines the size of the object, what would your robot do with that info?
As for languages, I would recommend either C, C++, or Java, for this . . .