View Full Version : camera question
Can we use the camera to messure distance? :confused:
DjAlamose
02-02-2006, 12:29
Can we use the camera to messure distance? :confused:
Yes, the servos will give you an angle at which the camera is tilted at, with this, and some other dimensions, you can calculate the distance you are away from the target.
Alan Anderson
02-02-2006, 12:29
Indirectly, yes. If you know the actual size of what you're looking at, you can figure out how far away by how big it looks to the camera. Or if you know where it is relative to the camera mount's orientation, you can figure out its distance by how far away from center the camera needs to look in order to see it.
I figure many teams will be using the camera tilt angle and the known height of the vision target (plus a wee bit of trigonometry) to give an indication of the distance to the goal.
viewtyjoe
02-02-2006, 16:14
If you know the tilt angle, the height of the camera, and the height of the center of the target, you can approximate the horizontal distance using the equation distance = (height from camera to target)(cot(tilt angle)).
is the tan function built in the program? how do I get it so I can type "tan (angle in radians)" and have it evaluate?
is the tan function built in the program? how do I get it so I can type "tan (angle in radians)" and have it evaluate?
Yep, you should be able to just call it like that.
And that's built in to the camera function or in the default 2006 code?
Alan Anderson
03-02-2006, 00:07
See http://www.chiefdelphi.com/forums/showthread.php?t=32874&highlight=math.h for information on the provided math library.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.