5

I would like to calculate distance to certain objects in the scene, I know that I can only calculate relative distance when using a single camera but I know the coordinates of some objects in the scene so in theory it should be possible to calculate actual distance. According to the opencv mailing list archives,

http://tech.groups.yahoo.com/group/OpenCV/message/73541

cvFindExtrinsicCameraParams2 is the function to use, but I can't find information on how to use it?

PS. Assuming camera is properly calibrated.

Hamza Yerlikaya
  • 49,047
  • 44
  • 147
  • 241

1 Answers1

1

My guess would be, you know the width of an object, such as a ball is 6 inches across and 6 inches tall, you can also see that it is 20 pixels tall and 25 pixels wide. You also know the ball is 10 feet away. This would be your start.

Extrinsic parameters wouldn't help you, I don't think, because that is the camera's location and rotation in space relative to another camera or an origin. For a one camera system, the camera is the origin.

Intrinsic parameters might help. I'm not sure, I've only done it using two cameras.

rossb83
  • 1,694
  • 4
  • 21
  • 40
  • Hi Ross, This is Divya from India, an undergraduate student of electronics and telecommunication. We are working on stereovision as part of our project. We are using OpenCV library on Linux platform(flavour-Ubuntu). Till now, we have tried two approaches to find the 3D coordinates of objects, first approach being obtaining the Q-reprojection matrix from the rectification function in OpenCV and multiplying it with x,y coords on image and disparity value. In the second approach we tried to use the function cvReprojectImageto3D which is giving an error. Please could you provide us with guidelin –  Feb 21 '11 at 10:25