

Hi everyone, i'm kind of a newbye to openCV's, so be patient :)
I have to calculate the distance from the camera of a knownsize object without using stereoscopy (ie using only the frontal camera). I know that this is possible knowing the item size.
I managed to collect some very accurate distance(x)pixelsize(y) data points (using color blobs), and they seem to behave like an iperbolic function y = a/x + b.
Can anyone confirm me that this is the real model for this kind of relation? I tried to fit them statistically and the correlation was not bad, but not exactly accurate..


Hi,
I guess that you are willing to retrieve the pose of the item in R^3 knowing the size of the object. Otherwise as someone who deals with 3D reconstruction in vision I have never heard about a method which evaluates depth based on item size. I can tell you that in a canocical stereo setup the disparity (distance between corresponding pixels is diversely related to the metric distance to the object in the scene.
I hope this helps.
Rami
 In [hidden email], "doctor_omega504" <doctor_omega504@...> wrote:
>
> Hi everyone, i'm kind of a newbye to openCV's, so be patient :)
>
> I have to calculate the distance from the camera of a knownsize object without using stereoscopy (ie using only the frontal camera). I know that this is possible knowing the item size.
>
> I managed to collect some very accurate distance(x)pixelsize(y) data points (using color blobs), and they seem to behave like an iperbolic function y = a/x + b.
>
> Can anyone confirm me that this is the real model for this kind of relation? I tried to fit them statistically and the correlation was not bad, but not exactly accurate..
>


Hi,
try starting at looking the maths of a pinhole camera
http://en.wikipedia.org/wiki/Pinhole_camera_modelRegards
doctor_omega504 wrote:
> Hi everyone, i'm kind of a newbye to openCV's, so be patient :)
>
> I have to calculate the distance from the camera of a knownsize object without using stereoscopy (ie using only the frontal camera). I know that this is possible knowing the item size.
>
> I managed to collect some very accurate distance(x)pixelsize(y) data points (using color blobs), and they seem to behave like an iperbolic function y = a/x + b.
>
> Can anyone confirm me that this is the real model for this kind of relation? I tried to fit them statistically and the correlation was not bad, but not exactly accurate..
>
>
>
> 
>
> Change settings: http://www.yahoogroups.com/mygroups, select
> Get Emails (get all posts)
> Daily Digest (one summary email per day)
> Read on the web (read posts on the web only)Or Unsubscribe by mailing [hidden email]
> Yahoo! Groups Links
>
>
>
>
>


On Tue, 20101221 at 13:23 +0000, doctor_omega504 wrote:
> Hi everyone, i'm kind of a newbye to openCV's, so be patient :)
>
> I have to calculate the distance from the camera of a knownsize object without using stereoscopy (ie using only the frontal camera). I know that this is possible knowing the item size.
I've done this as a toy application, single camera distance measurement,
I tried combining OpenCV (for acquisition and camera calibration) and
ARToolKitPlus (for marker detection and pose estimation), but I didn't
do any maths, just used what ARToolKitPlus already provides.
I've used a fiducial marker, which when printed is exactly 8x8 cm, and
the distance it gives me are + correct (maybe 5% error).
If there is any interest, I may share the code.


i'm new to opencv i have to do a project for robotics in which there is a need for distance measurement and direction detection of motion of a object so which function should i use to find it ..............pls suggest me how to do it


Hi,
You cant just call a function and get the distance & direction of an object
from a camera image because this is impossible to do without more
information, for example if you saw a photo of a red square on a white
background then you don't know if the square is 1 inch wide or 100
kilometers wide, because there is not enough information. You can use things
like stereo cameras and depth cameras to help, or if you already know the
exact size & shape of the object you are tracking then it can be used with a
single camera, but it is not always easy. One method is with POSIT (that
OpenCV has), but this might not be easy to use for robotics since it gives
you a rotation & translation matrix. But another method is the one I used
for my Masters Thesis, which you can find at " http://www.shervinemami.info/"
or " http://www.shervinemami.co.cc/"
Cheers,
Shervin Emami.
On Mon, Apr 11, 2011 at 12:10 AM, amit.benade < [hidden email]> wrote:
>
>
> i'm new to opencv i have to do a project for robotics in which there is a
> need for distance measurement and direction detection of motion of a object
> so which function should i use to find it ..............pls suggest me how
> to do it
>
>
>


Hi
i dont thing about
we want use the DPI information for object in the frame and map it on real
object then we want use the sin formula calculate the distance in 2D
________________________________
From: Shervin Emami < [hidden email]>
To: [hidden email]
Cc: amit.benade < [hidden email]>
Sent: Thu, April 14, 2011 7:39:39 AM
Subject: Re: [OpenCV] calculation of distance of an object from camera using
opencv
Hi,
You cant just call a function and get the distance & direction of an object from
a camera image because this is impossible to do without more information, for
example if you saw a photo of a red square on a white background then you don't
know if the square is 1 inch wide or 100 kilometers wide, because there is not
enough information. You can use things like stereo cameras and depth cameras to
help, or if you already know the exact size & shape of the object you are
tracking then it can be used with a single camera, but it is not always easy.
One method is with POSIT (that OpenCV has), but this might not be easy to use
for robotics since it gives you a rotation & translation matrix. But another
method is the one I used for my Masters Thesis, which you can find at
" http://www.shervinemami.info/" or " http://www.shervinemami.co.cc/"
Cheers,
Shervin Emami.
On Mon, Apr 11, 2011 at 12:10 AM, amit.benade < [hidden email]> wrote:
>i'm new to opencv i have to do a project for robotics in which there is a need
>for distance measurement and direction detection of motion of a object so which
>function should i use to find it ..............pls suggest me how to do it
>
>


I belive that the easy way is:
use :
distancex = point2.x  point1.x;
distancey = point2.y  point1.y;
cvSqrt( (float)(distancex*distancex + distancey*distancey));
Before applying this formula you can use scale adjust to compensate the
distance from the camera ...
Eder de Souza
On Thu, Apr 14, 2011 at 2:16 AM, Behzad Lotfi < [hidden email]>wrote:
>
>
> Hi
> i dont thing about
> we want use the DPI information for object in the frame and map it on real
> object then we want use the sin formula calculate the distance in 2D
>
>
> 
> *From:* Shervin Emami < [hidden email]>
> *To:* [hidden email]
> *Cc:* amit.benade < [hidden email]>
> *Sent:* Thu, April 14, 2011 7:39:39 AM
> *Subject:* Re: [OpenCV] calculation of distance of an object from camera
> using opencv
>
>
>
> Hi,
>
> You cant just call a function and get the distance & direction of an object
> from a camera image because this is impossible to do without more
> information, for example if you saw a photo of a red square on a white
> background then you don't know if the square is 1 inch wide or 100
> kilometers wide, because there is not enough information. You can use things
> like stereo cameras and depth cameras to help, or if you already know the
> exact size & shape of the object you are tracking then it can be used with a
> single camera, but it is not always easy. One method is with POSIT (that
> OpenCV has), but this might not be easy to use for robotics since it gives
> you a rotation & translation matrix. But another method is the one I used
> for my Masters Thesis, which you can find at "
> http://www.shervinemami.info/" or " http://www.shervinemami.co.cc/"
>
> Cheers,
> Shervin Emami.
>
>
> On Mon, Apr 11, 2011 at 12:10 AM, amit.benade < [hidden email]>wrote:
>
>>
>>
>> i'm new to opencv i have to do a project for robotics in which there is a
>> need for distance measurement and direction detection of motion of a object
>> so which function should i use to find it ..............pls suggest me how
>> to do it
>>
>>
>
>
>
>


yes please could you share the code .t
thanks
 In [hidden email], Michal Kottman <k0mpjut0r@...> wrote:
>
> On Tue, 20101221 at 13:23 +0000, doctor_omega504 wrote:
> > Hi everyone, i'm kind of a newbye to openCV's, so be patient :)
> >
> > I have to calculate the distance from the camera of a knownsize object without using stereoscopy (ie using only the frontal camera). I know that this is possible knowing the item size.
>
> I've done this as a toy application, single camera distance measurement,
> I tried combining OpenCV (for acquisition and camera calibration) and
> ARToolKitPlus (for marker detection and pose estimation), but I didn't
> do any maths, just used what ARToolKitPlus already provides.
>
> I've used a fiducial marker, which when printed is exactly 8x8 cm, and
> the distance it gives me are + correct (maybe 5% error).
>
> If there is any interest, I may share the code.
>


Hi! I am working on a same project:
Markerless tracking with a monocular camera for tracking objects.
I use Planar textured object and SURF for detection.
Then I calibrate th system computing the camera pose from a known distance from the target and using this ratio to correct the pose:
computed distance/measured distance.
Is it correct? Are there better solution?
 In [hidden email], Eder Souza <ederwander@...> wrote:
>
> I belive that the easy way is:
>
>
> use :
>
>
> distancex = point2.x  point1.x;
> distancey = point2.y  point1.y;
> cvSqrt( (float)(distancex*distancex + distancey*distancey));
>
>
> Before applying this formula you can use scale adjust to compensate the
> distance from the camera ...
>
> Eder de Souza
>
>
>
> On Thu, Apr 14, 2011 at 2:16 AM, Behzad Lotfi <behzad.lotfi@...>wrote:
>
> >
> >
> > Hi
> > i dont thing about
> > we want use the DPI information for object in the frame and map it on real
> > object then we want use the sin formula calculate the distance in 2D
> >
> >
> > 
> > *From:* Shervin Emami <shervin.emami@...>
> > *To:* [hidden email]
> > *Cc:* amit.benade <amit.benade@...>
> > *Sent:* Thu, April 14, 2011 7:39:39 AM
> > *Subject:* Re: [OpenCV] calculation of distance of an object from camera
> > using opencv
> >
> >
> >
> > Hi,
> >
> > You cant just call a function and get the distance & direction of an object
> > from a camera image because this is impossible to do without more
> > information, for example if you saw a photo of a red square on a white
> > background then you don't know if the square is 1 inch wide or 100
> > kilometers wide, because there is not enough information. You can use things
> > like stereo cameras and depth cameras to help, or if you already know the
> > exact size & shape of the object you are tracking then it can be used with a
> > single camera, but it is not always easy. One method is with POSIT (that
> > OpenCV has), but this might not be easy to use for robotics since it gives
> > you a rotation & translation matrix. But another method is the one I used
> > for my Masters Thesis, which you can find at "
> > http://www.shervinemami.info/" or " http://www.shervinemami.co.cc/"
> >
> > Cheers,
> > Shervin Emami.
> >
> >
> > On Mon, Apr 11, 2011 at 12:10 AM, amit.benade <amit.benade@...>wrote:
> >
> >>
> >>
> >> i'm new to opencv i have to do a project for robotics in which there is a
> >> need for distance measurement and direction detection of motion of a object
> >> so which function should i use to find it ..............pls suggest me how
> >> to do it
> >>
> >>
> >
> >
> >
> >
>


This post has NOT been accepted by the mailing list yet.
i am working on this project so ,i want code of opencv to calculate the distance of the perticular obejct


This post has NOT been accepted by the mailing list yet.
This post was updated on .
How to find distance between two pixels in an image..help please...i m using opencv2.4.....c++


This post has NOT been accepted by the mailing list yet.
hey can you pls share the code


This post has NOT been accepted by the mailing list yet.
Hi Michal,
How are you doing? I have seen once of your post distance calculation and much impressed to see the source code because i am also doing similar project. If possible, can you please share it to my mailid banudevareddy.bandi@gmail.com.
Thanks & regards,
Banudeva Reddy. B

