Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calculating distance using a single camera

Tags:

c

opencv

emgucv

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.

like image 364
Hamza Yerlikaya Avatar asked Nov 14 '22 03:11

Hamza Yerlikaya


1 Answers

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.

like image 105
rossb83 Avatar answered Nov 17 '22 00:11

rossb83