Ask Your Question
0

calculate distance using disparity map

asked Mar 17 '14

La Rosa gravatar image

updated Mar 18 '14

berak gravatar image

i am wondering how can i calculate the distance between tow webcams(stereo vision) and an object in front of them using the disparity map?

Preview: (hide)

Comments

Any help please!

La Rosa gravatar imageLa Rosa (Mar 18 '14)edit

1 answer

Sort by » oldest newest most voted
4

answered Mar 18 '14

berak gravatar image

updated Mar 18 '14

looking at this nice page, we get:

D:= Distance of point in real world,
b:= base offset, (the distance *between* your cameras)
f:= focal length of camera, 
d:= disparity:

D = b*f/d
Preview: (hide)

Comments

it works but i'm getting the result in an matrix?!! is that ok?

La Rosa gravatar imageLa Rosa (Mar 18 '14)edit

oh, hehe. yes that's ok.

if you went and divided b*d ( a number ) by your disparity matrix, python will make a matrix as result.

every cell now contains the resp. distance at that point

berak gravatar imageberak (Mar 18 '14)edit

yopiii :) , thank you sooooo much

La Rosa gravatar imageLa Rosa (Mar 18 '14)edit

can you give me the code for calculating distance using disparity?

apoorva gravatar imageapoorva (Apr 9 '14)edit
1

@apoorva it's right in front of you ?

berak gravatar imageberak (Apr 9 '14)edit

How come pixel size isn't included in the formula?

Or is the pixel size implicitly included if we state disparity in the same measurment unit as focal length?

acajic gravatar imageacajic (Sep 2 '15)edit

Question Tools

1 follower

Stats

Asked: Mar 17 '14

Seen: 10,627 times

Last updated: Mar 18 '14