There is a lot more information that we'd need in order to help you with that. A lot of it concerns the technique/module you are using to recognize the object and under what conditions that recognition is happening.
Typically if you are not using a direct depth measurement (IR, Lidar, Sonar, Stereo, etc) then the size of the recognized object is the best bet. The smaller the object is the further away it is. The exact formula is dependant on your camera and lens. You can determine a rough ratio of size versus distance by empirically testing your setup (i.e. use a measuring tape and put the object at standard increments away from the camera. measure size versus distance at each measurement and determine a line that best fits that curve/line).
STeven.
|
|