jAER project on SourceForge

net.sf.jaer.stereopsis
Class StereoGeometry

java.lang.Object
  extended by net.sf.jaer.stereopsis.StereoGeometry
All Implemented Interfaces:
java.util.Observer

public class StereoGeometry
extends java.lang.Object
implements java.util.Observer

Encapsulates stereo geometry. The basic geometry for parallel camera (infinite vergence) is shown in the following image.
geometry sketch

Author:
tobi

Constructor Summary
StereoGeometry(AEChip chip)
          Creates a new instance of StereoGeometry
 
Method Summary
 void compute3dlocationM(float px, float py, float disparity, float[] p)
          Computes the 3d location of the binocular point where 0,0,0 is the viewer between the eyes and z runs out from viewer, x horizontally from left to right in image with 0 at center, and y like x but vertically in image.
 void compute3dVelocityMps(float[] position, float disparity, float pvx, float pvy, float pvd, float[] p)
          Computes the 3d velocity of the binocular point where 0,0,0 is the viewer between the eyes and z runs out from viewer, x horizontally from left to right in image with 0 at center, and y like x but vertically in image.
 float computeViewerDistanceFromDisparityM(float disparity)
           
 float getBaselineMm()
           
 float getFocalLengthMm()
           
 float getVergenceDistanceMm()
           
 void setBaselineMm(float baselineMm)
          The baseline is the distance between the two eyes
 void setFocalLengthMm(float focalLengthMm)
           
 void setVergenceDistanceMm(float vergenceDistanceMm)
          The vergence distance is the distance from the viewer that the two eyes verge.
 void update(java.util.Observable o, java.lang.Object arg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StereoGeometry

public StereoGeometry(AEChip chip)
Creates a new instance of StereoGeometry

Method Detail

computeViewerDistanceFromDisparityM

public float computeViewerDistanceFromDisparityM(float disparity)
Parameters:
disparity - the total disparity in pixels between the left and right eyes, i.e. the shift required to bring a feature on one of them in registration with a feature in the other. (The shift can be in either eye or can consist of a shift in both, either way, the total disparity is the same.)
Returns:
the distance from the viewer in meters given a disparity. At present only handles parallel viewers

compute3dlocationM

public void compute3dlocationM(float px,
                               float py,
                               float disparity,
                               float[] p)
Computes the 3d location of the binocular point where 0,0,0 is the viewer between the eyes and z runs out from viewer, x horizontally from left to right in image with 0 at center, and y like x but vertically in image. Units are meters. A left or right eye position by itself only defines a line of sight but the combination of two lines of sight that cross at a corresponding point defines the corresponding point as a point in 3d space. Therefore the cyclopean point defined by a single location in the image plane of the combined binocular image, plus the disparity of this cyclopean point, defines a 3d location. At present only handles parallel left and right viewing angles that are not verged (i.e. viewing infinity).

Parameters:
disparity - the total disparity in pixels between the left and right eyes, i.e. the shift required to bring a feature on one of them in registration with a feature in the other. (The shift can be in either eye or can consist of a shift in both, either way, the total disparity is the same.)
px - the pixel x position of cyclopean position (mean of x positions from left and right eye)
py - the pixel y position of cyclopean position (mean of y positions from left and right eye)
p - a 3-vector where results are written
See Also:
compute3dVelocityMps(float[], float, float, float, float, float[])

compute3dVelocityMps

public void compute3dVelocityMps(float[] position,
                                 float disparity,
                                 float pvx,
                                 float pvy,
                                 float pvd,
                                 float[] p)
Computes the 3d velocity of the binocular point where 0,0,0 is the viewer between the eyes and z runs out from viewer, x horizontally from left to right in image with 0 at center, and y like x but vertically in image. Velocities are computed by straightforward scaling of image plane distance by distance of point from viewer, e.g. Vx=z/f*Px, where Vx is x velocity in 3d space, z is distance from viewer, f is focal length of camera, and Px is velocity in image plane. Only handles parallel left right viewing, i.e. foveating infinity, no vergence.

Parameters:
position - the x,y,z float 3-vector physical position in meters in eye coordinates as computed by compute3dlocationM(float, float, float, float[])
disparity - the disparity as used as earlier input for position (this saves computation internally)
pvx - the cluster's pixel x velocity in pixels per second
pvy - the cluster's pixel y velocity
pvd - the cluster's pixel disparity velocity
p - a 3-vector where results are written as velocity in meters per second in eye coordinate space. If the disparity is negative or zero, indicating infinite distance, all velocities are set to zero.
See Also:
compute3dlocationM(float, float, float, float[])

getBaselineMm

public float getBaselineMm()

setBaselineMm

public void setBaselineMm(float baselineMm)
The baseline is the distance between the two eyes

Parameters:
baselineMm - the distance in mm

getFocalLengthMm

public float getFocalLengthMm()

setFocalLengthMm

public void setFocalLengthMm(float focalLengthMm)

getVergenceDistanceMm

public float getVergenceDistanceMm()

setVergenceDistanceMm

public void setVergenceDistanceMm(float vergenceDistanceMm)
The vergence distance is the distance from the viewer that the two eyes verge. If the views are parallel the distance is Float.POSITIVE_INFINITY.

Parameters:
vergenceDistanceMm - the distance in mm

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
Specified by:
update in interface java.util.Observer

jAER project on SourceForge