A way to solve this problem.
First, take one object of the real world and its measure, that is, height and width (example of a coke cane) Now take the snap of the object you want to measure. For iphone or ipad, the focal length is fixed to 25 mm. Now create the object that you want to measure, and resize the image of the stone pavement of the real world in accordance with the object you want to measure.
use the equation
object_distance = (focus * real_object_height) / object_height;
here, real_object_height = coke height; and object_height = coke height with resizing
and accordingly measure the height of the object using the equation
height_of_frame = ((obj_distance) * measured_object_height_in_mm / 1000.0)) / focal;
width_of_frame = ((obj_distance) * measured_object_width_in_mm / 1000.0)) / focal;
this way you can find out the distance of the object and its measure. but you need two static data, that is, the focal length of the camera you are using, and the measurement of one real-world object for comparison.
Thanks, bskania.
BSKANIA
source share