OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Mon, 18 May 2015 01:56:21 -0500calculate distance between two objects in a image using single camerahttp://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/i am calculating distance between two balls in a image.
first i have detected balls using hough transform circle and get their center point coordinates and applied distance measuring formula to get distance, but not getting nearby to the solution.
say if two balls are 13 cm apart then i am getting 5.6 cm...Thu, 19 Feb 2015 01:48:38 -0600http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/Comment by David_86 for <p>i am calculating distance between two balls in a image.
first i have detected balls using hough transform circle and get their center point coordinates and applied distance measuring formula to get distance, but not getting nearby to the solution.
say if two balls are 13 cm apart then i am getting 5.6 cm...</p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55654#post-id-55654@FooBar: he's not trying to get the distance between the camera and the balls, but the relative distance between the 2 balls. Since the balls define a single plane this can be done without calibration: just need to place the camera perpendicular to the plane defined by the balls pose and count pixel in image using a known object size (could be one of the balls as well)Thu, 19 Feb 2015 04:30:25 -0600http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55654#post-id-55654Comment by thdrksdfthmn for <p>i am calculating distance between two balls in a image.
first i have detected balls using hough transform circle and get their center point coordinates and applied distance measuring formula to get distance, but not getting nearby to the solution.
say if two balls are 13 cm apart then i am getting 5.6 cm...</p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55624#post-id-55624can you post some equations (or thoughts) about the algorithm that is computing the distance? Maybe you forgot a division by 2, so 5.6*2=11.2 which may include an error of measurement for 13?Thu, 19 Feb 2015 02:16:47 -0600http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55624#post-id-55624Comment by David_86 for <p>i am calculating distance between two balls in a image.
first i have detected balls using hough transform circle and get their center point coordinates and applied distance measuring formula to get distance, but not getting nearby to the solution.
say if two balls are 13 cm apart then i am getting 5.6 cm...</p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55694#post-id-55694@FooBar i don't think he's going for sub-mm precision in this :) plus it seems like he's working with not so large FoV, so the loss of precision between pixel in the center of the image and those in the borders is negligible for this purposeThu, 19 Feb 2015 09:35:51 -0600http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55694#post-id-55694Comment by thdrksdfthmn for <p>i am calculating distance between two balls in a image.
first i have detected balls using hough transform circle and get their center point coordinates and applied distance measuring formula to get distance, but not getting nearby to the solution.
say if two balls are 13 cm apart then i am getting 5.6 cm...</p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55662#post-id-55662@FooBar: I think it is possible to get the distance between his balls if the balls moves only in the plane parallel to the camera plane (the same one always) and/or if you know the balls sizes, so you are able to get the size of the pixel. More if you know that on ball A the pixel has X cm and on ball B the pixel has Y cm, then you are also able to detect the distance based on Pythagoras Theorem.Thu, 19 Feb 2015 05:13:30 -0600http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55662#post-id-55662Comment by FooBar for <p>i am calculating distance between two balls in a image.
first i have detected balls using hough transform circle and get their center point coordinates and applied distance measuring formula to get distance, but not getting nearby to the solution.
say if two balls are 13 cm apart then i am getting 5.6 cm...</p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55658#post-id-55658I know. But this is also not possible. Let's say we attach the balls to the ends of a stick with a length of 1m. If we align the stick with the direction to the camera, the balls are observed at the same pixel location (if you can somehow see both balls) so that the pixel distance is zero. Now your rotate the stick so that it's perpendicular to the optical axis. Now the balls are seen at different pixel locations even though their distance is still the same. [Now I get your point: You want to move the camera so that you have a special configuration. That could simplify the problem, but strongly restricts the use cases]Thu, 19 Feb 2015 05:03:27 -0600http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55658#post-id-55658Comment by FooBar for <p>i am calculating distance between two balls in a image.
first i have detected balls using hough transform circle and get their center point coordinates and applied distance measuring formula to get distance, but not getting nearby to the solution.
say if two balls are 13 cm apart then i am getting 5.6 cm...</p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55650#post-id-55650There is no way to convert pixels to a distance. If your balls are aligned with your camera, your pixel distance would be zero independent of the distance of your balls. (you probably couldn't see the second ball, but I guess you get the point). You need to compute the full 3d Position of your balls to get the distance. And this is possible as long as you know the radius of your balls. (and you have a calibrated camera)Thu, 19 Feb 2015 04:14:16 -0600http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55650#post-id-55650Comment by David_86 for <p>i am calculating distance between two balls in a image.
first i have detected balls using hough transform circle and get their center point coordinates and applied distance measuring formula to get distance, but not getting nearby to the solution.
say if two balls are 13 cm apart then i am getting 5.6 cm...</p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55631#post-id-55631Are the balls on the same plane, parallel to the image plane? Have u taken a shot with a known size object at the same distance to know how many mm/pixel you have in the image?
If you've done this then you have all the info to get the distance between the 2 balls. Some error may come in if the balls are lying in different planes parallel to the image plane, but if they're not then you should get the correct distance between each other.Thu, 19 Feb 2015 03:00:17 -0600http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55631#post-id-55631Comment by Jasdeep for <p>i am calculating distance between two balls in a image.
first i have detected balls using hough transform circle and get their center point coordinates and applied distance measuring formula to get distance, but not getting nearby to the solution.
say if two balls are 13 cm apart then i am getting 5.6 cm...</p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=56604#post-id-56604hi everyone ,
thanks for your suggestions but still not able to solve this problem.
now i am using camera calibration to determine the relation between the camera’s natural units (pixels) and the real world units (mm), could anybody tell me what's the relation in them so that i can find distance between two balls.
thanksTue, 03 Mar 2015 00:24:13 -0600http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=56604#post-id-56604Comment by Jasdeep for <p>i am calculating distance between two balls in a image.
first i have detected balls using hough transform circle and get their center point coordinates and applied distance measuring formula to get distance, but not getting nearby to the solution.
say if two balls are 13 cm apart then i am getting 5.6 cm...</p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55629#post-id-55629i have coordinates of center of two detected circle (x1,y1) and (x2,y2)
by pythagoras theorem ,
d=sqrt( (x2-x1)^2 + (y2-y1)^2 )
and converting result into cm (converting pixels to cm)Thu, 19 Feb 2015 02:49:20 -0600http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55629#post-id-55629Comment by thdrksdfthmn for <p>i am calculating distance between two balls in a image.
first i have detected balls using hough transform circle and get their center point coordinates and applied distance measuring formula to get distance, but not getting nearby to the solution.
say if two balls are 13 cm apart then i am getting 5.6 cm...</p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55693#post-id-55693if you know the radius (or diameter) of the ball, you can count the number of pixels on radius (diameter) and then you may transform the pixel in centimeter, am I wrong? consideration of [optical center](http://www.photographyknowhow.com/images/lens-focal-length.gif), because the distortion is not so huge, IMHOThu, 19 Feb 2015 09:34:37 -0600http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55693#post-id-55693Comment by David_86 for <p>i am calculating distance between two balls in a image.
first i have detected balls using hough transform circle and get their center point coordinates and applied distance measuring formula to get distance, but not getting nearby to the solution.
say if two balls are 13 cm apart then i am getting 5.6 cm...</p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55659#post-id-55659Well, it depends on the context he's dealing with..If the balls are on a table, then you just need a camera looking at the table from above and you're done with a single shot and no calibration. In the most general case where the camera is fixed and the balls can be at different depths you're right, will need to compute full 3d position to get relative distance but i think regular stereo would be more accurate (so at least 2 shots)Thu, 19 Feb 2015 05:11:21 -0600http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55659#post-id-55659Comment by David_86 for <p>i am calculating distance between two balls in a image.
first i have detected balls using hough transform circle and get their center point coordinates and applied distance measuring formula to get distance, but not getting nearby to the solution.
say if two balls are 13 cm apart then i am getting 5.6 cm...</p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=56610#post-id-56610Hi Jasdeep, the ratio between pixels and real world units is variable and it depends on the distance of the plane parallel to the image plane you're considering. Your resolution in pixels is fixed, so 1m away from the camera you'll have a certain resolution in pixel/mm, 10m away this resolution will be lower because the number of pixels is still the same but the field of view is bigger. As said at the beginning if you're trying to get size of objects with a single shot you must have a known size object at the same distance of the object you want to measure, and that will tell you how many mm each pixel correspond at that distance. You don't even need a calibrated camera to do that. Hope this helps and feel free to ask if still have any doubt :)Tue, 03 Mar 2015 01:48:05 -0600http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=56610#post-id-56610Comment by Maori for <p>i am calculating distance between two balls in a image.
first i have detected balls using hough transform circle and get their center point coordinates and applied distance measuring formula to get distance, but not getting nearby to the solution.
say if two balls are 13 cm apart then i am getting 5.6 cm...</p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55641#post-id-55641I guess that the problem is in the conversion pixels to cm. how have you done it?Thu, 19 Feb 2015 03:44:49 -0600http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55641#post-id-55641Comment by FooBar for <p>i am calculating distance between two balls in a image.
first i have detected balls using hough transform circle and get their center point coordinates and applied distance measuring formula to get distance, but not getting nearby to the solution.
say if two balls are 13 cm apart then i am getting 5.6 cm...</p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55681#post-id-55681even on a table he can't just get from pixels to cm as the pixel distance will decrease with the distance of the balls to the optical center.Thu, 19 Feb 2015 08:35:06 -0600http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=55681#post-id-55681Answer by Jasdeep for <p>i am calculating distance between two balls in a image.
first i have detected balls using hough transform circle and get their center point coordinates and applied distance measuring formula to get distance, but not getting nearby to the solution.
say if two balls are 13 cm apart then i am getting 5.6 cm...</p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?answer=62089#post-id-62089 solved this problem,
by calculating distance between two coordinates of points using Pythagoras in pixels and just convert it into measuring units in (cm) , this solve my issue.Mon, 18 May 2015 01:56:21 -0500http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?answer=62089#post-id-62089Answer by tomnjerry for <p>i am calculating distance between two balls in a image.
first i have detected balls using hough transform circle and get their center point coordinates and applied distance measuring formula to get distance, but not getting nearby to the solution.
say if two balls are 13 cm apart then i am getting 5.6 cm...</p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?answer=57878#post-id-57878**The problem can be divided in two parts:**
**Plane containing the balls:** Constrain in this problem would be that you need the plane containing the balls perpendicular to axis of your camera. If that is not the case, the detected distance between your balls will always be less than actual distance.
**Distance of objects from camera:**
One case would be having the plane containing the ball at a fixed distance from your camera. In this case conversion of distance in pixels to cm would be possible by calibrating your camera. This can be done by placing your objects at a known distance from each other (say 10 cm) and calculating the distance between them in pixels say (500 pixels). Now while calculating distance would be simple mathematics. If pixel distance is 300, then actual distance is: x = 300 * 10 / 500. In this case it wont be necessary to know the size of object
Second case would be having the plane containing the ball at variable distance from your camera. In this case you should know the size of object before hand. Knowing the size of object, would help calibrate the camera. Say a object which (in your case : ball) is say 5 cm in real world is represented using 30 pixels, then the distance between object which is 300 pixels on image can be calculate as (300 * 5 / 30). Thus knowing the object size is key factor if the plane containing the objects is variable.
Hope this helps you!
Fri, 20 Mar 2015 02:53:23 -0500http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?answer=57878#post-id-57878Comment by thdrksdfthmn for <p><strong>The problem can be divided in two parts:</strong> </p>
<p><strong>Plane containing the balls:</strong> Constrain in this problem would be that you need the plane containing the balls perpendicular to axis of your camera. If that is not the case, the detected distance between your balls will always be less than actual distance. </p>
<p><strong>Distance of objects from camera:</strong>
One case would be having the plane containing the ball at a fixed distance from your camera. In this case conversion of distance in pixels to cm would be possible by calibrating your camera. This can be done by placing your objects at a known distance from each other (say 10 cm) and calculating the distance between them in pixels say (500 pixels). Now while calculating distance would be simple mathematics. If pixel distance is 300, then actual distance is: x = 300 * 10 / 500. In this case it wont be necessary to know the size of object</p>
<p>Second case would be having the plane containing the ball at variable distance from your camera. In this case you should know the size of object before hand. Knowing the size of object, would help calibrate the camera. Say a object which (in your case : ball) is say 5 cm in real world is represented using 30 pixels, then the distance between object which is 300 pixels on image can be calculate as (300 * 5 / 30). Thus knowing the object size is key factor if the plane containing the objects is variable. </p>
<p>Hope this helps you! </p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=57884#post-id-57884In the first case I would say "the detected distance between your balls will always be **greater** than actual distance". More, I do not really understand "having the plane containing the ball at a fixed distance from your camera" (isn't it the ball is at a fixed distance from the camera, that is a "curved-plane")?Fri, 20 Mar 2015 03:42:08 -0500http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=57884#post-id-57884Comment by David_86 for <p><strong>The problem can be divided in two parts:</strong> </p>
<p><strong>Plane containing the balls:</strong> Constrain in this problem would be that you need the plane containing the balls perpendicular to axis of your camera. If that is not the case, the detected distance between your balls will always be less than actual distance. </p>
<p><strong>Distance of objects from camera:</strong>
One case would be having the plane containing the ball at a fixed distance from your camera. In this case conversion of distance in pixels to cm would be possible by calibrating your camera. This can be done by placing your objects at a known distance from each other (say 10 cm) and calculating the distance between them in pixels say (500 pixels). Now while calculating distance would be simple mathematics. If pixel distance is 300, then actual distance is: x = 300 * 10 / 500. In this case it wont be necessary to know the size of object</p>
<p>Second case would be having the plane containing the ball at variable distance from your camera. In this case you should know the size of object before hand. Knowing the size of object, would help calibrate the camera. Say a object which (in your case : ball) is say 5 cm in real world is represented using 30 pixels, then the distance between object which is 300 pixels on image can be calculate as (300 * 5 / 30). Thus knowing the object size is key factor if the plane containing the objects is variable. </p>
<p>Hope this helps you! </p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=57903#post-id-57903If the object size is known with a single shot you don't need a calibrated camera (in fact, in your first case you're calibrating the camera with a known object size which is the calibration pattern. Why not Just skip this step and do the same directly on the ball?) no matter the distance: in every case you'll get distance between the 2 objects by simply counting pixels, if they lie on the same plane parallel to the image plane. If they're on different planes then you're not going to solve the problem anyway.Fri, 20 Mar 2015 04:57:29 -0500http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=57903#post-id-57903Comment by David_86 for <p><strong>The problem can be divided in two parts:</strong> </p>
<p><strong>Plane containing the balls:</strong> Constrain in this problem would be that you need the plane containing the balls perpendicular to axis of your camera. If that is not the case, the detected distance between your balls will always be less than actual distance. </p>
<p><strong>Distance of objects from camera:</strong>
One case would be having the plane containing the ball at a fixed distance from your camera. In this case conversion of distance in pixels to cm would be possible by calibrating your camera. This can be done by placing your objects at a known distance from each other (say 10 cm) and calculating the distance between them in pixels say (500 pixels). Now while calculating distance would be simple mathematics. If pixel distance is 300, then actual distance is: x = 300 * 10 / 500. In this case it wont be necessary to know the size of object</p>
<p>Second case would be having the plane containing the ball at variable distance from your camera. In this case you should know the size of object before hand. Knowing the size of object, would help calibrate the camera. Say a object which (in your case : ball) is say 5 cm in real world is represented using 30 pixels, then the distance between object which is 300 pixels on image can be calculate as (300 * 5 / 30). Thus knowing the object size is key factor if the plane containing the objects is variable. </p>
<p>Hope this helps you! </p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=57953#post-id-57953sure, as long as you know the size of an object on that plane you can solve the problem for any given distance..Fri, 20 Mar 2015 09:54:57 -0500http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=57953#post-id-57953Comment by tomnjerry for <p><strong>The problem can be divided in two parts:</strong> </p>
<p><strong>Plane containing the balls:</strong> Constrain in this problem would be that you need the plane containing the balls perpendicular to axis of your camera. If that is not the case, the detected distance between your balls will always be less than actual distance. </p>
<p><strong>Distance of objects from camera:</strong>
One case would be having the plane containing the ball at a fixed distance from your camera. In this case conversion of distance in pixels to cm would be possible by calibrating your camera. This can be done by placing your objects at a known distance from each other (say 10 cm) and calculating the distance between them in pixels say (500 pixels). Now while calculating distance would be simple mathematics. If pixel distance is 300, then actual distance is: x = 300 * 10 / 500. In this case it wont be necessary to know the size of object</p>
<p>Second case would be having the plane containing the ball at variable distance from your camera. In this case you should know the size of object before hand. Knowing the size of object, would help calibrate the camera. Say a object which (in your case : ball) is say 5 cm in real world is represented using 30 pixels, then the distance between object which is 300 pixels on image can be calculate as (300 * 5 / 30). Thus knowing the object size is key factor if the plane containing the objects is variable. </p>
<p>Hope this helps you! </p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=57925#post-id-57925ya thats correct, but I wanted to point out that if distance of objects from camera keeps changing, you will have to know the size of the object beforehand.Fri, 20 Mar 2015 05:48:20 -0500http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=57925#post-id-57925Comment by thdrksdfthmn for <p><strong>The problem can be divided in two parts:</strong> </p>
<p><strong>Plane containing the balls:</strong> Constrain in this problem would be that you need the plane containing the balls perpendicular to axis of your camera. If that is not the case, the detected distance between your balls will always be less than actual distance. </p>
<p><strong>Distance of objects from camera:</strong>
One case would be having the plane containing the ball at a fixed distance from your camera. In this case conversion of distance in pixels to cm would be possible by calibrating your camera. This can be done by placing your objects at a known distance from each other (say 10 cm) and calculating the distance between them in pixels say (500 pixels). Now while calculating distance would be simple mathematics. If pixel distance is 300, then actual distance is: x = 300 * 10 / 500. In this case it wont be necessary to know the size of object</p>
<p>Second case would be having the plane containing the ball at variable distance from your camera. In this case you should know the size of object before hand. Knowing the size of object, would help calibrate the camera. Say a object which (in your case : ball) is say 5 cm in real world is represented using 30 pixels, then the distance between object which is 300 pixels on image can be calculate as (300 * 5 / 30). Thus knowing the object size is key factor if the plane containing the objects is variable. </p>
<p>Hope this helps you! </p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=57935#post-id-57935If the distance to the objects plane is changing, but the objects remain in the same plane parallel to the camera plane(image plane) it is also able to solve the problem...Fri, 20 Mar 2015 07:04:17 -0500http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=57935#post-id-57935Comment by tomnjerry for <p><strong>The problem can be divided in two parts:</strong> </p>
<p><strong>Plane containing the balls:</strong> Constrain in this problem would be that you need the plane containing the balls perpendicular to axis of your camera. If that is not the case, the detected distance between your balls will always be less than actual distance. </p>
<p><strong>Distance of objects from camera:</strong>
One case would be having the plane containing the ball at a fixed distance from your camera. In this case conversion of distance in pixels to cm would be possible by calibrating your camera. This can be done by placing your objects at a known distance from each other (say 10 cm) and calculating the distance between them in pixels say (500 pixels). Now while calculating distance would be simple mathematics. If pixel distance is 300, then actual distance is: x = 300 * 10 / 500. In this case it wont be necessary to know the size of object</p>
<p>Second case would be having the plane containing the ball at variable distance from your camera. In this case you should know the size of object before hand. Knowing the size of object, would help calibrate the camera. Say a object which (in your case : ball) is say 5 cm in real world is represented using 30 pixels, then the distance between object which is 300 pixels on image can be calculate as (300 * 5 / 30). Thus knowing the object size is key factor if the plane containing the objects is variable. </p>
<p>Hope this helps you! </p>
http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=57891#post-id-57891Thats never really possible irrespective of what. Even the problem statement clearly states that detected distance is less than the actaul distance which contradicts your prediction.Fri, 20 Mar 2015 03:56:09 -0500http://answers.opencv.org/question/55622/calculate-distance-between-two-objects-in-a-image-using-single-camera/?comment=57891#post-id-57891