Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm working with a stereo pair of photos, and trying to obtain a set of 3D points from matching points on these 2 images. How exactly is the point triangulated? Do you throw a ray from the camera pinhole centerpoint? Or do you throw a ray perpendicular to the photos?

enter image description here

Edit: I'm also looking for code examples, that document the simple linear/polynomial math involved. Currently I'm simply using 3D line/line intersections to find the point. (actually line/plane intersections) I'm sure this is not accurate and the calibration data of the camera should also be used. Although I don't know how. For instance, with the points on the photos known, should I be drawing the 3D line from the camera pinhole 'origin', or is there a better way? Should I be taking the lens distort into account, or something fancier? The calibration data I have is as follows:

  • ix, iy -- Image sensor width and height, i.e. the dimensions of the photograph.
  • fx, fy -- Focal length in x- and y-dimensions measured in pixels.
  • cx, cy -- Principal point coordinates, i.e. coordinates of lens optical axis interception with sensor plane.
  • skew -- Skew transformation coefficient.
  • k1, k2, k3 -- Radial distortion coefficients.
  • p1, p2 -- Tangential distortion coefficients.
share|improve this question
    
Are you using OpenCV for this? –  bummzack Dec 23 '11 at 16:59
    
No existing library. Just a bit of my own math within my own UI. –  Jarvis Dec 24 '11 at 9:24
    
    
It might be worth looking into the OpenCV implementation then. Especially the part about Camera Calibration and 3D Reconstruction –  bummzack Dec 24 '11 at 11:55

1 Answer 1

up vote 1 down vote accepted

The first image is more correct, because image on the photo is perspective rather than orthographic. It can be orthographic on macro photos. Possibly it depends on what type of lens do you use.

share|improve this answer
    
Updated question, can you help some more? –  Jarvis Dec 23 '11 at 16:39
    
Sorry, but I cannot, I've never worked on such theme, but from my experience in 3d programming, it looks like you have to build your projection matrix taking into account that parameters. And then use something(google on this if you haven't met it, "picking objects in 3d") like Unproject and you'll get a picking ray. –  bobenko Dec 23 '11 at 17:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.