Class PixelDepthLinearMetric

java.lang.Object
boofcv.alg.geo.triangulate.PixelDepthLinearMetric

public class PixelDepthLinearMetric
extends Object

Computes the depth (value of z-axis in frame A) for a single point feature given N observations and N-1 rigid camera transforms. The estimate will be optimal an algebraic sense, but not in a Euclidean sense. Two variants are provided in this class, for 2 views and N>1 views. All pixel coordinates are in calibrated units.

This linear estimation of pixel depth is done using the following equation:
λ1*hat(x2)*R*x1 + hat(x2)*T = 0
where λ1 is the pixel depth in the first image, x is an observation in calibrated homogeneous coordinates, and (R,T) is a rigid body transformation. Modified implementation of the algorithm described in [1].

To go from pixel depth to a 3D coordinate simply multiply the observation in calibrated (z=1) homogeneous coordinates by the returned depth.

[1] Page 267 in Y. Ma, S. Soatto, J. Kosecka, and S. S. Sastry, "An Invitation to 3-D Vision" Springer-Verlad, 2004

  • Constructor Details

    • PixelDepthLinearMetric

      public PixelDepthLinearMetric()
  • Method Details

    • depthNView

      public double depthNView​(List<Point2D_F64> obs, List<Se3_F64> motion)
      Computes the pixel depth from N views of the same object. Pixel depth in the first frame.
      Parameters:
      obs - List of observations on a single feature in normalized coordinates
      motion - List of camera motions. Each index 'i' is the motion from view 0 to view i+1.
      Returns:
      depth of the pixels
    • depth2View

      public double depth2View​(Point2D_F64 a, Point2D_F64 b, Se3_F64 fromAtoB)
      Computes pixel depth in image 'a' from two observations.
      Parameters:
      a - Observation in first frame. In calibrated coordinates. Not modified.
      b - Observation in second frame. In calibrated coordinates. Not modified.
      fromAtoB - Transform from frame a to frame b.
      Returns:
      Pixel depth in first frame. In same units as T inside of fromAtoB.