2

I've got a basic setup using an Asus Xtion Pro Live sensor with the sensor suspended at 3m above ground looking straight down. I'm trying to work out the visible bounds in meters.

Here's a diagram to illustrate this: Asus sensor setup above ground

I know the FOV angles:

Field of View
58° H, 45° V, 70° D (Horizontal, Vertical, Diagonal)

I though about using a bit of trig to work it out. If I take the HFOV, half it and imagine the right angled triangle formed, I could could use the tangent (opposite / adjacent), knowing the angle to work out the opposite side:

opposite = adjacent * tan(29)
opposite = 3m * tan(29)
opposite ~= 2.66m

Just to test, I've also put together a very basic program using Processing and SimpleOpenNI to measure: mark two points, get the 3D coordinates and compute distance.

import SimpleOpenNI.*;

SimpleOpenNI ni;
PVector m1,m2,p1,p2;
PVector[] realWorldMap;

void setup(){
  size(640,480);stroke(0,192,0);
  ni = new SimpleOpenNI(this);
  if(!ni.enableDepth()) exit();
  ni.alternativeViewPointDepthToImage();
}
void draw(){
  ni.update();
  realWorldMap = ni.depthMapRealWorld();
  image(ni.depthImage(),0,0);
  if(m1 != null && m2 != null) line(m1.x,m1.y,m2.x,m2.y);
  if(p1 != null && p2 != null) text("distance :"+(int  )(p1.dist(p2)*.1)+" cm",5,15);
}
void mouseReleased(){
  if(!keyPressed){
    m1 = new PVector(mouseX,mouseY);
    p1 = realWorldMap[mouseY*640 + mouseX];
  }else{
    m2 = new PVector(mouseX,mouseY);
    p2 = realWorldMap[mouseY*640 + mouseX];
  }
}
void keyPressed(){
  if(key == ' ') m1 = m2 = p1 = p2 = null;
}

I've got ~2.6 as the widest measurements, but I'm slightly confused because I thought that the opposite side is only half of the frustrum's base width, so was expecting ~5.3m. Are my assumptions wrong ? If so, what am I doing wrong/what's the correct way to calculate this ?

I've also used the Kinect tag, because the same principle applies for the kinect sensor as well

George Profenza
  • 50,687
  • 19
  • 144
  • 218

2 Answers2

1

It might be more convenient to calculate this in Excel or OpenOffice Calc.

As a rule of thumb, the horizontal field of view (as a linear width) of the Kinect is about 1.1 times the distance from the sensor. More inexactly, the width of the image at a given distance D from the sensor is the same as the distance D, especially if you've merged the color and depth images and have black depth pixels around the edges.

D = distance from sensor
theta = angular field of view of Kinect = 57 degrees

tangent (angle) = opposite/adjacent

tan (theta/2) = (ImageWidth/2) / D
D * tan (theta/2) = ImageWidth/2
2 * D * tan (theta/2) = ImageWidth

ImageWidth(D) = 2D * tan(28.5 degrees)

For example,

ImageWidth(1.0m) = 2 (1.0) * tan(28.5 degrees) = 2 * (1.0) * 0.543 = 1.08m
Rethunk
  • 3,976
  • 18
  • 32
1

You should convert degrees to radians first:

tan(29 degrees)=tan(0.5061 rad)=0.5543.

Thus, opposite=0.5543*3m=1.663m and the horizontal visible bound is 2*opposite=3.33m

Therefore, the rule of thumb mentioned above is a good estimate (3m*1.1=3.3m).

Robin
  • 9,415
  • 3
  • 34
  • 45