CameraCalibration: 2D -> 3D Projection Question

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

CameraCalibration: 2D -> 3D Projection Question

Matthias Schmieder
Hello out there,
I've a question to the more advanced image processing developers in this mailing list. I think it's best if I just explain what I want do do ;)

Let's say I have a stereo camera system that I have calibrated successfully. I did get the intrinsic and distortion coefficients of both cameras. Now I detect a specific spot in one image from which I know what distance between the camera and the object lies. This means that I have a 2D point in the coordinate system of my first camera and a distance from the camera to the specific point. What I want to do is to reproject that 2D point into world coordinates and then project it to the 2D coordinates of the second camera.

The problem is, that I have now idea how to get the 3D coordinates of the said point by only knowing the 2D position in the image and the distance to the object. If I could compute these coordinates I would simply use the "cvProjectPoints2()" function to get it into the coordinate system of the second camera.

Can anyone tell me, what I have to do, to get the correct coordinates?


Thanks in advance


Regards
Matthias
Reply | Threaded
Open this post in threaded view
|

Re: [OpenCV] CameraCalibration: 2D -> 3D Projection Question

Estereo en Garra
Hi,
You can't recover the 3D position of a point with only one 2D
measurement. You need at least 2 measurements from different point of
view in order to triangulate the 3D position...

Jorge

Matthias Schmieder wrote:

>
>
> Hello out there,
> I've a question to the more advanced image processing developers in this
> mailing list. I think it's best if I just explain what I want do do ;)
>
> Let's say I have a stereo camera system that I have calibrated
> successfully.
> I did get the intrinsic and distortion coefficients of both cameras. Now I
> detect a specific spot in one image from which I know what distance
> between
> the camera and the object lies. This means that I have a 2D point in the
> coordinate system of my first camera and a distance from the camera to the
> specific point. What I want to do is to reproject that 2D point into world
> coordinates and then project it to the 2D coordinates of the second
> camera.
>
> The problem is, that I have now idea how to get the 3D coordinates of the
> said point by only knowing the 2D position in the image and the
> distance to
> the object. If I could compute these coordinates I would simply use the
> "cvProjectPoints2()" function to get it into the coordinate system of the
> second camera.
>
> Can anyone tell me, what I have to do, to get the correct coordinates?
>
> Thanks in advance
>
> Regards
> Matthias
> --
> View this message in context:
> http://n2.nabble.com/CameraCalibration-2D-3D-Projection-Question-tp4440322p4440322.html 
> <http://n2.nabble.com/CameraCalibration-2D-3D-Projection-Question-tp4440322p4440322.html>
> Sent from the opencv-users mailing list archive at Nabble.com.
>
>



------------------------------------

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/OpenCV/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/OpenCV/join
    (Yahoo! ID required)

<*> To change settings via email:
    [hidden email]
    [hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply | Threaded
Open this post in threaded view
|

Re: [OpenCV] CameraCalibration: 2D -> 3D Projection Question

Matthias Schmieder
Hi Jorge,

I don't know if you're right since I have the distance of that 'point' from the camera to the object. I know it is/should be possible to reproject the 2D point to a ray into the world with the intrinsic and distortion parameters. The triangulation should only be necessary to 'restore' the distance from the camera. Since I have that distance computed an other way around the reprojection to the 3D coordinate should be possible - but a really don't know how.


Thanks anyway...


Regards
Matthias      
Reply | Threaded
Open this post in threaded view
|

Re: [OpenCV] CameraCalibration: 2D -> 3D Projection Question

Estereo en Garra
Hi,
sorry I misunderstood you. You can get the 3D point by only applying
some trigonometry. Consider the angle between the principal ray and the
ray passing though the point (u,v) in your image. Check
http://www.doc.ic.ac.uk/~ajd/Publications/civera_etal_tro2008.pdf,
section II, B and C for some hints on the geometry of the problem.

Hope this helps.
Jorge

Matthias Schmieder wrote:

>
>
> Hi Jorge,
>
> I don't know if you're right since I have the distance of that 'point'
> from
> the camera to the object. I know it is/should be possible to reproject the
> 2D point to a ray into the world with the intrinsic and distortion
> parameters. The triangulation should only be necessary to 'restore' the
> distance from the camera. Since I have that distance computed an other way
> around the reprojection to the 3D coordinate should be possible - but a
> really don't know how.
>
> Thanks anyway...
>
> Regards
> Matthias
> --
> View this message in context:
> http://n2.nabble.com/CameraCalibration-2D-3D-Projection-Question-tp4440322p4440437.html 
> <http://n2.nabble.com/CameraCalibration-2D-3D-Projection-Question-tp4440322p4440437.html>
> Sent from the opencv-users mailing list archive at Nabble.com.
>
>



------------------------------------

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/OpenCV/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/OpenCV/join
    (Yahoo! ID required)

<*> To change settings via email:
    [hidden email]
    [hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply | Threaded
Open this post in threaded view
|

Re: [OpenCV] CameraCalibration: 2D -> 3D Projection Question

John McDonald
In reply to this post by Matthias Schmieder
When you say you know the distance of the object from the camera, I
presume you mean along the ray projected from the point through the
camera centre. If this is the case then form a vector
v = [p_x p_y f] , where the elements are the x image coordinate, y image
coordinate, and distance from the camera centre to principal point (i.e.
focal length).

This vector points in the direction of the world point. Normalise this
vector to get a unit vector in this direction, then multiple this unit
vector by the distance from the object to the camera. This should give
you the 3D coordinates of the object in the camera's coordinate system.

Note that p_x and p_y should be relative to the principal point.

Hope this helps.

Regards,
John McDonald.

Matthias Schmieder wrote:

>
>
> Hello out there,
> I've a question to the more advanced image processing developers in this
> mailing list. I think it's best if I just explain what I want do do ;)
>
> Let's say I have a stereo camera system that I have calibrated
> successfully.
> I did get the intrinsic and distortion coefficients of both cameras. Now I
> detect a specific spot in one image from which I know what distance
> between
> the camera and the object lies. This means that I have a 2D point in the
> coordinate system of my first camera and a distance from the camera to the
> specific point. What I want to do is to reproject that 2D point into world
> coordinates and then project it to the 2D coordinates of the second
> camera.
>
> The problem is, that I have now idea how to get the 3D coordinates of the
> said point by only knowing the 2D position in the image and the
> distance to
> the object. If I could compute these coordinates I would simply use the
> "cvProjectPoints2()" function to get it into the coordinate system of the
> second camera.
>
> Can anyone tell me, what I have to do, to get the correct coordinates?
>
> Thanks in advance
>
> Regards
> Matthias
> --
> View this message in context:
> http://n2.nabble.com/CameraCalibration-2D-3D-Projection-Question-tp4440322p4440322.html 
> <http://n2.nabble.com/CameraCalibration-2D-3D-Projection-Question-tp4440322p4440322.html>
> Sent from the opencv-users mailing list archive at Nabble.com.
>
>


------------------------------------

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/OpenCV/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/OpenCV/join
    (Yahoo! ID required)

<*> To change settings via email:
    [hidden email]
    [hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/